ID:175864
![]() Mar 2 2003, 3:47 pm
|
|
I neeed to make some thing just walk can somebody show me a example?
|
![]() Mar 2 2003, 4:04 pm
|
|
look up walk_rand()
|
sorry to butt in..but, how do u use walk_rand effectively... i cant seem to figure out where to put it to call it
|
In one of my rpgs this is what i did for my guards:
mob/guards/Recruit_Guard |
thanx
[edit] heh, i implemented it and I started walking around randomly when i went idle...thought wtf? realized i forgot to indent it to the NPC side instead of all mobs^_^ |
Erm, that code is error-ridden. Let's go through it, shall we?
proc/Wander() while(src) if (P in oview(1)) //oview(1) == oview(usr,1) == BAD! Don't use usr in procs. Change it to oview(src,1). step_towards(src,P) else step_rand(src) for(P in view(src)) //So you lok for a monster in view(src), and if you find one, stop looking? This is pointless. break sleep(10) spawn(40) Why would you call Wander() when the while(src) check fails? That would mean that src no longer exists, and thus, this is useless. Wander() |
I got rid of everything that wasnt required in that code... i was thinking of posting what i had changed, but figured anyone who uses it should be able to figure it out^_^
|
Garthor wrote:
Erm, that code is error-ridden. Let's go through it, shall we? I think it would be better to say, "That error is code-ridden.". :D ~>Volte |
lol, u guys are mean, give the poor guy a break^_^ Hey thanx man for the code, u got my NPCs walkin aruond:D
|
me? sure..
let someone okay that before you use it, i may have screwed up, im a newb too^_^ mob Char NPC New() Wander() mob proc Wander() step_rand(src) spawn(20) Wander() |