Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-31-2014, 12:26 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default Question about npc pl files and NPC movement.

Ok, I'm basically rewriting this question.. Ignore the previous version if you read it.

I have the following pl file.

The intent of personalpause for each instance of this mob (there are 6) to spawn and pick one of the points on his grid waypoints (0-42) as his "hangout"

The intent of delay is so each instance starts the grid at a different time after he spawns.

I added the write() stuff, as it seemed to do what I expected while I was in the zone to observe, but when I left and came back a day later, the NPCs are all bundled up.

What i noticed from my write() calls, is that the event spawn stuff spits out as soon as I boot the zone, but I don't see any WP arrivals until I zone in. Then they start coming out.

So my question: Is no npc movement happening while no one is in the zone?

Code:
my  $personalpause=0;

sub EVENT_SPAWN
    {
    $personalpause=plugin::RandomRange(0,42);
    $delay=plugin::RandomRange(0,300);
    quest::write("/tmp/madmen", "spawned pause($personalpause) delay($delay)");
    quest::settimer("movetimer",$delay);
    }

sub EVENT_WAYPOINT_ARRIVE
    {
    quest::write("/tmp/madmen", "arrived pause($personalpause) delay($delay)");
    if ($wp == $personalpause)
        {
        $pauselen=plugin::RandomRange(60,150);
        quest::pause($pauselen);
        }
    }

sub EVENT_TIMER
    {
    if ($timer eq "movetimer")
        {
        quest::stoptimer("movetimer");
        quest::start(62);
        }
    }
Reply With Quote
  #2  
Old 07-31-2014, 02:16 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Added $mobid to the output...

Now it seems obvious that variables are crossing instances. mob 126 is using mob 128's random values...

id(125) spawned pause(3) delay(119)
id(126) spawned pause(3 delay(4)
id(127) spawned pause(15) delay(67)
id(12 spawned pause(17) delay(217)
id(129) spawned pause(35) delay(174)
id(130) spawned pause(33) delay(125)



id(126) arrived pause(17) delay(217)
id(126) arrived pause(17) delay(217)
id(126) arrived pause(17) delay(217)
id(126) arrived pause(17) delay(217)
Reply With Quote
  #3  
Old 07-31-2014, 02:36 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

So it looks like the variables are scoped to the npc_types id. I have 6 instances of mobname in the zone, using a spawngroup that chooses from a group of 4 various level versions. So, we end up with at least 2 identical npc_types spawning at diff spots. These duplicates share variables,

I can and have fixed it using variable arrays with $mobid as the index in the .pl file.

My questions that remain:

- I still see no wp arrivals until I zone in. Is that normal? They ARE NOT moving?

- It seems to me that the variables in a quest should scope to $mobid. It is illegal to have multiple instances of the same npc_type? I sure didnt think so.

- Can someone point me at the code that scopes these variables? I haven't been able tp parse through how that all happens yet. Maybe I can find a change so each instance of an NPC has its own variables.
Reply With Quote
  #4  
Old 08-01-2014, 06:50 AM
vsab's Avatar
vsab
Discordant
 
Join Date: Apr 2014
Location: United Kingdom
Posts: 276
Default

IIRC the zone will "sleep" if there is no one in there, to conserve server resources.

Anyhoo, this may help explain the shared variable issue you had:-

http://wiki.eqemulator.org/p?The_Pow...Perl_Reference
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 On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:10 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3