PDA

View Full Version : Quest Globals NPCs and Other Zones


chrismed0
10-14-2012, 06:10 PM
Well I don't know how I did it but got off work this morning and played with the qglobals again and could for the life of me get it to work. but I left the server up and went to bed and 6 hours later got up had some coffee and logged on and sure enough it started working....????

I'm happy.

The set up:
Maybe this will help someone out.
I have a boat in OOT and a boat in freporte (I made new grids for each to get rid of the glitches)
When the boat in oot hits a waypoint, the boat in freporte spawns
I have another npc in freporte (Freeport Harbor Authority) that is on a timer of 2 sec that watches for the global that is set by the boat in oot when it hits it's waypoint.

This is the script for the boat in oot (now that it is working will tweak it a little):


# Waypoint global setting for OOT Sirensbane for freporte
sub EVENT_WAYPOINT_ARRIVE {

if($wp == 3) {

quest::setglobal("shipspawna", 1, 7, "F");
quest::say("I am here");
}
}

The quest::say was just for testing/debuging

This is the script for the "Freeport Harbor Authority":

#freporte global checker/timer for Sirensbane
sub EVENT_SPAWN {

quest::settimer("spawnship",2);
}

sub EVENT_TIMER {

if($timer == "spawnship") {
if(defined $qglobals{shipspawna} && $qglobals{shipspawna} == 1) {
quest::shout("it works");
quest::spawn(10183,30,0,-2213,-80,-67);
quest::delglobal("shipspawna");
}
}
}


Now a few notes. I am using the latest perl x32 and MqSQL 5.5
When, for what ever reason it wasn't working, I had read a few posts relating to some bugs with the delglobal and some other things. There was one where it said in order to reset the global or return it back to " 0 " you had to use this:

$myglobalname = undef;


That did not work LOL...
I had a continuos stream of boats once the global was set... was very funny

quest::delglobal("myglobalname")

This did work. The global gets set, the boat spawns and the global gets deleted. Watching the boats now to see if it repeats on each round.
OOOO... ok it just did. So it does work and looks like it works well.
Great way to set up NPC spawns triggered in another zone.

I still don't know why it wasn't working this morning but it did this after noon.
Oh and all the related zones I have made them static that way I just don't have boats appearing when the ships aren't in the right spots when people zone into the zone. Something to keep in mind if there is a timing thing involved like these boats.

I think now all I need to do is set up an invis NPC OR add a proximity to the boat at a location in freporte to allow people to be moved to OOT.

Have fun and I hope this helps someone now I finaly figured it out since there wasn't alot of detailed explinations or walk throughs. (don't get me wrong there was alot of information just not a lot of explinations in lamens terms for a noob like me to understand and I'm sure there are a lot of noobs out there that could use the little extra help :smile: )

If anyone needs any more details on this and the globals please post I will be more then happy to try to help now I understand it more.

chrismed0
10-15-2012, 12:57 PM
I have been tweaking a little and I changed up just a couple of things..
I have fully checked and tested and works well.

Code for the NPC I placed in Butcherblock:

sub EVENT_SPAWN {

quest::settimer("spawnship",4);
}

sub EVENT_TIMER {

if($timer == "spawnship") {
if(defined $qglobals{shipbutcher} && $qglobals{shipbutcher} == 1) {
quest::ze(0,"Butcherblock Harbor Authority says 'The Sirens Bane will be arriving shortly from it's voyage in the Ocean of Tears. All those wishing to board her should make their way to the docks now. The Sirens Bane will be departing for the Ocean of Tears and Antonica'");
quest::unique_spawn(68228,237,0,3495,-550,-9);
quest::delglobal("shipbutcher");
}
}
}


Code for the SirenBane ship in OOT:

sub EVENT_WAYPOINT_ARRIVE {

if($wp == 3) {

quest::setglobal("shipfreporte", 1, 7, "F");
quest::say("I am here");
}

if($wp == 10) {

quest::setglobal("shipbutcher", 1, 7, "F");
quest::say("I am here");
}
}


Couldn't find the ref for the colorID for the message but assumed it was prob "0". Also added couple sec to the timer. This gives the boat enough time to spawn and delete the global. It makes it better for 2 reasons:
1. The global will be long gone before it tries to check again so no problems with multi spawns or messages
2. I found the "unique_spawn" so don't have to worry about multi spawns anyway. Love it.. works great.

Only thing I have to do left is tweak my grids and adjust my waypoints and pauses.
to make the grid editing easy I'm using GeorgeS Emu Tools.
The tools say npc_loot_editor but discovered it has a few other tools in like a very nice grid editor.
just thought I would give an update

PS. forgive any gramatical or spelling errors. I'm in law enforcement field and work the grave yard shift so this time in the morning when get off work I have been up for at least 16+ hours =)

sorvani
10-15-2012, 09:35 PM
it works because you changed the global to be available in any zone. The 7 part was a 5 in your other thread. Read the documentation already. this is clearly spelled out.