ID:163701
![]() Aug 8 2007, 5:11 am
|
|
Ok well i need help how would i make a portal that would tele the player onto another map??
|
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).
|
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. |
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. :-) |
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. <^> |
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)) |
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. :-) |
Tbere's no inbuilt procedure, but you can just override Move():
mob |
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? |
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. |
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. :-)