ID:174913
Jul 7 2003, 2:12 pm
|
|
i want to have a turf that only some mobs can walk through but not others. the mobs that can walk through it shouldnt be able to walk through everything either. is there a way to do this? if so, how?
|
Jul 7 2003, 2:40 pm
|
|
Look up Enter() in Dream Maker's online help (remembering that using usr in Enter() is one of the great sins of DM programming).
|
One addendum to Crispy's note: be aware that atoms have two similar procs, Enter() and Entered(). Enter() is used for checking whether something can enter. Entered() is used for taking an action when something has entered.
|
In response to Gughunter
|
|
i figured it out. but i dont see why i cant use usr. infact it wouldnt let me have it any other way. i wanted to make it so mobs with variable Walkonmountain=1 to be able to walk on the mountain part of the map. i used if(usr.Walkonmountain==1)
return 1 it works fine and i tried src instead of usr and it said undefined variable or something like that. |
In response to Siefer
|
|
Just because src doesn't work, that doesn't mean that usr is the only other choice. Read the documentation for Enter() really carefully. Note the argument that gets passed to it. Use that argument instead of usr.
|
In response to Crispy
|
|
i'll do that. but why cant i use usr? i mean why is it so incorrect?
|
In response to Siefer
|
|
Because it's null or another mob if an obj moves onto the turf, and it can be the wrong mob if, say, you have some means of pushing other mobs.
|
In response to Siefer
|
|