EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Waypoints are hit and miss (https://www.eqemulator.org/forums/showthread.php?t=31088)

mixxit 04-18-2010 09:41 PM

Waypoints are hit and miss
 
I don't understand why this is happening but things I need to rely on are just not happening all the time and it screws up a system of events that rely on a waypoint being triggered.

I echo'd the npc's waypoints to see what was going on and most of the time it's fine but occasionally it will echo a set of waypoints like 1 2 4 completely ignoring point 3!

Now when I need to depop on point 3 this can become a disaster!

Why is this happening?

joligario 04-19-2010 07:16 AM

Check your grid pause time. Might be possible your timing is off. To test waypoints out, in your NPC's script file try this:

Code:

sub EVENT_WAYPOINT_ARRIVE {
  quest::shout("I have arrived at Waypoint $wp.");
}

sub EVENT_WAYPOINT_DEPART {
  quest::shot("I am departing Waypoint $wp.");
}

Also, check that your grid numbers are sequential. It is possible that the entries are not in order.

mixxit 04-19-2010 07:49 AM

That's what I mean when echo'ing - it's saying i've reached 1, 2 then 4!

The pause is set to a variety of values from 0 to 200. 0 is ok isn't it?

joligario 04-19-2010 09:14 AM

Did you check the grid numbers in the database to ensure there is a 3 on that grid? Is the wander type set to patrol? 0 is fine for the timer, was just saying to check just in case you were trying to stop on a waypoint that was set to 0 or something similar.

mixxit 04-19-2010 09:31 AM

I've set them all to 1 but i'm still having the same issue! Yep i'm using patrol with full waits and am on the latest build of eqemu with perl 5.10.

Must.. fix...this!

mixxit 04-19-2010 09:36 AM

Here's one of the bug ones

Gets to wp 3 fine (which is wp4 i believe in the grid but starts at 0 in perl)

Code:

sub EVENT_WAYPOINT_ARRIVE
{
        quest::say("I have reached waypoint $wp");
        # keep moving till i reach the last waypoint
        if($wp eq 4)
        {
                # Set a qglobal to inform the boat in BB to pop
                quest::say("Setting status 2 as we are at waypoint $wp");
                quest::setglobal("ootboatstatus",2,7,F);
        }
       
        if($wp eq 5)
        {
                # Boat in BB should now be popped, depop me
                quest::say("Depopping as we are at waypoint $wp");
                quest::depop();
        }
}


joligario 04-19-2010 10:07 AM

Wait, I'm confused then. Since the $wp starts at 0, and you are looking for 3rd waypoint, then you should be checking if == 2. Maybe show your grids and explain which waypoint you are interested in and I can help better.

EDIT: You should also use == instead of eq. I think I see what you are saying with 3/4. I just compiled 1395 and it doesn't skip any waypoints...

mixxit 04-19-2010 11:08 AM

Ok i swapped to == and it doesn't make a difference. I expect on this script when the spawn reaches waypoint 5 ($wp == 4) it will record the quest global. then when it reaches waypoint 6 ($wp == 5) it will depop.

At the moment I have that zone as static, i'm in another and I am looking at the quest global table and it has never changed from ootboatstatus '1' to '2' like it should when it his waypoint 5 ($wp == 4).

What's happening!!

mixxit 04-19-2010 11:11 AM

Code:

"gridid","zoneid","number","x","y","z","heading","pause"
62,69,1,11124.2,446.575,-43,0,300
62,69,2,7583.69,-1344.21,-43,0,1
62,69,3,7445.1,-2111.7,-43,0,100
62,69,4,6250.45,-4585.98,-43,0,1
62,69,5,-9858.39,-4646.89,-43,0,300 - Should set QuestGlobal to 2 here
62,69,6,-10981.2,-4932.77,-20.0084,0,1 - Should depop here


joligario 04-19-2010 11:19 AM

Couple of last few questions. Is number 1 on your grid list at (or very near) the spawnpoint? Does the boat have qglobals enabled? Try using "F" instead of F? BTW, I wasn't saying that == would fix it, I was just saying that when using that type of condition check, it should be == instead of the string eq.

mixxit 04-19-2010 11:24 AM

Yeah the spawn has qglobals enabled. It's definitely translating the F across because a previous script uses it and I can see it in the table. Number 1 is exactly where the spawn is when it pops.

joligario 04-19-2010 11:39 AM

Does the boat say "setting status 2..." and/or "Depopping..."? Want to post your most up-to-date code you are using?

mixxit 04-19-2010 11:43 AM

It's almost like if I'm not in the static zone with the boat it will not set the qglobal and depop.

Whenever I sit on the 4 hour journey with it across OOT it will happily depop and set the qglobal to 2.

Messed up!

mixxit 04-19-2010 11:48 AM

Eugh!

Quote:

Originally Posted by Angelox (Post 155481)
Keep this in mind: Perl will not activate in any given zone if there are not any PC's there.
I probably started the 'Global Watchers' thing. The best method to have a watcher is via 2 point grid on an NPC (grids need a 3-5 second delay on each), another words, you make an NPC, give him to grid points all on the same spawnpoint (preferably invisible). Now, when you enter the zone, the script will activate and continue executing any changes it spots, with each grid movement (EVENT_WAYPONT).
EVENT_SPAWN works if the zone is not static, and only once , Proximity is nice (EVENT_ENTER), but you have to plant 'watchers' all over the zone ( my old method).
EVENT_WAYPOINT is the way to go. if there's no player in the zone, the scripts need not be active anyway.
I've never tried EVENT_ENTERZONE , but I can tell you without even trying it; EVENT_WAYPOINT is better because the script is checked with each grid movement, so long as there is a player in the zone.
I haven't seen any lag problems with this either.

No wonder it's not working - this is a big problem for me as the boat will never make be able to cycle through butcher or freeport with a player being in all 3 zones.

mixxit 04-19-2010 12:00 PM

Wait a minute.. that can't be right at all because when i'm in OOT and set the qglobal 2 to the boat will spawn fine at the other side. So perl is running in the static zones.

I also can confirm that the static zones can update Qglobals because when OOT first boots up an invisible NPC sets a qglobal to 0 which resets the whole process.

I am seeing qglobal == 1 when i check the table so I know that the loop in OOT is seeing qglobal being 0, spawning the boat which itself sets the qglobal to 1 (i'm on my way to freeport).

What the hell is wrong?!

joligario 04-19-2010 12:12 PM

Are you reusing the same boat NPC? There is an issue about scripts across zones if you are using the same NPC. Only thing I could think of after that is code logic.

mixxit 04-19-2010 12:52 PM

I am yeah

I have two boats in OOT - 999184 that goes in one direction and 999185 that goes the other

999185 is also used in butcher and freeport

joligario 04-19-2010 02:00 PM

The scripts may be running into each other. You should have 1 ID number for each boat. So you should have 4 id numbers.

mixxit 04-19-2010 02:04 PM

Ok I am pretty sure that the issue is that NPCs do not path in static zones if there are no players in it. I am not 100% certain but I would guess this is the case. Scripts still seem to run though as qglobals get set and what not.

mixxit 04-19-2010 02:32 PM

Here's the current version that occurs when the boat spawns (which it is doing and is setting the global to val: 1)

Code:

#OOT - Boat from BB to FP
sub EVENT_SPAWN
{
        # I have spawned, inform the BoatSystem that I am moving towards freeport by setting the quest global
        quest::gmsay("BBFP Setting status 1");
        quest::setglobal("ootboatstatus",1,7,"F");
}
sub EVENT_WAYPOINT_ARRIVE
{
        # keep moving till i reach the last waypoint
        if($wp == 4)
        {
                quest::gmsay("BBFP Setting status 2");
                quest::setglobal("ootboatstatus",2,7,"F");
        }
       
        if($wp == 5)
        {
                quest::gmsay("BBFP Depopping");

                quest::depop();
        }
}


mixxit 04-19-2010 02:43 PM

here's the script that spawns the boat when the zone boots up for the first time.

Code:

sub EVENT_SPAWN {

  quest::shout("Boat system spawned and activated");
  quest::settimer("ootcheckboats",1);
  quest::gmsay("BS Setting status 0");
  quest::setglobal("ootboatstatus",0,7,"F");
 
 
}

sub EVENT_TIMER
{
  if($timer eq "ootcheckboats")
  {
      if(defined $qglobals{ootboatstatus})
      {
        if ($qglobals{ootboatstatus} == 0)
        {
            quest::spawn(999185,62,0,11124.2,446.575,-43);
        }
       
        # The boat has arrived at OOT from Freeport       
        if ($qglobals{ootboatstatus} == 5)
        {
            quest::spawn(999184,64,0,-10957.6,556.9,-43);
        }
       
      } else {
        quest::shout("DEBUG: Error, could not locate QGlobal");       
      }
  }

}


mixxit 04-20-2010 07:25 AM

I have implemented a unique ID for every spawn involved now with qglobals enabled on each

The situation is still the same. The NPC does not trigger an event when it reaches a waypoint (if it does) when nobody is in the zone.

Gaah! :-)

mixxit 04-20-2010 10:05 AM

Quote:

14:44 Mixxit • i have an npc that is doing a world emote but he never reaches his waypoint unless i go into the static zone
14:56 &Rogean • correct, the zone goes into a low resource state
14:57 Mixxit • bah but i need my boat to move!
14:57 Mixxit • is this just one line i could disable?
14:57 Mixxit • (please say yes)
15:01 &Rogean • void EntityList::MobProcess() {
15:01 &Rogean • #ifdef IDLE_WHEN_EMPTY
15:01 &Rogean • if(numclients < 1)
15:01 &Rogean • return;
15:01 &Rogean • #endif
15:02 Mixxit • fantastic!
15:02 &Rogean • features.h, uncomment that define
Now to test!

mixxit 04-20-2010 06:06 PM

Issue Resolved!


All times are GMT -4. The time now is 01:20 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.