Ok theres 2 codes i need to make 1 is a proc and 1 is a mob
Proc:
i want the proc to say if your hp is less than a certain number you lose control of your body and its like you turn into an npc who keeps attacking anything that it sees
Mob:
*this the blue book had something similar to i just couldnt get it to work using their instructions
well im not sure if this goes in the mob category but uh i need to make a car mob that drives right for a certain number of squares then up for a certain number etc etc i thought i could use step_towards but it didnt work..
If you can even point me in the right direction or give me the link to a page of the blue book i couldve missed somehow i'd apprieciate it thanks.
ID:161257
May 28 2008, 10:46 am
|
|
In response to Popisfizzy
|
|
If he's going to be using this for a lot of cars, it might be better to use a game loop to call each car's drive() proc which would just step_towards() the current target turf every so often. All he'd really need is a list of waypoints to step_towards() each time the game loop tells the car to drive, keeping track of the current target point and moving on to the next in the list when it reaches it, or if it can't reach it. That would allow him to create a control system to create a list of waypoints for new cars or new paths at runtime.
|
In response to Xooxer
|
|
If he's going to be using a lot of cars, I can only assume he's going to be making something GTA-esque, in which case each car should handle it's own AI and just drive in random straight lines on roads unless forced to do otherwise. =P
|
In response to Popisfizzy
|
|
Um, isn't that doable with a game loop too? I mean, I think my system does that (minus the random, with little AI). Plus, your system lacks a control, giving each car it's own. If you need to slow them all down a bit to save CPU, it's going to be easier with a game loop.
Meh, we're probably looking into it too much. He might just want one car. |
In response to Xooxer
|
|
Yea, I'm not going to debate here because this isn't design philosophy. =P
|
In response to Popisfizzy
|
|
Well that was a funny arguement >.> as far as more than one car goes yeah i'll have maybe five most now back to the real subject O_O your codes are helping alot thank you very much PS: no i did not copy and paste.
|
For the first one, you would have to make sure that keyboard and mouse input do nothing (likely with a simple boolean variable and checks in Move() and any instance of Click()). To remove verbs, you could either follow a similiar system, or simply remove all the verbs from the player, storing them in a list until needed again, and then re-add them.
Note: To make grabbing the verbs from the player easier, you can use one of the new list operations, which most people probably don't know about. In this case, you can use &. This will grab all the elements that are in both lists.
Example code on how to do this:
For the second one, if you really want something that just drives in straight lines, you'll simply need something like this:
This code makes one assumption. Firstly, a has to be on the same z-level. It will still move the appropriate location, but only for the x and y coordinates. It also won't go around obstacles, which would require a pathfinding algorithm and a slightly more complex bit of code.
Unless you know and understand bitwise math (in which case you should get it anyways), don't ask about the directions & (...)) stuff.