if(usr.monsterfollow != null)
usr.monsterfollow.Move(usr.loc)
this is only part, but its what you need. Now, Ive tried loc = locate(usr.loc) as well, but the same problem. Please help!
ID:172121
Jun 25 2004, 3:56 pm
|
|
Okay I have a monster system, and I need the monster to be located whenever I am moved, so heres the problem, it doesnt always work. Heres my code
if(usr.monsterfollow != null) this is only part, but its what you need. Now, Ive tried loc = locate(usr.loc) as well, but the same problem. Please help! |
In response to DarkView
|
|
i cant use src because its turfs, but ill check it out, reply back in a min...
|
In response to Metroid
|
|
You're using Enter() or Entered() right? They have a value passed on to them.
turf A is anything that's successfully entered the turf. Remember, not just mobs can move, objs can as well. So we have to check to see if A is a mob. Then after finding out it's a mob, we throw it in a new mob type var called M. You can get away without doing this, but it makes it more readable. Then we do what you've done already. |
Second. You can directly edit the usr.monsterfollow's loc var and set it to usr.loc. So usr.monsterfollow.loc = usr.loc will do it.
Third. Make sure that you're using usr correctly. A simple rule of thumb is if you can pass the value on or use src, then you shouldn't use usr.