EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   plugin::RandomRoam (https://www.eqemulator.org/forums/showthread.php?t=40781)

blackdragonsdg 07-19-2016 11:06 PM

plugin::RandomRoam
 
Been trying to use the plugin::RandomRoam but it will not work no matter how I try to use it. I go in Crescent Reach and watch a_grove_snake and a_grove_hare wandering around randomly so I copy one of those lua scrpts to another zone then rename it according to the npc I want it to work on and still nothing. I have los in the zone. What is the catch with this plugin?

ghanja 07-19-2016 11:16 PM

Quote:

Originally Posted by blackdragonsdg (Post 250131)
Been trying to use the plugin::RandomRoam but it will not work no matter how I try to use it. I go in Crescent Reach and watch a_grove_snake and a_grove_hare wandering around randomly so I copy one of those lua scrpts to another zone then rename it according to the npc I want it to work on and still nothing. I have los in the zone. What is the catch with this plugin?

Give an example of your code using the subroutine. Are the X, Y and Z valid for the NPC? You mention you just copied an existing script to another zone/npc, which is why I ask.

Akkadius 07-19-2016 11:20 PM

Quote:

Originally Posted by blackdragonsdg (Post 250131)
Been trying to use the plugin::RandomRoam but it will not work no matter how I try to use it. I go in Crescent Reach and watch a_grove_snake and a_grove_hare wandering around randomly so I copy one of those lua scrpts to another zone then rename it according to the npc I want it to work on and still nothing. I have los in the zone. What is the catch with this plugin?

You need to make sure that you have map files for the zone otherwise it simply won't work.

What version of the plugin are you using too? Are you using the updated plugins from the eqemu_update.pl script?

blackdragonsdg 07-19-2016 11:54 PM

Quote:

Originally Posted by ghanja (Post 250132)
Give an example of your code using the subroutine. Are the X, Y and Z valid for the NPC? You mention you just copied an existing script to another zone/npc, which is why I ask.

At the time I created the npc's for this zone I literally took a character and stood on a spot then used #loc to get the correct coordinates for the spawn.
This is an example of that last script I tried in perl. I have tried the plugin with varying z and los values as well as letting it use default values like this plugin::RandomRoam(500, 500);

Code:

my $random=int(rand(100)+1);

sub EVENT_SPAWN {
        quest::settimer("roam", $random);
}

sub EVENT_TIMER {
        if($timer eq "roam") {
        plugin::RandomRoam(500, 500, 100, 25);
        }
}

sub EVENT_DEATH {
    quest::stoptimer("roam");
}


Quote:

You need to make sure that you have map files for the zone otherwise it simply won't work.

What version of the plugin are you using too? Are you using the updated plugins from the eqemu_update.pl script?
I am using the updated plugins from the eqmu_update.pl script. I have valid map files as far as I know. I can combat in the zone and have los to many of the npc's in the zone.

Akkadius 07-20-2016 01:06 AM

Quote:

Originally Posted by blackdragonsdg (Post 250135)
At the time I created the npc's for this zone I literally took a character and stood on a spot then used #loc to get the correct coordinates for the spawn.
This is an example of that last script I tried in perl. I have tried the plugin with varying z and los values as well as letting it use default values like this plugin::RandomRoam(500, 500);

Code:

my $random=int(rand(100)+1);

sub EVENT_SPAWN {
        quest::settimer("roam", $random);
}

sub EVENT_TIMER {
        if($timer eq "roam") {
        plugin::RandomRoam(500, 500, 100, 25);
        }
}

sub EVENT_DEATH {
    quest::stoptimer("roam");
}




I am using the updated plugins from the eqmu_update.pl script. I have valid map files as far as I know. I can combat in the zone and have los to many of the npc's in the zone.

Try using a smaller roambox, like 50, 50 (plugin::RandomRoam(50, 50))

blackdragonsdg 07-20-2016 08:05 PM

So after some more testing I replaced my map files with the ones from the eqmu_update.pl script and it partially fixed the pathing problem. Some of the npc's do path when using plugin::RandomRoam but others do not. The problem seems to vary according to the terrain. Npc's on hillsides are the ones that will not path correctly. So the z axis of the spawn is likely the culprit. Any other suggestions or idea?

DanCanDo 07-20-2016 09:02 PM

Just curious, do the .path files factor in to this in any way ?
I know I have an extra 14 .path files in my map folder that
don't come with the update script download. These are ones
I have scrounged from around the internet, etc.

blackdragonsdg 07-20-2016 10:21 PM

After a lot of trial and error I finally got a lot of the npc's in my zone to move. For some reason the perl script I was using was not working reliably no matter how I changed it and I do not understand why. I ended up using the lua scripting from crescent reach to make my npc's wander around randomly. I would love to know what was wrong with the perl script but as long as the npc's move around it is all good.

Thanks for the help guys.

Akkadius 07-20-2016 11:18 PM

Post your script

blackdragonsdg 07-21-2016 09:30 AM

I was using the script I posted above. I tried it with different roam box sizes, different timer values and still nothing. I even tried adjusting the x, y and z values on the npc spawn data and still it only partially functioned. There are some weird redefines going on in the log files which I will post when I get home later today. This weekend I will have more time to tinker with this so I am going to compile my own binaries with more logging enabled instead of using the downloaded binaries from the update script.

Akkadius 07-21-2016 10:50 AM

Once again only use two parameters and you should be fine

blackdragonsdg 07-21-2016 08:25 PM

I have tried plugin::RandomRoam with only two parameters so many times it is starting to approach the definition of insanity. It is simply not working correctly and I know the problem is on my end.

I am starting to think that this problem is not so much something I am actively doing or not doing but something in my server configuration that is not what the plugin is expecting. Using the map file as an example, the one I was initially using was one I created back in 2009 with azone. It worked fine for combat and quest related things that I was using up until I tried plugin::RandomRoam. Then with the new map the lua script worked but not the perl script.

Could this possibly be something along the lines of my perl version is different than the one that was used when the binaries were compiled? I am using ActivePerl-5.12.4.1205-MSWin32-x86-294981 before anyone asks.

The following is the log file I mentioned above with the weird redefines.
Code:

[07-21-2016 :: 18:27:29] [Zone Server] Time Broadcast Packet: EQTime [12:43 am]
[07-21-2016 :: 18:28:50] [Quests] Destroying EQEmuIO=HASH(0x2eebe74)
[07-21-2016 :: 18:28:50] [Quests] Destroying EQEmuIO=HASH(0x2ef7e84)
[07-21-2016 :: 18:28:50] [Quests] Tying perl output to eqemu logs
[07-21-2016 :: 18:28:50] [Quests] Creating EQEmuIO=HASH(0xd58bf84)
[07-21-2016 :: 18:28:50] [Quests] Creating EQEmuIO=HASH(0xd58c46c)
[07-21-2016 :: 18:28:50] [Quests] Loading perlemb plugins.
[07-21-2016 :: 18:28:50] [Quests] Unquoted string "false" may clash with future reserved word at plugins//Expeditions.pl line 375.
[07-21-2016 :: 18:28:50] [Quests] Subroutine Cwd::fastcwd redefined at C:/Perl/lib/Cwd.pm line 812.
[07-21-2016 :: 18:28:50] [Quests] Subroutine Cwd::getcwd redefined at C:/Perl/lib/Cwd.pm line 812.
[07-21-2016 :: 18:28:50] [Quests] Subroutine Cwd::abs_path redefined at C:/Perl/lib/Cwd.pm line 812.
[07-21-2016 :: 18:28:50] [Quests] Subroutine CalcDestFromHeading redefined at plugins//path_tools.pl line 221.
[07-21-2016 :: 18:28:50] [Quests] "my" variable $Item1 masks earlier declaration in same scope at plugins//quest_handin.pl line 19.
[07-21-2016 :: 18:28:50] [Quests] "my" variable $Item2 masks earlier declaration in same scope at plugins//quest_handin.pl line 21.
[07-21-2016 :: 18:28:50] [Quests] "my" variable $Item3 masks earlier declaration in same scope at plugins//quest_handin.pl line 23.
[07-21-2016 :: 18:28:50] [Quests] "my" variable $Item4 masks earlier declaration in same scope at plugins//quest_handin.pl line 25.
[07-21-2016 :: 18:28:50] [Quests] Subroutine RandomRange redefined at plugins//random_utils.pl line 3.
[07-21-2016 :: 18:28:50] [Quests] Subroutine moelib_spawn_block redefined at plugins//spawn_utils.pl line 2.
[07-21-2016 :: 18:28:50] [Quests] Subroutine moelib_spawn_block_center redefined at plugins//spawn_utils.pl line 23.
[07-21-2016 :: 18:28:50] [Quests] Subroutine moelib_spawn_circle redefined at plugins//spawn_utils.pl line 45.
[07-21-2016 :: 18:28:50] [Quests] Subroutine GetMaxLoSDistFromHeading redefined at plugins//spawn_utils.pl line 71.
[07-21-2016 :: 18:28:50] [Quests] Subroutine FaceBestHeading redefined at plugins//spawn_utils.pl line 134.
[07-21-2016 :: 18:28:50] [Quests] Subroutine HeadingToShortestLoS redefined at plugins//spawn_utils.pl line 204.
[07-21-2016 :: 18:28:50] [Quests] Subroutine MoveAwayFromWall redefined at plugins//spawn_utils.pl line 268.
[07-21-2016 :: 18:28:50] [Quests] Subroutine MoveToFirstBestZ redefined at plugins//spawn_utils.pl line 340.
[07-21-2016 :: 18:28:50] [Quests] Subroutine SpawnZone redefined at plugins//spawn_utils.pl line 373.
[07-21-2016 :: 18:28:50] [Quests] Subroutine GetReverseHeading redefined at plugins//spawn_utils.pl line 456.
[07-21-2016 :: 18:28:50] [Quests] Subroutine ConvertHeadingToDegrees redefined at plugins//spawn_utils.pl line 477.
[07-21-2016 :: 18:28:50] [Quests] Subroutine vtell redefined at plugins//voicetell.pl line 6.
[07-21-2016 :: 18:28:50] [Quests] Subroutine Autovtell redefined at plugins//voicetell.pl line 56.
[07-21-2016 :: 18:32:16] [Quests] Destroying EQEmuIO=HASH(0xd58c46c)
[07-21-2016 :: 18:32:16] [Quests] Destroying EQEmuIO=HASH(0xd58bf84)
[07-21-2016 :: 18:32:16] [Quests] Tying perl output to eqemu logs
[07-21-2016 :: 18:32:16] [Quests] Creating EQEmuIO=HASH(0xdb7dfac)
[07-21-2016 :: 18:32:16] [Quests] Creating EQEmuIO=HASH(0xdb5f39c)
[07-21-2016 :: 18:32:16] [Quests] Loading perlemb plugins.
[07-21-2016 :: 18:32:16] [Quests] Unquoted string "false" may clash with future reserved word at plugins//Expeditions.pl line 375.
[07-21-2016 :: 18:32:16] [Quests] Subroutine Cwd::fastcwd redefined at C:/Perl/lib/Cwd.pm line 812.
[07-21-2016 :: 18:32:16] [Quests] Subroutine Cwd::getcwd redefined at C:/Perl/lib/Cwd.pm line 812.
[07-21-2016 :: 18:32:16] [Quests] Subroutine Cwd::abs_path redefined at C:/Perl/lib/Cwd.pm line 812.
[07-21-2016 :: 18:32:17] [Quests] Subroutine CalcDestFromHeading redefined at plugins//path_tools.pl line 221.
[07-21-2016 :: 18:32:17] [Quests] "my" variable $Item1 masks earlier declaration in same scope at plugins//quest_handin.pl line 19.
[07-21-2016 :: 18:32:17] [Quests] "my" variable $Item2 masks earlier declaration in same scope at plugins//quest_handin.pl line 21.
[07-21-2016 :: 18:32:17] [Quests] "my" variable $Item3 masks earlier declaration in same scope at plugins//quest_handin.pl line 23.
[07-21-2016 :: 18:32:17] [Quests] "my" variable $Item4 masks earlier declaration in same scope at plugins//quest_handin.pl line 25.
[07-21-2016 :: 18:32:17] [Quests] Subroutine RandomRange redefined at plugins//random_utils.pl line 3.
[07-21-2016 :: 18:32:17] [Quests] Subroutine moelib_spawn_block redefined at plugins//spawn_utils.pl line 2.
[07-21-2016 :: 18:32:17] [Quests] Subroutine moelib_spawn_block_center redefined at plugins//spawn_utils.pl line 23.
[07-21-2016 :: 18:32:17] [Quests] Subroutine moelib_spawn_circle redefined at plugins//spawn_utils.pl line 45.
[07-21-2016 :: 18:32:17] [Quests] Subroutine GetMaxLoSDistFromHeading redefined at plugins//spawn_utils.pl line 71.
[07-21-2016 :: 18:32:17] [Quests] Subroutine FaceBestHeading redefined at plugins//spawn_utils.pl line 134.
[07-21-2016 :: 18:32:17] [Quests] Subroutine HeadingToShortestLoS redefined at plugins//spawn_utils.pl line 204.
[07-21-2016 :: 18:32:17] [Quests] Subroutine MoveAwayFromWall redefined at plugins//spawn_utils.pl line 268.
[07-21-2016 :: 18:32:17] [Quests] Subroutine MoveToFirstBestZ redefined at plugins//spawn_utils.pl line 340.
[07-21-2016 :: 18:32:17] [Quests] Subroutine SpawnZone redefined at plugins//spawn_utils.pl line 373.
[07-21-2016 :: 18:32:17] [Quests] Subroutine GetReverseHeading redefined at plugins//spawn_utils.pl line 456.
[07-21-2016 :: 18:32:17] [Quests] Subroutine ConvertHeadingToDegrees redefined at plugins//spawn_utils.pl line 477.
[07-21-2016 :: 18:32:17] [Quests] Subroutine vtell redefined at plugins//voicetell.pl line 6.
[07-21-2016 :: 18:32:17] [Quests] Subroutine Autovtell redefined at plugins//voicetell.pl line 56.
[07-21-2016 :: 18:33:17] [Status] Zoning 'Draconas' to: poknowledge (202) - (0) x=410.000000, y=429.000000, z=-122.000000
[07-21-2016 :: 18:33:17] [Zone Server] Dropping client: Process=false, ip=127.0.0.1 port=50329
[07-21-2016 :: 18:34:53] [Quests] Terminating on signal SIGHUP(1)


ghanja 07-22-2016 12:59 AM

All those messages are "normal" considering there are duplicate sub-routines in:
spawn_utils.pl and spawn_tools.pl and client_messages.pl and vtell.pl, you can delete vtell.pl (if I remember correctly, as that subroutine is in client_messages.pl). There are duplicates in spawn_utils.pl and spawn_tools.pl as well, except for two subroutines (again if I remember correctly) that the one has and the other does not. You can ignore the messages altogether, or look into doing the above.

For quest_handin.pl change your variable declaration to look like this to remove the
Quote:

"my" variable #Item1 masks..
lines to this:
Code:

        my $npc = plugin::val('$npc');
        my $client = plugin::val('$client');
        my $name = plugin::val('$name');
        my $itemcount = plugin::var('itemcount');
        my $ulevel = plugin::val('$ulevel');
        my $npc_name = $npc->GetCleanName();
        my $RewardID = $_[0];
        my $NPCMESSAGE = $_[1];
        my $NPCANIMATION = $_[2];
        my $CaseItems = $_[3];
        my $Item1 = defined $_[4] ? $_[4] : 0;
        my $ItemCount1 = $_[5];
        my $Item2 = defined $_[6] ? $_[6] : 0;
        my $ItemCount2 = $_[7];
        my $Item3 = defined $_[8] ? $_[8] : 0;
        my $ItemCount3 = $_[9];
        my $Item4 = defined $_[10] ? $_[10] : 0;
        my $ItemCount4 = $_[11];
        my $Reward = quest::varlink($RewardID);

Nothing telling in that #reloadquest capture (I assume that is how you generated that log) that I see.

blackdragonsdg 07-23-2016 02:18 PM

So I compiled the binaries with logging level 10 and still nothing remotely helpful in the logs. I think I am going to work around this little oddity instead of beating my head against a wall. I do appreciate the help in trying to solve this problem.


All times are GMT -4. The time now is 06:12 PM.

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