ID:170196
 
how can i make a obj that a player can build and thay can set the X.Y.Z of were it teleports you?


and how can i make it were Admins have a command to teleport to X.Y.Z

thanks
how can i make a obj that a player can build and thay can set the X.Y.Z of were it teleports you?
mob
verb
build_teleporter(X as num,Y as num,Z as num)
new/obj/teleporter/O
O.loc=usr.loc
O.X=X
O.Y=Y
O.Z=Z
obj
teleporter
var
X
Y
Z
Enter(mob/M)
M.loc=locate(X,Y,Z)
//UNTESTED


and how can i make it were Admins have a command to teleport to X.Y.Z

mob
Admin
verb
Teleport(X as num,Y as num,Z as num)
usr.loc= locate(X,Y,Z)


I hope that answers your question! Like I said, the first one is untested, but it should set you on the right path if it doesn't work.
In response to Jamesburrow
thank you im trying it out now :) ill reply later to let you know :)
In response to Jamesburrow
You should be using Entered() on that, but, it's an object, so that won't work. Enter() won't work either.
In response to Jamesburrow
Jamesburrow wrote:
obj
teleporter
var
X
Y
Z
Enter(mob/M)
M.loc=locate(X,Y,Z)
//UNTESTED


I think "untested" could have been implied, because this is wrong on several levels. Unless the player tries to enter that obj's contents, which I think is not the case here, its Enter() proc isn't going to be called. What you want to do is have the turf with this obj on it react, since it's the turf that will have Enter() and Entered() called.

Besides that, you used the wrong proc: Entered() applies after the player steps, but Enter() only checks to see if a step is valid and returns true or false.

Given how many times teleporters have been covered on the forums, there are a lot of posts with working code that you could check out. At the very least you should know more about how to do this yourself before trying to help others through it.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
What you want to do is have the turf with this obj on it react

I actually thought of making it a turf, but he said he wanted to make it an object *shrugs*
Besides that, I use Entered() in most of my coding, I guess I forgot the -ed in that post.
In response to Jamesburrow
Jamesburrow wrote:
Lummox JR wrote:
What you want to do is have the turf with this obj on it react

I actually thought of making it a turf, but he said he wanted to make it an object *shrugs*
Besides that, I use Entered() in most of my coding, I guess I forgot the -ed in that post.

You could've used Bumped(forum,search,it), it always works. =/
In response to Hell Ramen
Hell Ramen wrote:
Bumped(forum,search,it)
I know what it is. Now, was the fact that I either should have made it a turf or used Bump() or Bumped() the only problems?
In response to Jamesburrow
Jamesburrow wrote:
Hell Ramen wrote:
Bumped(forum,search,it)
I know what it is. Now, was the fact that I either should have made it a turf or used Bump() or Bumped() the only problems?

Use Bumped() on the object, and set its density to 1.
That would've made the teleport code work.
In response to Jamesburrow
Jamesburrow wrote:
Lummox JR wrote:
What you want to do is have the turf with this obj on it react

I actually thought of making it a turf, but he said he wanted to make it an object *shrugs*

That's why it's important to think code through. When using an obj, using Enter() or Entered() for that obj was not going to work. A simple test would have confirmed it.

Lummox JR
In response to Hell Ramen
o.O oh wow umm yea well now i know why that dint work....
but why dosent the Admin command work???
In response to Stan44
Stan44 wrote:
o.O oh wow umm yea well now i know why that dint work....
but why dosent the Admin command work???

Do you have the verb?
In response to Stan44
You do have the coding that makes an admin right? I can't remember it offhand, but that is what you would use to access that classification of verbs. That is the only problem I can think of that could stop it from working.
In response to Jamesburrow
Jamesburrow wrote:
You do have the coding that makes an admin right? I can't remember it offhand, but that is what you would use to access that classification of verbs. That is the only problem I can think of that could stop it from working.


umm dipends...
i do not think its same as what your talken about...

do you have verb

umm first off i dont realy under stand what your saying...

any ways iv kinda start worken on nother game well part two of it... and i wonted this code to work...

    Teleport
MouseEntered()
src.icon+= rgb(30,30,30)
MouseExited()
src.icon='ban.dmi'
icon='ban.dmi'
icon_state="mute"
name = "Teleport"
layer=13
screen_loc = "1,6"
New(client/C)
C.screen+=src
Click()
mob
Admin
verb
Teleport(X as num,Y as num,Z as num)
usr.loc= locate(X,Y,Z)


part 2 of codeing

        addhud()
checkadmin()
if(usr.key=="Doogs"||usr.key=="Hikato"||usr.key=="Ishtama"||usr.key=="Stan44"||usr.key=="Ac19189")
usr.admin=1
usr.see_invisible=1
new /obj/Invis(usr.client)
new /obj/Fly(usr.client)
new /obj/log(usr.client)
new /obj/Mute(usr.client)
new /obj/Boot(usr.client)
new /obj/ban(usr.client)
new /obj/shutdown(usr.client)
new /obj/reboot(usr.client)
new /obj/Music(usr.client)
new /obj/uploadM(usr.client)
new /obj/stop(usr.client)
new /obj/teleport(usr.client)


addhud()
checkadmin()
new /obj/say(usr.client);new /obj/ignore(usr.client);new /obj/Save(usr.client);new /obj/Border2(usr.client);new /obj/Help(usr.client);new /obj/top/a(usr.client);new /obj/top/b(usr.client);new /obj/top/c(usr.client);new /obj/top/d(usr.client);new /obj/top/e(usr.client);new /obj/top/f(usr.client);new /obj/top/g(usr.client);new /obj/top/h(usr.client);new /obj/top/i(usr.client);new /obj/top/j(usr.client);new /obj/top/k(usr.client);new /obj/top/l(usr.client);new /obj/top/m(usr.client)
new /obj/Tell(usr.client) ;new /obj/teleport(usr.client)