EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Bug Reports (https://www.eqemulator.org/forums/forumdisplay.php?f=591)
-   -   Quest bug: no coordinates at spawn (https://www.eqemulator.org/forums/showthread.php?t=25109)

AndMetal 04-25-2008 07:44 PM

Quest bug: no coordinates at spawn
 
This was driving me absolutely crazy trying to figure out why it wouldn't work, especially when it would work fine from the regular command-line Perl parser:

Code:

my $Area8 = 0;

sub EVENT_SPAWN {
        $xs = $x;
        $ys = $y;
        $zs = $z;
        if (($x >= 65.9) && ($x <= 734.1) && ($y >= -1022.1) && ($y <= -321.9) && ($z >= 100) && ($z <= 190)) {
                $Area8 = 1;
        }
}

sub EVENT_DEATH {
        if ($Area8 == 1) {
                quest::say("I'm in Area8: $xs, $ys, $zs ... $x, $y, $z");
        } else {
                quest::say("I'm NOT in Area8: $xs, $ys, $zs ... $x, $y, $z");
        }
}

It would almost always say it's not in the area, and show no values for $xs, $ys, & $zs (the starting values), but it would show values for $x, $y, & $z, so I knew it wasn't an issue with the variables. However, if I change sub EVENT_SPAWN to sub EVENT_AGGRO, it works fine. It almost seems like the script is executing before it has values for the location, so they are defined as null values. I think another (cleaner) alternative would probably be to create a 1 second timer to get the location

I'm not sure if this is resource dependent or not, but I am running 2 3.2GHz processors w/ 4GB of RAM.


All times are GMT -4. The time now is 04:08 PM.

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