What I'm trying to do is get a group of monsters to walk in a straight line. There are no obstacles in the way (walls, water, models, etc). The issue I'm having is that the distance is out of sight from the start point. I'm currently using the monster controller script command (mobspawn) which is in a for loop and spawns 20 monsters. Inside the for loop the monsters are given the directive to walk to a way point (Which later lead to other way points which vary in 10-12 cells apart). I have these NPC which are my way points:
testmap,50,74,1 script #MobStart -1,1,1,{
end;
OnTouchNPC: // Walk to next location.
unitwalk getunitid(0),50,62;
end;
}
testmap,50,62,1 script #MobQuarterWay -1,5,5,{
end;
OnTouchNPC: // Walk to next location.
unitwalk getunitid(0),50,49;
end;
}
testmap,50,49,1 script #MobHalfWay -1,5,5,{
end;
OnTouchNPC: // Walk to next location.
unitwalk getunitid(0),50,37;
end;
}
testmap,50,37,1 script #Mob3QuarterWay -1,5,5,{
end;
OnTouchNPC: // Walk to next location.
unitwalk getunitid(0),50,23;
end;
}
getunitid(0) is just a script command I made which returns the game ID of the monster that is attached to the script (it triggered the OnTouchNPC label). So this works part of the time. The start off is fine, the monsters walk to the first way point. Once the monsters touch the first way point they seem to get confused and walk around for a bit and then figure out they are supposed to walk to the next way point (At this point my map server is spitting out the unitwalktimer mismatch errors). The monsters eventually reach the end of the line but I want the monsters to walk at a steady pace from the start (no wandering around). Would the walking around issue be part of the randomwalk that monsters are given? I guess I can play around with removing the randomwalk from the spawned monsters and see how that goes.
Question
Aleos
What I'm trying to do is get a group of monsters to walk in a straight line. There are no obstacles in the way (walls, water, models, etc). The issue I'm having is that the distance is out of sight from the start point. I'm currently using the monster controller script command (mobspawn) which is in a for loop and spawns 20 monsters. Inside the for loop the monsters are given the directive to walk to a way point (Which later lead to other way points which vary in 10-12 cells apart). I have these NPC which are my way points:
getunitid(0) is just a script command I made which returns the game ID of the monster that is attached to the script (it triggered the OnTouchNPC label). So this works part of the time. The start off is fine, the monsters walk to the first way point. Once the monsters touch the first way point they seem to get confused and walk around for a bit and then figure out they are supposed to walk to the next way point (At this point my map server is spitting out the unitwalktimer mismatch errors). The monsters eventually reach the end of the line but I want the monsters to walk at a steady pace from the start (no wandering around). Would the walking around issue be part of the randomwalk that monsters are given? I guess I can play around with removing the randomwalk from the spawned monsters and see how that goes.
If anyone has any input I would appreciate it!
Edited by AleosLink to comment
Share on other sites
14 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.