View Full Version : Waypoint Spawning
chrismed0
10-09-2012, 06:57 PM
I'm not sure exactly how to do this. I did some looking around and tried a few things but none so far seemed to work. Still trying to get the hang of writting these perl quests.
I am trying to get a NPC to spawn in another zone on a grid when an NPC in another zone hits a certain waypoint in another zone.
This is what I got so far from reading but not sure what the missing component is.
sub EVENT_WAYPOINT_ARRIVE {
if ($wp==32) {
(not sure what goes here, thought maybe quest::spawn() but doesn't work)
}
}
Thanks
~Edit~
Ok found a couple of posts. Looks like it has something to with globals but don't understand how globals work or how to set one up.
~Edit~
Just for additional information. Both zones are static. Both NPC are up and on on grids I completed. The one npc which is suppose to trigger the one is suppose to stay up and moves on a circular grid. The other one is not suppose to be up until it's triggered.
chrismed0
10-09-2012, 09:01 PM
Hmm,
I found information here:
http://www.eqemulator.org/forums/showthread.php?p=175707
here:
http://www.eqemulator.net/wiki/wikka.php?wakka=QuestTutorial
Here:
http://www.eqemulator.org/forums/showthread.php?t=28964
But it isn't enough. I have the information just not how to use it or set it up. There is a part where it says you have to define something in the database to allow it to use global. Not sure if you place the quest.pl in the folder of that zone or you have to place it someplace else. I have the pieces of the puzzle just not sure how they fit together.
If there is any way someone can post a walk through of how to set up or how a global works so that I may understand how to write one I would appriciaite it.
ChaosSlayerZ
10-09-2012, 10:16 PM
i don't exactly know how this suppose to work but put some simple quest::say inside of it and see if it triggers at all
sub EVENT_WAYPOINT_ARRIVE {
if ($wp==32) {
quest::say("BOO!");
quest::spawn2(npcID, 0, 0, someX, someY, someZ, 0);
}
}
P.S. missed the part about "the other zone" but see if the thing above works at all ;)
c0ncrete
10-09-2012, 10:17 PM
i don't think you can use a global in zone to directly spawn an npc in another. you'd have to have a script in the zone you want the npc to spawn in to check the value of the global being used. you could, for example, use a timer in the target zone's player.pl to periodically check for the value required to spawn the npc.
chrismed0
10-09-2012, 10:51 PM
Ok I found this stuff here. It is probably what I'm looking for.
quest::spawn_condition(zone_short, condition_id, value) - uses variables in the spawn_conditions∞ table for spawning, despawning chosen npc's in a given zone. See SampleQuests.
quest::get_spawn_condition(zone_short, condition_id) - Get the value of a spawn condition
quest::toggle_spawn_event(event_id,enable,reset_ba se) - Toggle a spawn event. See the SpawnConditions page for details on usage.
I see in the DB under spawn_conditions and each condition has:
"zone" "ID" "value" "onchange" "name"
I'm assuming from what I'm reading you can make a quest of an NPC check the value and if is "x" value then that is the condition to make NPC "A" spawn in say "freporte". I have a quest written for the npc in freporte that when it reaches ($wp eq 4) it quest::depop() and this works. (tested by repoping the zone and watched it's follow through, zone is static)
looks like the conditions are linked to the spawn2 table so fixing to take a look at it and see how it's set up.
If I can figure out how to write it it looks like all I have to do is do a:
"code for OOT NPC"
sub EVENT_WAYPOINT_ARRIVE {
if ($wp eq 35)
{
#what ever is suppose to be here to check and spawn the NPC in freporte then reset the condition value???
quest::spawn_condition(zone_short, condition_id, value)????
}
}
"code for freporte NPC"
sub EVENT_WAYPOINT_ARRIVE {
if ($wp eq 5)
{
#once spawned will continue on it's grid it's assigned to untill....
quest::depop();
#maybe change value of the spawn condition here?
}
}
I'm assuming that is sorta how it works. There are other things I will add to the scripts but they are alot easier then this part considering I'm trying to figure out how this works.
chrismed0
10-09-2012, 11:04 PM
Ok so looking at the spawn2 table.
I notice it has:
"id" "spawngroupID" "zone" "version" "x" "y" "z" "heading" "respawntime" "_condition" "_condition value" "enable"
~edit~
I had typed a theory about the spawn2 table, but got to thinking about it and it really didn't make sence. So, backon track here.
Ok I assume that with an npc entered into this table you can set some value for the condition.
Then enter a condition into the "spawn_conditions" table and if the values match then it causes the spawn of the NPC in the zone specified by the Spawn2.
You can use a quest to alter the values of the condition to match the spawn2 and make the npc spawn. Is this correct? and if it is.. now I just have to figure out how you would write it.
wolfwalkereci
10-10-2012, 04:59 PM
I'm not sure exactly how to do this. I did some looking around and tried a few things but none so far seemed to work. Still trying to get the hang of writting these perl quests.
I am trying to get a NPC to spawn in another zone on a grid when an NPC in another zone hits a certain waypoint in another zone.
This is what I got so far from reading but not sure what the missing component is.
sub EVENT_WAYPOINT_ARRIVE {
if ($wp==32) {
(not sure what goes here, thought maybe quest::spawn() but doesn't work)
}
}
Thanks
~Edit~
Ok found a couple of posts. Looks like it has something to with globals but don't understand how globals work or how to set one up.
~Edit~
Just for additional information. Both zones are static. Both NPC are up and on on grids I completed. The one npc which is suppose to trigger the one is suppose to stay up and moves on a circular grid. The other one is not suppose to be up until it's triggered.
Did you try using - sub EVENT_WAYPOINT_ARRIVE
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.