ID:155510
 
Hi,it's me again,i have finished a lot of systems on my game,but now,i need to make the map transaction,you know,make the character teleport from one map to the other,but i wan't to make he teleport if the character hit the side of the map that i setup on the script.Ex:I move my character,and he hits the right side of the map,my character teleports to the other map on the x 0 position,but the same y positon,i wan't to do anything like that.

So,anybody know how to do this?

Obs:.I searched the forum tutorials and looked the guide,to see if i found anything else,but i didn't.
mob
Move()
.=..()/*. is a variable assigned to all procedures/verbs, it is the return value of the procedure;
for Move, it returns 1 if the mob successfully moves without bumping into something*/


/*..() is the default procedure/verb, it will execute the original, then it will execute the
code following it; the default move procedure checks to see if the new location to move to is dense,
if it isn't, move there and return 1, or else return 0 and don't move*/


if(.)//if the mob successfully moves i.e: ..() returns 1
var
area/teleporters/teleporter = locate(x,y,z)/*locate(x,y,z) returns the
object at the user's location, the type is /area, so it will return an /area*/


if(teleporter && istype(teleporter))/*if the /area returned by locate is indeed
a teleporter, and the /area actually exists*/


loc=locate(0,y,teleporter.trans_z)/*move the mob to the next map, keep
his y, and make his z the teleporers trans_z variable, which should be the variable you want the mob to move to*/


area
teleporters//define the type
var
trans_z=0//give a variable
A
trans_z=1
B
trans_z=2
//...etc...
In response to Ill Im
Thanks but...I wan't to make the teleport to another map/area.
Not another floor.
In response to Nakano15
.... dude what are you talking about?
You can use tags...

That does teleport to another map. The Z variable leads to another map.

You can use tags, other than that, what you're requesting makes no sense.
In response to Ill Im
Wouldn't it be easier to use Entered() if you are using the /area in a specific transportation sector?
In response to GhostAnime
Not sure, I usually always have problems with using
Enter(),Entered() or Bump() with /areas (it may just be me though)
In response to Ill Im
The map i wan't to teleport my character,aren't a Z position map,but another map.
In response to Nakano15
When you have multiple maps compiled, the reality is that, when compiled, they will not be different maps but it will be merged as one, the Z level assigned - if I remember correctly - is based on alphanumerical order.

So if you have "Banana.dmm" with 3 Z levels and "Apple.dmm" with 2 Z levels and "Orange" with 1 Z level, the following will be their Z level to DM:
Apple = 1-2
Banana = 3-5
Orange = 6


To get the Z level of the different map location, you would need to put a pointer object on the map. Let it be through the use of tag variable or a specific path:
var/object/X = locate("tag" or /path)  //  will locate the unique tag/object
world << "Z location is [X.z]"
In response to Ill Im
Calling Bump() with /area will be impossible unless it has a density.

/area is unique that, unlike /turf, all parts of /area is treated like one. So when you enter /area/X from a different /area (ex: /area/Y), Enter/ed() will be called - but if you walk from one to another same area (ex: /area/X to /area/X), Enter/ed() will not be called.

Edit: Do not forget to check the argument passed by Enter() and it's related procedure. Even if you define the argument to be a /mob, it doesn't mean that a /mob will call the procedure but other types can call it as well.
In response to Ill Im
You kinda have to learn by experience where the proper placement of ..() is in your code for different, built-in functions.
In response to OrangeWeapons
So,the Z is the number of the map in order(counting too the Z of the maps)?
Wow,thank you.I'll try that.
In response to Nakano15
Weird,i created the areas and put the scripts,as
ill said,but when i enter the area,nothing happens.

I already configured it and more,but this isn't are working.

and yes,i placed the areas on the map.

Obs:.The sintax checker didn't showed any error.
loading VirusMON.dme
loading Interface.dmf
loading 1_Netonia Field area 1.dmm
loading 2_Netonia Field area 2.dmm
saving VirusMON.dmb

VirusMON.dmb - 0 errors, 0 warnings
updating 1_Netonia Field area 1.dmm...done

The script
mob
Move()
.=..()/*. is a variable assigned to all procedures/verbs, it is the return value of the procedure;
for Move, it returns 1 if the mob successfully moves without bumping into something*/


/*..() is the default procedure/verb, it will execute the original, then it will execute the
code following it; the default move procedure checks to see if the new location to move to is dense,
if it isn't, move there and return 1, or else return 0 and don't move*/


if(.)//if the mob successfully moves i.e: ..() returns 1
var
area/teleporters/teleporter = locate(x,y,z)/*locate(x,y,z) returns the
object at the user's location, the type is /area, so it will return an /area*/


if(teleporter && istype(teleporter))/*if the /area returned by locate is indeed
a teleporter, and the /area actually exists*/

if(next_x == 0)
teleporter.next_x = src.x
if(next_y == 0)
teleporter.next_y = src.y
loc=locate(teleporter.next_x,teleporter.next_y,teleporter.trans_z)
//move the mob to the next map, keep

// loc=locate(0,y,teleporter.trans_z)//move the mob to the next map, keep
// his y, and make his z the teleporers trans_z variable, which should be the variable you want the mob to move to*/

area
teleporters //define the type
var
trans_z=0//give a variable
next_x=0
next_y=0
net_fild01
trans_z=1
next_x=1
next_y=0
net_fild02
trans_z=2
next_x=24
next_y=0
//...etc...
In response to Nakano15
Is it teleporting you to a black space, or do you mean -nothing- at all is happening?
In response to Ill Im
Nothing happens,when my character enter the area,nothing happened.
In response to Nakano15
Try using Entered() then.
area/teleporters
var
X
Y
Z
Entered()
if(X&&Y&&Z&&)
usr.loc=locate(X,Y,Z)


In response to Ill Im
It worked!
Thanks you!
The map teleporting is working 100%.
Thanks your all.^^