Page 1 of 2

Tele script

Posted: Thu Apr 26, 2012 7:24 pm
by mailstorm
Hi there im sorry if i open this post in wrong place
I was wondering how to mkae script using userfunction from Rock
i want move my haracter to position a1 and from a1 to a2
and finish script i have coordinates but i have no idea how to set it working :(
please help

Re: Tele script

Posted: Fri Apr 27, 2012 12:29 am
by rock5
At waypoint a1 use

Code: Select all

teleport(x,z,y)
Where x,z,y is the coordinates of a2.

If there is a waypoint at a1 and the next waypoint in the file is a2 you can also use.

Code: Select all

teleportToWP()
with no arguments to teleport to the next waypoint.

This is assuming the 2 points are close to each other and have a direct line of site.

Re: Tele script

Posted: Fri Apr 27, 2012 2:26 am
by mailstorm
im realy newbie at this :D

i was just look in to otehr scripts how it is look co i make somethink like this

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
<teleportToWP()>
(5329,2123,121)

<function teleport(dX,dZ,dY, absolute)>
(5501,2000,121)
<end>

Re: Tele script

Posted: Fri Apr 27, 2012 3:45 am
by rock5
If you want to teleport to those 2 places in the onload section of the waypoint it would look something like this.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
    teleport(5329,2123,121)
    teleport(5501,2000,121)
</onLoad>
</waypoints>
But of course it does nothing at those coordinates. When you start the file it teleports to the first point then the second then ends the script. Or maybe because there are no waypoints it will try to travel to 0,0. I'm not sure.

Re: Tele script

Posted: Fri Apr 27, 2012 4:31 am
by mailstorm
How big distance can be from 1st tp to second one i mean i dont want to get wrap
lets say im woring on this for SC
Here is safe place 8 I---Here is electric shock--I 8 and here is safety place

And i want to make just step ahed and dont get electrick shock

Re: Tele script

Posted: Fri Apr 27, 2012 4:50 am
by rock5
You can usually jump about 120 in 1 jump although the teleport userfunction is set to only allow 115 in one jump. Any further and it breaks it up into smaller jumps.

Re: Tele script

Posted: Fri Apr 27, 2012 6:55 am
by mailstorm
Rock it working but i have no idea how after that bot start my other script if i add
<end> at the end it wont start
is any command to pause script ?
or make it finish after this tp ?

Re: Tele script

Posted: Fri Apr 27, 2012 7:33 am
by rock5
Try

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
    teleport(5329,2123,121)
    teleport(5501,2000,121)
    loadPaths("otherscript")
</onLoad>
</waypoints>

Re: Tele script

Posted: Fri Apr 27, 2012 8:03 am
by mailstorm
Working Good Thank YOU 8-)

Re: Tele script

Posted: Tue May 08, 2012 7:40 am
by gloover
Hey rock,

I have a more complicated question: how can I realize the teleportation forward/backward using rbassist?

Teleporting to coordinates is easy, but to get it working forward may need another variable to know the current "looking direction" at the current position.

Is it possible?

thx in advance!

Re: Tele script

Posted: Tue May 08, 2012 8:19 am
by rock5
I'd say it's possible but too much work. You would have to use player.Direction and distance to calculate some coordinates. And if you want it to teleport when pressing the forward key then you would have to intercept the key presses. You wouldn't be able to use a mouse. A big problem would be you wouldn't know what Y value to use. If you use a value the same height as the player and you are facing a slope then it will try to teleport into the slope which will fail. I suspect even if there is just a bump in the ground in front of you it will fail to teleport past it because it can't teleport through the bump. In the end it wouldn't work very well.

Re: Tele script

Posted: Wed Oct 31, 2012 10:30 pm
by vo2male
Hi Rock! i'm sorry if i revived this old thread.. i wanted to learn on how to use this teleport function and make waypoints using teleport.. i already have the teleport userfunction and i have been using the cot_tele, and waypoints for the AT (million thanks to you ^_^)

I dont know if there is any thread here that teaches on how to use this function.

I want to use this on my waypoint for my dailies in rorazan..
heres the code:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">

   <!-- #  1 --><waypoint x="-21559" z="-22931" y="588">
   player:target_NPC("Diandon");  (<--- im using daily notes)
   yrest(1000);
   player:target_NPC("Diandon");
   yrest(1000);
   </waypoint>
   <!-- #  2 --><waypoint x="-21636" z="-22916" y="592">   </waypoint>
   <!-- #  3 --><waypoint x="-21742" z="-23032" y="588">
    queststate = getQuestStatus("Extinguish More Flames");
    while queststate == "incomplete" do
      yrest(1000);player:target_Object("Strange Flame Seedling");yrest(1000);
      queststate = getQuestStatus("Extinguish More Flames");
      end
             
end 
</waypoint>
is it possible to use teleport function on this?

Re: Tele script

Posted: Wed Oct 31, 2012 10:44 pm
by rock5
teleport is usually used for specific needs or just to go faster but usually in instances. It's not a good idea to teleport outside where others can see you. But if you still want to do it the easiest way is to use the 'teleportToWP()' function that teleports to the next waypoint. Just put it at the end of each waypoint.

Re: Tele script

Posted: Wed Oct 31, 2012 10:47 pm
by vo2male
actually i just wanted to test it.

how to incorporate this and where to put this

Code: Select all

'teleportToWP()

im sorry i was at work so i cannot test this right now.. i just want to get some idea.

Re: Tele script

Posted: Wed Oct 31, 2012 11:10 pm
by rock5
Just put it at the end of each waypoint where you want it to teleport to the next waypoint. So just before "</waypoint>". If the waypoint is too far it will teleport there in shorter hops. If you teleport too far too fast it will pull you back so for traveling, I don't think it would help much. teleport is mainly useful when you can teleport somewhere nearby, do something there that takes a bit of time like collecting something, then teleport to another nearby point and do something else, etc. That's why it's ideal for minigames.

If you just want to see it in action then start up the commandline waypoint file and enter teleport function directly. I suggest you use the 4th option to make it relative. Example, to add 10 to the Z axis use

Code: Select all

teleport(nil,10,nil,false)
You can use any combination of X, Z, Y values.

Re: Tele script

Posted: Wed Oct 31, 2012 11:15 pm
by vo2male
Thanks rock! i'll try this later as soon as i get home ^_^..

Re: Tele script

Posted: Thu Nov 01, 2012 12:02 pm
by vo2male
tested it and works fine.im just encountering some rubber band effects..

how about if i will teleport downward or underground?

Re: Tele script

Posted: Thu Nov 01, 2012 12:30 pm
by rock5
You normally can't teleport through things. You might even have problems if there is a hill between you and your teleport destinations as it will try to teleport through the hill. You will just have to experiment with what will work. You can try smaller steps and bigger pauses at each waypoint if you like. There are 2 functions for changing them.

Code: Select all

teleport_SetStepSize(val) -- Default is 115
teleport_SetStepPause(val) -- Default is 500ms

Re: Tele script

Posted: Thu Nov 01, 2012 12:46 pm
by vo2male
rock5 wrote:You normally can't teleport through things. You might even have problems if there is a hill between you and your teleport destinations as it will try to teleport through the hill. You will just have to experiment with what will work. You can try smaller steps and bigger pauses at each waypoint if you like. There are 2 functions for changing them.

Code: Select all

teleport_SetStepSize(val) -- Default is 115
teleport_SetStepPause(val) -- Default is 500ms
oh i thought its like AT... but is it possible? id like to give it a shot since there was no hill there..

and where do i put this

Code: Select all

teleport_SetStepSize(val) -- Default is 115
teleport_SetStepPause(val) -- Default is 500ms
after each

Code: Select all

teleportToWP()
?

Re: Tele script

Posted: Thu Nov 01, 2012 1:32 pm
by rock5
You could put them anywhere but once a setting gets changed it stays changed. So the most likely best place to put them is in the onload of the waypoint file where you intend to use the teleport related function.