ID:163701
Aug 8 2007, 4:11 am
|
|
Ok well i need help how would i make a portal that would tele the player onto another map??
|
In response to Asha_LaPoe
|
|
I believe if you use Entered() instead, you can avoid needing to use code to step off the portal.
|
In response to Rifthaven
|
|
In addition, never use usr in implicit procedures (by this, I mean where usr is not clearly defined as the current client calling that certain procedure... only suitable safe-usr usage I know of is in Click()/DblClick(), Stat() and in verbs). Movement procs (Move(), Enter(), Bump(), etc) are implicit procs thus usr is not likely to be the current mob in question (look up usr in the DM Ref... it does NOT mean user).
|
In response to Rifthaven
|
|
Rifthaven wrote:
I believe if you use Entered() instead, you can avoid needing to use code to step off the portal. Ok good point. For me I use the step feature to help the effect of say... a doorway. Step into the bank and you're warped into the doorway + 1 step inside. That way by backing up you step back onto the portal to go outside. (this is if you utilize your destination turf as a portal when making a return trip) Thanx for the Entered() note tho, i'll be using it. |
In response to GhostAnime
|
|
So it would be cleaner and more proper to use M. instead of usr right?
if(ismob(M)) glad to scoop up pointers such as this. :-) |
In response to GhostAnime
|
|
Pretty much anything defined under client is usr-safe, too.
|
In response to Jp
|
|
I'm having an issue with locate()
if (M.loc == locate(/turf/portal))
That's fine if your standing on the first /turf/portal Byond finds. But I want it to work if you are standing on any of my portals. Or rather, I DON'T want the effect to work if you are not on a portal. That's what i'm using this if statement for. (I'm using a clickable link to choose your next destination and the link remains even after you are ported) I tried altering the player's icon state when they are on portals and using... if (M.icon_state == "teleporting") help plz, and if you do need to see my entire code i'll post it for ya'll. <^> |
In response to Asha_LaPoe
|
|
Confucious say: Reply to wrong post like talking to wall.
Anyway, as for your problems: The first one is solved simply by checking the type of your location: if(istype(m.loc, /turf/portal)) |
In response to Jp
|
|
Splendid! Exactly what I was needing.
Say, do you know how to paralize a player's movement temporarilly? I'll go see if i can find it myself before your reply. :-) |
In response to Asha_LaPoe
|
|
Tbere's no inbuilt procedure, but you can just override Move():
mob |
In response to Jp
|
|
Just dandy. I used icon_state to decide when to override movement. Here is the finished effect...
It's safe to use usr. in Topic right? |
In response to Asha_LaPoe
|
|
I'm not sure about the usr-safety of atom/topic(), but you are abusing usr in mob/Move(), turf/tubes/start/Entered() and /turf/tubes/start/Exit().
Movement procedures are quite possibly the unsafest place to use usr. What you should be using is 'src' in Move(), and the argument passed in Entered() and Exit() (Remember to check that the thing passed is actually a mob using ismob() if it's relevant!) To get an idea of why usr is unsafe in movement procedures, try this code: turf/fire/Entered() Then try pushing someone into the fire. |
In response to Jp
|
|
Jp wrote:
I'm not sure about the usr-safety of atom/topic() Topic() is usr-safe. usr is the player that clicked the link. Of course, no proc is safe when it's called manually. But for Topic() you can use the link() proc to call it manually without the potential of making usr unsafe. -- Data |
Then just make a second turf called 'heaven' and put it somewhere on your other map.
I like the sleep() function because it lets the player get all the way on the transporter before they are wisked away.
Next you'll make a portal to come back from heaven right?
a neat trick to ensure you are not already being beamed back when you first arive is to add this at the bottom...
step (usr,EAST) // Gets you off the 2nd portal before you get sent right back.
/bow
This was my first Forum post ever. :-)