Hello,
Could someone please tell me how to, when you are at a certain point on the map, You move to the next map.
I saw a couple ways but didnt understand them.
~Thank You
ID:162561
![]() Dec 22 2007, 6:25 pm
|
|
![]() Dec 22 2007, 6:49 pm
|
|
I use the "x" variable to move through maps.
|
DadGun wrote:
I use the "x" variable to move through maps.could u please go into further details if u can? i still dont quit follow o.O; |
He's providing advice that is wrong on multiple levels.
The proper way to link maps together is by using tags. Right-click on any turf on one map, and edit its properties. Change its tag to something unique and easy to identify. IE, if you have a dungeon map, then give the entrance turf the tag "dungeon_entrance". Once you do that, you can - in any part of your code - use locate("dungeon_entrance"), and it will find that turf again. Now, you'll want to be able to use that information. The most common case of this is that you want to step on one turf and be moved to another. So, use Entered(): turf/teleporter //any kind of teleporter Now, you can place the teleporter turf somewhere, and once again right-click on it and edit its properties. This time, you'll have to change the destination variable to match the tag of where you want the teleporter to go. So, set it to "dungeon_entrance" and you now have a turf that - when you step on it - will take you to the dungeon. |
Garthor wrote:
He's providing advice that is wrong on multiple levels. turf/teleporter //any kind of teleporter Now, you can place the teleporter turf somewhere, and once again right-click on it and edit its properties. This time, you'll have to change the destination variable to match the tag of where you want the teleporter to go. So, set it to "dungeon_entrance" and you now have a turf that - when you step on it - will take you to the dungeon. thank u very much, but afew more questions... were it says var/destination = "" do i put something like Town1_Entrance once i have tagged the spot? lastly... were it says var/turf/T = locate(destination) do i erase destination and put the location (EX: 15,1,1)? oh and, do i do anything with the "T"? |
You do not need to put each and every teleporter you want to use in the code file, and doing so would just make it harder for you. I already explained it: you place a teleporter somewhere, right-click on it, and edit its properties. You change the destination variable there, not in your code.
Nothing in that code snippet is psuedo-code. All of it works. locate(destination) is locating the turf with a tag that is the same as the destination variable. T is the turf to be teleported to, and the if(T) M.loc = T lines moves the mob entering the teleporter to that turf. |
Garthor wrote:
You do not need to put each and every teleporter you want to use in the code file, and doing so would just make it harder for you. I already explained it: you place a teleporter somewhere, right-click on it, and edit its properties. You change the destination variable there, not in your code. Im still not quit sure but you did clear up most of my problems. i sometimes end up on another part of my map or with a black screen. I cant seem to get to the other map >.< turf/teleporter //any kind of teleporter This is what i got, am i going in the right direction? |
Yes and no.
Setting the variable 'destination' to "town1_entrance" is fine. But leave the locate statement alone. It will use what is stored in the destination variable as, funny enough, what you set it to (in this case: "town1_entrance"). |
digitalmouse wrote:
Yes and no. It does teleport me, but to the bottom left hand corner of my map i was just on, not to were i want it to go (to my other map, Town1) here is what i put o.O; turf/teleporter //any kind of teleporter Do i check more than one map (the little box)? i just check the starting map. O.O; |
Stop messing with the code I posted. What I posted was exactly what you needed and should be left unmodified. You need to place the turf/teleporter on your map, right-click on it IN THE MAP EDITOR, and edit its properties IN THE MAP EDITOR, change the destination variable IN THE MAP EDITOR the the tag you gave to another turf IN THE MAP EDITOR.
IN THE MAP EDITOR |
Garthor wrote:
Stop messing with the code I posted. What I posted was exactly what you needed and should be left unmodified. You need to place the turf/teleporter on your map, right-click on it IN THE MAP EDITOR, and edit its properties IN THE MAP EDITOR, change the destination variable IN THE MAP EDITOR the the tag you gave to another turf IN THE MAP EDITOR.oh...srry >>; Its working now Thanks!!! Alot!!! |