ID:269723
 
Hi im halovader and this is where im gonna put my games on.But how do i make it that if i have an object in my Objects panal.Then i can teleport to the place its defined.Like if u enter somthing.And if you make the teleport.U come to the place its made to do it and the object deletes.The objects come at the objects panal and if u click on the object(right) and click teleport you go there.
Have the object have variables with the location it should locate you to set and then locate to those variables such as locate(O.(variable for the x),(O.(variable for the y), O.(variable for the z)). And then just del the object when its done.
Heh, you just reminded me to make those teleport scrolls, and it worked :-)

obj
teleporter
var/tmp
tel_locx
tel_locy
tel_locz

icon = 'test.dmi' //Don't use this...
icon_state = "tele"

verb
teleport()
set category = null
usr << "[src] flashes and wheeeeee!"
usr.Move(locate(tel_locx,tel_locy,tel_locz))

teleA
tel_locx = 1
tel_locy = 5
tel_locz = 1

teleB
tel_locx = 5
tel_locy = 1
tel_locz = 1
In response to Cheruby
Cheruby wrote:
Heh, you just reminded me to make those teleport scrolls, and it worked :-)

> obj
> teleporter
> var/tmp
> tel_locx
> tel_locy
> tel_locz
>
> icon = 'test.dmi' //Don't use this...
> icon_state = "tele"
>
> verb
> teleport()
> set category = null
> usr << "[src] flashes and wheeeeee!"
> usr.Move(locate(tel_locx,tel_locy,tel_locz))
>
> teleA
> tel_locx = 1
> tel_locy = 5
> tel_locz = 1
>
> teleB
> tel_locx = 5
> tel_locy = 1
> tel_locz = 1
>


I meant its installed to go as example (1,1,1)
In response to Big games.inc
Yeah, try it. It'll show up in the object's menu and the verb is hidden from the verb panel :-)
In response to Cheruby
BTW he cant teleport it.Nothing happens.Only the text comes.
In response to Big games.inc
He dosent want to teleport


obj
teleporter
var/tmp
tel_locx
tel_locy
tel_locz

icon = 'special.dmi' //Don't use this...
icon_state = "inn"

verb
teleport()
set category = "teleport"
usr << "[src] flashes and wheeeeee!"
usr.Move(locate(tel_locx,tel_locy,tel_locz))

Newchar
tel_locx = 5
tel_locy = 246
tel_locz = 1
In response to Big games.inc
Big games.inc wrote:
BTW he cant teleport it.Nothing happens.Only the text comes.

Then something is incompatible in the code, I only made really simple functions so you can see how it works. If you actually want to have it in your game you also want to make sure there's nothing already on the target turf and there are many many more things to add.

But just to make sure the code I gave you actually works, try this in a new environment:

mob
player
icon = 'test.dmi'
icon_state = "player"

verb
get(obj/O as obj in view())
O.Move(usr)

Stat()
if(src == usr)
if(statpanel("Inventory"))
stat(contents)

obj
teleporter
var/tmp
tel_locx
tel_locy
tel_locz

icon = 'test.dmi'
icon_state = "tele"

verb
teleport()
set category = null
usr << "[src] flashes and wheeeeee!"
usr.Move(locate(tel_locx,tel_locy,tel_locz))

teleA
tel_locx = 1
tel_locy = 5
tel_locz = 1

teleB
tel_locx = 5
tel_locy = 1
tel_locz = 1

world
mob = /mob/player
turf = /turf/lulala

turf
lulala
name = "testground"
icon = 'test.dmi'
icon_state = "turf"


Just make sure you have something like a 10 x 10 map, and add some icons.
In response to Big games.inc
In that case, make sure the usr is really the mob using the scroll, or else you have to make a new mob variable.

EDIT: Actually, if the text comes then using "usr" is fine.

EDIT2: I just tried, it's 95% problem with your tel_loc's, tel_locy might be too big for your map? (When that's the case usr won't Move)
In response to Cheruby
My map is realy big.But i made it good.He only looks left when i click it.
In response to Cheruby
By the way the object must be deleted when used and object must come back where the player got it