ID:150157
![]() Dec 5 2001, 11:58 am
|
|
I've tried several different ways and none of them worked. Can someone tell me how to change a mob's z level?
|
![]() Dec 5 2001, 11:58 am
|
|
src.loc=locate(x,y,z)
|
usr.move(locate(1,1,z) //z being new z level
(don't use different maps. Using different maps is bad!) unimatrix |
I tried:
Entered(atom/M) if(ismob(M)) var/n = M.z - 1 usr.loc = locate(M.x, M.y, n) But, when I compile, I get the following error: "M.loc:cannot change constant value" Maybe it's a bug? (I'm using 307b10) |
Evilkevkev wrote:
I tried: I think your problem is that you're using usr instead of M. The usr value is probably defined as an ordinary atom, not an atom/movable. You can also changed atom/M to atom/movable/M, so DM will know that changing M.loc is legal. Lummox JR |
Why dont you try
turf grass icon = 'grass.dmi'//you need the grass icon Enter() usr.loc=locate(x,y,z) or even better use tags instead of locations |
or even better use tags instead of locations Not for my purposes, I just need it to move to a different z level because the layout of the area is exactly the same and all the changes is the z level. I can't just say "go to z level 5" because there are are three levels all with this same stairs turf and stairs on z level 3 would send you to 5 as well as z level 1 and 2 and 4. I got it figured out, though. Thanks anyway. |
unimatrix wrote:
(don't use different maps. Using different maps is bad!) There is absolutely nothing wrong with using separate map files. You just have to keep track of which level is which, either manually or within the code. You also need to remember that the maps will expand to the size of the largest file included. I find using separate map files very useful. If I wish to change a level, it's much easier to find if the files are separate, and you can add or remove levels simply by toggling a checkmark. If I want one dungeon level in the debug version but a different one if it is the final release version, it's much easier to use a single level in each map file and select the right one for the current task. Using different maps is fine. Predisposing newcomers against something you don't understand clearly is bad. |