ID:272794
![]() Feb 16 2009, 3:47 pm
|
|
How do you make a loop into an AI system?
|
There is usr abuse in those examples. As you of course supply no center atom to use with a call like oview(3), it obviously has to use something for it, and what it uses is the default value of its Center arg, usr. Common mistake.
Other less important small things about the code:
|
You could be asking about any number of things.
First could be a for() loop for finding mobs, that would be done by looking up for() in the DM Reference.
This will loop through every mob in a 5 tile radius and give him +1 HP (not counting the user himself)
Another would be a repeating AI system to repeatedly check for something. That would be done as simply as creating a looping proc with a sleep() in it then calling it at new().
That would cause the monster to step towards any mobs in a 3 tile radius every 10 ticks (1 second).
If you want a more specific answer you need to ask a more specific question.