View Full Version : player.pl is there npc.pl?
Irreverent
10-11-2009, 03:15 PM
I was wondering if there was a global file for all npcs, as there is for players?
nightsta69
10-11-2009, 03:19 PM
I believe it is default.pl, in the quest\templates folder
Irreverent
10-11-2009, 03:22 PM
Don't see a default.pl in the templates folder. There is one in the quests/plugins directory but it looks more like a setup than an action file.
Tried using quests/zone/default.pl but the mobs aren't taking to it.
Irreverent
10-11-2009, 03:50 PM
There is a default.pl in tutorialb with a hail = "Shh, I think I here the kobolds."
But, to test I hailed Guard Kaikachi and he doesn't respond to anything.
Is this the right file name or is it supposed to work?
Irreverent
10-15-2009, 09:32 AM
Tried default.pl, did not work. Anyone have any insight on this one?
So_1337
10-15-2009, 11:34 AM
I don't believe that there is currently a way to access a default.pl file. Player quests were implemented by KLS to access the player.pl file, so I'd imagine something similar would have to be created for this case.
The templates folder is a way to place a single file for an NPC in all zones, such as the Nexus Scions. Rather than having to place the file every zone with a scion, one file can control them all.
This is a good idea, though, and I believe it's been talked about in the past. I'd be interested to see it so that return plug-ins could be created for every NPC easily, so that they'd return items. However, there would of course have to be an exception set so that pets wouldn't use the same file.
Irreverent
10-15-2009, 11:38 AM
Good thinking, didn't even think about pets trying to use the same file.
Hopefully this is an easy thing to implement. It looks like someone wanted to do it since there was the default.pl in the tutorialb zone.
Any takers?
ChaosSlayerZ
10-15-2009, 12:18 PM
why shouldn't pets use the same file?
So_1337
10-15-2009, 12:20 PM
I know it was discussed here (http://www.projecteq.net/phpBB2/viewtopic.php?t=4381) as a result of an attempt that went wrong. However, I can't seem to find the original plug-in that was tested and prompted that post.
So_1337
10-15-2009, 12:34 PM
You don't want pets to use the same npc_default.pl (just a name I'm tossing out, it's a hypothetical at this point) because pets need to keep items that are given to them like weapons and armor, and you wouldn't want NPCs to do that by default. You'd want NPCs to return items that are given to them, unless they aren't caught in sub EVENT_ITEM.
Irreverent
10-15-2009, 01:26 PM
Hopefully you can find that plugin, it will greatly save my hair and frustration!
ChaosSlayerZ
10-15-2009, 03:02 PM
You don't want pets to use the same npc_default.pl (just a name I'm tossing out, it's a hypothetical at this point) because pets need to keep items that are given to them like weapons and armor, and you wouldn't want NPCs to do that by default. You'd want NPCs to return items that are given to them, unless they aren't caught in sub EVENT_ITEM.
unless there is a indivudual .pl file for each pet, which I belive should prevent default scripts running for them.
So_1337
10-15-2009, 03:27 PM
Okay, here we go.
default.pl already works, both by zone, and server wide. (It goes in the root directory of quests, not templates. Never made sense to me, but it works.)
It was originally discussed in this thread (http://www.eqemulator.net/forums/showthread.php?t=24534), though it seems that the code was eventually taken out (as explained in the thread I linked to previously over at PEQ).
It seems to have been awhile since this was explored, but you may get the results you want just by experimenting. Hope this has helped =)
Irreverent
10-15-2009, 08:06 PM
But, it doesn't work. Like I said, the default.pl in tutorialb doesn't make the guards(non-quest) say "shh, i hear kobolds"
leslamarch
10-15-2009, 08:27 PM
it works fine on my test server running rev 1000 -ish
So_1337
10-16-2009, 05:29 AM
I was in class yesterday as I posted that, but I'll be at work today. I'll find some time to test with the current revision code, we'll get you figured out =)
Irreverent
10-16-2009, 07:23 AM
ah, it says root directory of quests. So not in a zone folder? That won't work because I don't want mobs of my entire game to act the same. Just some in a certain zone. Or am I reading this incorrectly?
leslamarch
10-16-2009, 07:32 AM
ah, it says root directory of quests. So not in a zone folder? That won't work because I don't want mobs of my entire game to act the same. Just some in a certain zone. Or am I reading this incorrectly?
it will work in the zone folder also, I used blackburrow for an example, so all npc in that zone without a quest file used the default.pl.
Irreverent
10-16-2009, 07:49 AM
OK, I'm using 1008.
I put default.pl in arena, commons, anywhere with the following:
sub EVENT_SPAWN
{
quest::shout("Hello world.");
}
And get nothing. Made sure to leave zone, come back, use #reloadquest while in it...and nadda.
maybe you can't use certain events becuse they already defined in the other default.pl?
So_1337
10-16-2009, 08:19 AM
Okay, let's talk details, then. Interestingly, I skimmed Les' post without seeing he'd used Blackburrow to test, and that's where I did my testing a few minutes ago as well. I figured it was a good place, since there aren't any other quest files for the zone. I created the folder with both "default.pl" and "a_gnoll_pup.pl", each with the exact same code inside. Gnoll pups execute the code, nothing else in the zone does, so there's something at play here preventing it from working for both Irreverent and myself.
I also tested that the default.pl doesn't execute even when placed in the root of the quests directory, so it seems that default.pl doesn't work for us at all. Now we just have to figure out why =)
I'm running somewhere around revision 1000, the same as Les, so I don't think it's an issue with the source code. I believe this is going to come down to server setup. I'm running my server on Windows Server 2003 and I'm using ActivePerl version 5.10.0 build 1004.
I'm pretty sure Les runs a Linux server, how about you, Irreverent?
leslamarch
10-16-2009, 08:43 AM
ok guys for testing, I'll admit I wanted to see this in action anyway, But this is what i used for the blackburrow stage (http://www.eqemulator.net/forums/showthread.php?t=26123). I made all the npc in blackburrow global, since it was stated in that post somewhere. I'm going to run this test again on a windows 7 machine and see what I get..
Irreverent
10-16-2009, 08:49 AM
Yea, I have no problems with mob_name.pl just default.pl
I'm running on Vista x86(hides), Perl 5.8.9 b825. Fully updated w/microsoft/vendors. Running Ad-Aware and Avast!.
Irreverent
10-16-2009, 08:55 AM
I tried an update to 5.10 awhile ago, worked fine until the release of binaries 973...they didn't work and had to revert back to 5.8.
leslamarch
10-16-2009, 09:03 AM
ok just tried on my home PC doing the same steps i did the other day and I can not get this to work either, So when i have some time I will try and figure what is different. I tired everything I can think of and came to the same results as So_1337 :( .
So_1337
10-16-2009, 09:08 AM
Okay, setting qglobals to 1 for all of the NPCs in Blackburrow did the trick; they all respond to the default.pl file now. That's the trick, then =) Good catch, Les!
Irreverent
10-16-2009, 09:17 AM
That doesn't make sense. I thought that flag was so they could select/see items on the quest_globals table?
I mean if it works, I'll just set ALL mobs to qglobals = 1. Does this inherantly cause any lag/performance/etc problems? If it doesn't, they why even have the flag?
leslamarch
10-16-2009, 09:40 AM
Okay, setting qglobals to 1 for all of the NPCs in Blackburrow did the trick; they all respond to the default.pl file now. That's the trick, then =) Good catch, Les!
however I can't make it work all the time even using Qglobals, so there is a problem here just not sure when it got messed up. The very first time I tested it I was using that thread I posted above. lol this is another good puzzle Irreverent has discovered :)
Irreverent
10-16-2009, 10:12 AM
Phew, glad you noticed that before I updated all my NPCs!
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.