on My new game im finaly making buildings and im wondering how to make portals for them to go to a new map when they walk in the door.
if someone can give me a tip without giving out the whole code.
iv tried using loc on turfs to make them spawn somwhere else but it didnt work.
ID:156718
![]() Aug 9 2010, 3:24 pm
|
|
ok. So i tried and you mite as well help me lolz cause i feel dumb continuing. this is what i tried seeing how i didnt really understand. Sorry if this is easy and im not getting it.
turf/portal/Entered(atom/movable/A) |
Look up locate and loc in the DM Reference.
If you don't know how to do something, the DM Reference is your best buddy. |
Well, you clearly don't know the syntax of the language, so you're going to need to read some tutorials.
|
Might use this.
turf This should help you out. |
Enter is the wrong event hook to use when you want to process some action. It should be used to determine accessibility of movement. What you want is Entered.
And a hard-coded locate call is rather ugly when you want to change the map later on. Why not use a tag instead? |
Hey thanks all i havnt really figured it out yet but i'm still trying if you can explain a lil more in detail it would help alot thx.
|
Why do people do Enter(ed)(A) then go through the hassle of doing var/mob/M = A (especially when you confirmed only mobs should be able to step on it)? As far as I know it's as efficient either way it's just a bit of a quirk to me.
|
It is because some non-mobs can step on it, so we do not want to treat them as mobs until we have confirmed that they are indeed mobs.
In the example, if a mob enters the turf, then it will teleport. If an object does (such as an attack) it gets deleted. |
turf/grass/Entered(mob/M) That's what I meant. There's no need for a second variable if only mobs are permitted entry. |
Flame Sage wrote:
Look up locate and loc in the DM Reference. What if it is on a different map? lets say you have 3 maps, one is the main map, on is a shop, and one is a house, how would you make the portal, to go to the shop map? |
When the game is compiled, it fuses all of the maps into a giant map, and just increases the z layer.
|
You can move stuff around by using locate() to find a target turf to send the object to, and then set the object's 'loc' variable to be that location.