Now, lets make a new Lua script. Since we're making a portal to Gurubashi Arena, lets call it "arenaportal.lua". The name doesn't realy matter, just as long it's a .lua file.
Copy and paste the folowing piece of Lua code in the file. You might want to adjust the information to correspond to your Gameobject, and ofcourse your location (type .gps ingame for the coordinates).
If you're taking the coordinates from the recall table in your Ascent world database be SURE to replace their commas by dots. If not, this'll cause function overflow.
Code:
function gurubashiarena(pGameObject, event, pMisc)
pMisc:Teleport(0, -13228.470703, 227.919037, 32.869213)
end
RegisterUnitEvent(2, 2, "gurubashiarena")
Code Breakdown time!
RegisterUnitEvent(2, 2, "gurubashiarena") :: This is the "Reigsterevent". Replace the FIRST '2' by your Gameobject Id.
function gurubashiarena(pGameObject, event, pMisc) :: This defines the function. It's the header that tells Ascent the function named "gurubashiarena" starts here.
pMisc:Teleport(0, -13228.470703, 227.919037, 32.869213) :: Teleports in this order: mapid, x, y, z, orientation.
end :: Tells Ascent the function "gurubashiarena" stops here.
Thats all! I hope you've enjoyed my tutorial. And learned something with it. If you have any questions or problems, feel free to ask!
Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep)
Rep Power: 2
Reputation: 1
Posts: 6
Join Date: Jun 2007
Location: Holland
03-27-2008
Ok it did't work for me, when I click the portal nothing happens...These are my files
LUA script(in ascent/scripts folder):
Code:
function Teleport to Svenolio City(pGO, Event, pUnit)
pUnit:Teleport(1, 4393.419434 , -2521.211670, 1122.614136)
end
RegisterGameObjectEvent(200000, 2, "Teleport to Svenolio City")
Gamobject_names(I used backup so that's why it shows insert into thing)
hope you find out what prob is (I didn't use your BASE cause it inserts it in to a COPY of gamobject_names, also dunno if it matters but when ascent world runs and when you look at if all DLL's are loaded it says "LUAScripting.dll delayed load", but when u scroll down it does say it loaded al scripts so???)
Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep)
Rep Power: 2
Reputation: 1
Posts: 12
Join Date: Nov 2007
Location: Pyramid
03-29-2008
Quote:
Originally Posted by TheBetrayer
You know, your forgetting to add the info to teleport_coords table
I dont know if that was to LordDarkling program or Kirth guide, but to use the teleport_coords table for portals is just unnessesary.
Its better to just make a game object and a lua (just copy and changes the cords and names) then screw around in a table =) Just my minds.
The guide works perfect
The program works kinda perfect