Reply
[Tutorial] Making Portals - The Real Way(LUA)  
Old 06-02-2008, 03:43 PM   #1
pawaox
 
pawaox's Avatar
 
Join Date: Mar 2008
Location: Up Above
Posts: 238
pawaox is an unknown quantity at this point
Introduction:
There is several ways to make portals. They are mostly all about editing an old Teleport to your gameobject. Then, when you press it, you get teleported. The only problem about that is, that since you editted an old spell, that name comes up while teleporting IE: Goldshire:
Another problem is, that you can run out of old teleports.

You can fix that !
All you gotta do, is to script your gameobjects, and it ain't really hard:

1. Open up your database(HeidiSQL, Navicat ect.)

2. Go to the Gameobject_Names and create an gameobject
EntryID: Any high number
Type: 22
DisplayID: 1327 is Summoning Portal, but you can use like everything else. It could be a skull, a tree or whatever you wish
Spell Focus: 0

O.k.
Now you got the gameobject fixed.

3.
Log into your private server, with a GM account
4. Write GPS. That information will be needed in the script.
You will need MapID, X-Coord, Y-Coord, Z-Coord.
(Xcoordinate is North[+] and South[-] -
Ycoordinate is East[>] and West[<] -
Z is Height)

Now The Scripting Part

5. Open up an empty Notepad.
6. Write this in:

Code:
function ScriptName(pUnit, Event, pMisc)
           pMisc:Teleport(MapID, X-Coord, Y-Coord, Z-Coord)
end
RegisterGameobjectEvent(GameObjectsENTRYID, 2, "ScriptName")
Breaken Into Parts:

Code:
function ScriptName(pUnit, Event, pMisc)
That is the name of the function. Ascent Console will identify this, and match it with an "Register". Make sure this Name is U-N-I-Q-U-E

Code:
pMisc:Teleport(MapID, X-Coord, Y-Coord, Z-Coord)
After your script has been recognized, This tells it what to do. In this case it tells to Teleport("pMisc:Teleport")
After that it needs to know where to teleport to, and that is the coordinates


Code:
end

Tells the script to end here(IE. no more commands. You could also make it cast a spell, but the end tells it not to do anything else )
Code:
RegisterGameObjectEvent(GameObjectsEntryID, 2, "ScriptName"(
Tells it to Register the script. In this case as a GameObject.

Code:
RegisterGameobjectEvent(GameObjectsEntryID, 2, "ScriptName")
GameObjectsEntryID is the EntryID you created the Gameobject with. This tells the script what GameObject should teleport u.

2. Means that it is on use(IE: Click)
It could also be 1, which means on spawn

ScriptName is the script name(That you wrote at start)



What the script could look like:

Code:
function CustomMallPortal(pUnit, Event, pMisc)
           pMisc:Teleport(530, 1000, 100, 200)
end
RegisterGameobjectEvent(881222, 2, "CustomMallPortal")

7. Reload Server(Ascent.exe or Ascent-World.exe)
8.Go into game and spawn your gameobject
9. Right click it. IF it ports you to your location, You're completed. Congratulations.

Solves to Some Problems:

Q: The portal didn't work? It just showed World of Recall()
A: You did something wrong in the script, or you didn't restart your server.
.Reload Gameobject_Names is NOT enough

Q: I can't click my Object?
A: You didn't give the Gameobject the right "type". Go to your Database, and fix the type to 22. Then write .Reload Gameobject_Names and relog. Try again.

Q: My Ascent.exe tells me, that the script got an error??
A: You have miss spelled something in the script. Remeber, LUA is case sensitive, and you must not forget the " and ( ).

Q: I Can't spawn the Object??
A: You gotta write .reload Gameobject_Names and try again. If doesn't work, make sure you saved the changed in database(Please don't ask how - It's too simple) If you have saved it, Try restart server. IF still doesn't work, Delete that object from database, and create a new OR just create a new

Q: I spawns the object, but it doesnt show up. I get the message with Gameobject(blabla) spawned
A: You must enter the right DisplayID.

Q: The portal didn't teleport me to where i wanted, but somewhere else ??
A: Make sure you wrote the coordinates right. The newest repack sometimes keeps showing you some old coordinates. Try write .GPS, walk 2 feet away and write .GPS again. If it writes same coordinates, you gotta relog. Try again

Q: When i get ported to location, i fall under ground?
A: This is due to your Z-Coordinate(Height) Being to low. Try highen it.
It could also be your 2 other coordinates, going into a hill/mountain ect. You get the point. Try write the exact coordinate, or put them alittle away from the hills. Usual Highening the Z-Coord works tho.


That's all for now folks.

Glad you read my guide and PLEASE leave feedback. Feel free to ask any questions here.
pawaox is offline   Reply With Quote
 
Old 06-02-2008, 04:49 PM   #2
Groger
 
Join Date: Jul 2007
Posts: 13
Groger is an unknown quantity at this point
Nice tutorial dude, but i am wandering can you make a Teleporter NPC? i really would like to make one or someone make one for me. that would be awesome.

thx Groger
Groger is offline   Reply With Quote
 
Old 06-03-2008, 12:17 PM   #3
Sikilde
 
Sikilde's Avatar
 
Join Date: May 2008
Location: Norway
Posts: 2,361
Sikilde is a splendid one to beholdSikilde is a splendid one to beholdSikilde is a splendid one to behold
where shall i save that notepad file? =P
Sikilde is offline   Reply With Quote
 
Old 06-05-2008, 11:24 PM   #4
clampy125
 
clampy125's Avatar
 
Join Date: Jun 2008
Posts: 12
clampy125 is an unknown quantity at this point
Yer I was wondering about where to save the notepad file? 'cos I cant find anywhere where it tells us where to save it.

Ah rite solved it...For thoser unsure what you do once youve written your code into your notepad is to copy it and past it as a query in you database, now mine still has a few errors but it understands what i'm trying to do so it must be right

Rite ok here comes the question. Ive got this as my script and it says ther omething wrong with it.

function alliancemallport (pUnit, Event, pMisc)
pMisc:Teleport(0,-4017.433105,-1412.105225,-156.300781)
end
RegisterGameobjectEvent(910001, 2, "alliancemallport")

it says theres something wrong with teh first line

Last edited by clampy125; 06-06-2008 at 12:30 AM. Reason: Automerged Doublepost
clampy125 is offline   Reply With Quote
 
Old 06-06-2008, 03:59 AM   #5
Wrathwar
 
Wrathwar's Avatar
 
Join Date: Sep 2007
Location: Oregon
Posts: 45
Wrathwar is an unknown quantity at this point
This is LUA script, it goes as a .lua file in the scripts folder in ur ascent folder. It is NOT a sql/query, so put it into lua and it will have no bugs. SQL uses its own language, not lua
Wrathwar is offline   Reply With Quote
 
Old 06-06-2008, 07:01 PM   #6
clampy125
 
clampy125's Avatar
 
Join Date: Jun 2008
Posts: 12
clampy125 is an unknown quantity at this point
Ok then, still I dropped that .lua file into the scrpits folder in the ascent folder and it still doesnt work, where is the problem in my code?
clampy125 is offline   Reply With Quote
 
Old 06-12-2008, 08:37 PM   #7
bananlolan99
 
bananlolan99's Avatar
 
Join Date: Jan 2008
Posts: 86
bananlolan99 is an unknown quantity at this point
Hmm... Okey... I made a script for a portal to my custom instance... Looks like this:

function Teleporting_onUse (pUnit, Event, pMisc)
pMisc:Teleport (530, -362, 3072, -15)
end
RegisterGameObjectEvent (998, 2, "CustomInstanceOne")


I cant use it. In the ascent-world window, it says:

Tried to call invalid LUA function 'CustomInstanceOne' from Ascent! (GO)

Please help me!
bananlolan99 is offline   Reply With Quote
 
Old 06-12-2008, 10:15 PM   #8
DudeLove
 
DudeLove's Avatar
 
Join Date: Jun 2008
Location: Germany
Posts: 7
DudeLove is an unknown quantity at this point
Quote:
Originally Posted by bananlolan99 View Post
Hmm... Okey... I made a script for a portal to my custom instance... Looks like this:

function Teleporting_onUse (pUnit, Event, pMisc)
pMisc:Teleport (530, -362, 3072, -15)
end
RegisterGameObjectEvent (998, 2, "CustomInstanceOne")


I cant use it. In the ascent-world window, it says:

Tried to call invalid LUA function 'CustomInstanceOne' from Ascent! (GO)

Please help me!

Hm lets see...

maybe this will work better:

function Teleporting_onUse (pUnit, Event, pMisc)
pMisc:Teleport (530, -362, 3072, -15)
end
RegisterGameObjectEvent (998, 2, "Teleporting_onUse")
DudeLove is offline   Reply With Quote
 
Old 06-12-2008, 10:24 PM   #9
druidx
 
Join Date: May 2008
Posts: 16
druidx is an unknown quantity at this point
function Quel'Danas(pUnit, Event, pMisc)
pMisc:Teleport(530, 12776.720703, -6701.632324, 1.277364)
end
RegisterGameobjectEvent(166000, 2, "Quel'Danas")

but i get portal and its starts to "teleport" but when its done it just wont get me anywhere, stuck the same place
druidx is offline   Reply With Quote
 
Old 07-01-2008, 03:42 AM   #10
purdy
 
Join Date: Jul 2008
Posts: 1
purdy is an unknown quantity at this point
There is a mistake in the original poster's script which makes it not work. It took me ages to figure out what was wrong. So, in future, it would be helpful to everyone if people posting tutorials refrained from posting "If there's a problem with the script it's you, not me" (I'm paraphrasing, but getting tired of seeing that repeatedly in the forums and then having tutorials not work). It is not helpful in the least, and when there is an error, the original poster never ends up correcting it.

Otherwise, this is an awesome script.

The script should read as follows:
=================================================
function ScriptName(pUnit, Event, pMisc)
pMisc:Teleport(MapID, X-Coord, Y-Coord, Z-Coord)
end
RegisterGameObjectEvent(GameObjectsENTRYID, 2, "ScriptName")
=================================================

Your error was in *not* capitalizing the 'O' in RegisterGameObjectEvent, which led to a Word of Recall() error. Please update. Thanks.

Last edited by purdy; 07-01-2008 at 03:56 AM.
purdy is offline   Reply With Quote
 
Old 07-01-2008, 04:40 AM   #11
aeirs07
 
aeirs07's Avatar
 
Join Date: May 2008
Location: Canada
Posts: 55
aeirs07 is an unknown quantity at this point
WORK!! Yes if you got any question just ask me!
aeirs07 is offline   Reply With Quote
 
Old 07-06-2008, 08:42 PM   #12
bananlolan99
 
bananlolan99's Avatar
 
Join Date: Jan 2008
Posts: 86
bananlolan99 is an unknown quantity at this point
Quote:
Originally Posted by DudeLove View Post
Hm lets see...

maybe this will work better:

function Teleporting_onUse (pUnit, Event, pMisc)
pMisc:Teleport (530, -362, 3072, -15)
end
RegisterGameObjectEvent (998, 2, "Teleporting_onUse")
Ye. LOL. Thanks. Now it's working
bananlolan99 is offline   Reply With Quote
 
Old 07-10-2008, 04:21 PM   #13
jdannels
 
Join Date: Jul 2008
Posts: 12
jdannels is an unknown quantity at this point
Thank you to Purdy for explaining the "O" error... THANK YOU SO MUCH!!!
jdannels is offline   Reply With Quote
 
Old 07-14-2008, 09:21 PM   #14
tathar26
 
Join Date: May 2008
Posts: 16
tathar26 is an unknown quantity at this point
but how can you set -40077.553467 in the lua file????
tathar26 is offline   Reply With Quote
 
Old 07-14-2008, 09:22 PM   #15
killer911pt
 
killer911pt's Avatar
 
Join Date: Feb 2008
Location: Web Design / Development Expert
Posts: 898
killer911pt is a jewel in the rough
this is shweet i added it to my list of tuts
killer911pt is offline   Reply With Quote
 
Old 07-14-2008, 10:04 PM   #16
realyo3
 
realyo3's Avatar
 
Join Date: Oct 2007
Posts: 694
realyo3 is an unknown quantity at this point
hey in my ascent-world i get this
Code:
22:01 N LuaEngine: easyeventcoarse.lua...
failed. (could not run)
        scripts\easyeventcoarse.lua:4: attempt to call global 'RegisterGameobjec
tEvent' (a nil value)
my script looks like this
Code:
function easyeventcoarse(pUnit, Event, pMisc)
           pMisc:Teleport(169, -1215.209961, -1837459961, 137.78700)
end
RegisterGameobjectEvent(3006, 2, "easyeventcoarse")

NOTE:
Quote:
Ok then, still I dropped that .lua file into the scrpits folder in the ascent folder and it still doesnt work, where is the problem in my code?
save it as .lua and put it in your scripts folder
f.e customportal.lua

Last edited by realyo3; 07-14-2008 at 10:06 PM.
realyo3 is offline   Reply With Quote
 
Old 07-27-2008, 03:34 AM   #17
Kiefer
 
Join Date: Jun 2008
Posts: 8
Kiefer is an unknown quantity at this point
When you're making the portal you can just make it's type 2, so when you click the portal you dont have that old recall thing!
Kiefer is offline   Reply With Quote
 
Old 07-27-2008, 05:35 AM   #18
colbyfarley
 
colbyfarley's Avatar
 
Join Date: Mar 2008
Location: Under Some Freeway
Posts: 347
colbyfarley will become famous soon enough
cool thanks
colbyfarley is offline   Reply With Quote
 
Old 07-27-2008, 10:35 AM   #19
Savion
 
Join Date: Nov 2007
Posts: 6
Savion is an unknown quantity at this point
so how do you save the txt file as .lua?
Savion is offline   Reply With Quote
 
Old 07-27-2008, 10:37 AM   #20
Syrup
Curiosity...
 
Syrup's Avatar
 
Join Date: Jul 2008
Posts: 1,603
Syrup is a splendid one to beholdSyrup is a splendid one to beholdSyrup is a splendid one to behold
Quote:
Originally Posted by Savion View Post
so how do you save the txt file as .lua?
It's pretty much all .lua.
Syrup is offline   Reply With Quote
 
Old 07-27-2008, 07:44 PM   #21
Savion
 
Join Date: Nov 2007
Posts: 6
Savion is an unknown quantity at this point
So are you saying just save txt file in your script folder? because i cant save my txt file as .lua ...
Savion is offline   Reply With Quote
 
Old 07-27-2008, 08:44 PM   #22
Robertoell
 
Join Date: Jul 2008
Posts: 8
Robertoell is an unknown quantity at this point
KODOS~!!!!! + rep bud! IT worked i Think cause... server when i restarted didn't say nothing but.. how do i call it in game? hehe XD still an admin noob
Robertoell is offline   Reply With Quote
 
Old 08-25-2008, 09:50 PM   #23
juswill3
 
juswill3's Avatar
 
Join Date: May 2008
Location: Inside your hardrive stealing your RAM
Posts: 325
juswill3 is on a distinguished road
OMG noobs, when you save it. Type the file name .lua.

Example: Portal.lua

then move it in the folder

YAY IT WORKED!!

But after you teleport is it supost to say Word Of Recal (OLD) still?

Last edited by juswill3; 08-25-2008 at 09:54 PM. Reason: Automerged Doublepost
juswill3 is offline   Reply With Quote
 
Old 08-29-2008, 03:00 AM   #24
nerk
 
nerk's Avatar
 
Join Date: Jun 2008
Posts: 32
nerk is an unknown quantity at this point
Can u tell me what i did wong plz? =-3 Quick check it

function obcourse(pUnit, Event, pMisc)
pMisc:Teleport(1, -8925, 1550, 22.3)
end
RegisterGameobjectEvent(53100, 2, "obcourse")

It say something with RegisterGameobjectEvent in my arcemu console

Yes, the Go entry is 53100 , and the type is 22

---------------------------------------------
I +rep helparz ^^
nerk is offline   Reply With Quote
 
Old 09-01-2008, 10:26 AM   #25
rjvznl2
 
rjvznl2's Avatar
 
Join Date: Aug 2008
Posts: 9
rjvznl2 is an unknown quantity at this point
hi it work in the console but not in game i cant spawn it in game i have added in the databse gameobject_names but it dont work its says in game gameobjectinfo not found
rjvznl2 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:23 AM.

All times are GMT. The time now is 06:23 AM. Contact Us - AC Web - Archive - Privacy Statement - Top