PDA

View Full Version : Handin not working and player.pl error


erik_llewellyn
04-23-2008, 09:06 AM
I have been working on making a quest for each zone to "flag" a character for them and adding +1 hp/mana/end for each flag to an item I created. I just wanted the basic quest shell to work for now, I will code in the +1 and item leter. However after about a week now of trial and error, looking at various posts which gave many great ideas, my quest still seems to be partially broken. Specficially the handin portion doesn't seem to be working at all. My NPC just eats the item and doesn't run any part of the event_item script. I have noticed that the "check_handin.pl", "check_hasitem.pl", "guildmasters.pl", and "soulbinders.pl" that is in the "\plugins" folder are different from those that are loaded into the "\quests\plugins" folder. I tried replacing them both with each version one at a time and either seem to make things work.

Question 2 is, the wiki says "player.pl" used for storing exported variables but doesn't give any clue as to how to code something for it or how to use it. doing a search for it on the forums turns up very little.

I am using PEQserverpack-maps-4.0-1104 with the PEQupdatepack-4.0-1106

quest_zone log

[04.23. - 08:31:22] Starting Log: logs/eqemu_quest_zone_3140.log
[04.23. - 08:31:22] Tying perl output to eqemu logs
[04.23. - 08:31:22] Creating EQEmuIO=HASH(0x3f44678)
[04.23. - 08:31:22] Creating EQEmuIO=HASH(0x3f44a20)
[04.23. - 08:31:22] Loading perlemb plugins.
[04.23. - 08:31:22] Loading perl commands...
[04.23. - 08:36:41] Bareword found where operator expected at quests/crushbone/999137.pl line 16, near "$client->Message(15, "You"
[04.23. - 08:36:41] (Might be a runaway multi-line "" string starting on line 12)
[04.23. - 08:36:41] (Missing operator before You?)
[04.23. - 08:36:41] Unquoted string "flag" may clash with future reserved word at quests/crushbone/999137.pl line 16.
[04.23. - 08:36:51] Unable to read perl file 'quests/crushbone/player.pl'
[04.23. - 08:36:51] Unable to read perl file 'quests/templates/player.pl'


Quest Script for "quests\crushbone\999137.pl"

sub EVENT_SAY {
if($text =~ /Hail/i) {
quest::say("Greetings $name. Have you come to [rid] us of the vile Emperor?");
}
if($text =~ /rid/i) {
quest::say("Outstanding! All you have to do is kill Emperor Crushbone then bring me the proof in the form of his head.");
}
}
sub EVENT_ITEM{
#Item id is actually for a cloth cap, but was using it as a test item until I make the head
if($item1 == 1001){
quest::say("You have done it $name! May you be graced with the strength of Brell Seliris!');
quest::exp(25000);
quest::ding();
quest::set_zone_flag(58 );
$client->Message(15, "You received a character flag!");
}
}

As a side note, all other handin's seem to be working, just not the one I created.
Thanks for any assistance :)

LordKahel
04-23-2008, 09:24 AM
Your error is at the end of this line
quest::say("You have done it $name! May you be graced with the strength of Brell Seliris!');

You started your text string with " but finished it with '

This is the correct syntax :
quest::say("You have done it $name! May you be graced with the strength of Brell Seliris!");



Kahel / Pyronis
Dev Jest 3 Server

erik_llewellyn
04-23-2008, 09:03 PM
Excellent catch LordKahel. I don't know how many times I looked at that line and even re-typed it a few times and still mucked it up it seems.

I still have the issue of the handin portion of the quest eating items and not doing anything else though...I restarted the server after making the afore mentioned change to the " and that fixed my bareword and use of the word "flag" errors. I still have the two player.pl errors and I can only speculate that this is what's breaking my quest since everything else now doesn't report any errors.

Anyone have any light on what the "player.pl" file is supposed to look like or an example?

trevius
04-23-2008, 10:25 PM
To get it to return items, you have to use plugins. I listed a version that should work with the plugins below. Note that I removed the line "quest::set_zone_flag(58 );" only because I haven't actually used flags before. I use quest globals for that kind of stuff. Plus, I didn't see it listed in the wiki quest tutorial here: http://www.eqemulator.net/wiki/wikka.php?wakka=QuestTutorial


sub EVENT_ITEM {

if (plugin::check_handin(\%itemcount, 1001=>1))
quest::say("You have done it $name! May you be graced with the strength of Brell Seliris!");
quest::exp(25000);
quest::ding();
$client->Message(15, "You received a character flag!"); }

else {
plugin::return_items(\%itemcount);
}

}

Aramid
04-23-2008, 10:37 PM
Also, make sure that your plugin directory is under your eqemu directory, NOT the quests folder

IE: C:\eqemu\plugins

Also, if you don't want to get the player.pl error (Not the cause of your problem), you would have to put an empty player.pl file in every quest zone folder.. or just ignore the error.

erik_llewellyn
04-23-2008, 10:52 PM
Man, I really need to do my code work during normal daytime hours instead of after the wife goes to bed....the code how I wrote it before works fine after making Lord's typo fix and then me catching another typo I inserted while tinkering with the item # for the handin. Any way, below is the working code that DOES flag you for the zone, gives you exp, says the response line, and stores the flag for later referancing. The referance I used for the zone flagging is http://www.eqemulator.net/wiki/wikka.php?wakka=ServerZoneFlags

sub EVENT_SAY {
if($text =~ /Hail/i) {
quest::say("Greetings $name. Have you come to [rid] us of the vile Emperor?");
}
if($text =~ /rid/i) {
quest::say("Outstanding! All you have to do is kill Emperor Crushbone then bring me the proof in the form of his head.");
}
}
sub EVENT_ITEM{
#Taskmaster earring
if($item1== 1001){
quest::say("You have done it $name! May you be graced with the strength of Brell Seliris!");Brell!");
quest::exp(25000);
quest::ding();
quest::set_zone_flag(58 );
$client->Message(15, "You received a character flag!");
}
}


Optionally you could implement the changes Trevius suggested and get:

sub EVENT_SAY {
if($text =~ /Hail/i) {
quest::say("Greetings $name. Have you come to [rid] us of the vile Emperor?");
}
if($text =~ /rid/i) {
quest::say("Outstanding! All you have to do is kill Emperor Crushbone then bring me the proof in the form of his head.");
}
}
sub EVENT_ITEM {

if (plugin::check_handin(\%itemcount, 1001=>1))
quest::say("You have done it $name! May you be graced with the strength of Brell Seliris!");
quest::exp(25000);
quest::ding();
quest::set_zone_flag(58 );
$client->Message(15, "You received a character flag!"); }

else {
plugin::return_items(\%itemcount);
}

}

Thanks for all the assistance and late night debugging help all :)

erik_llewellyn
04-23-2008, 10:54 PM
Thanks for the tip on ignoring the player.pl errors Aramid. Since the quest started working I didn't think it could be that bad to see them still, but you never know ;-) As for the plugins, they are already in both, and appear to be functioning.

trevius
04-23-2008, 11:05 PM
Just noting that you have a typo again in the new one you posted this last time. Check the following line:

quest::say("You have done it $name! May you be graced with the strength of Brell Seliris!");Brell!");

That definitely won't work lol! I imagine it is just a copy and paste mistake when you posted it here. But I wanted to note it in case someone else sees it and wants to use some of the script.

erik_llewellyn
04-23-2008, 11:09 PM
you are correct about a copy and paste error. I have been up for too many hours and it's showing lol. thanks Trevius for the spot. Third times a charm....hopefully...zzzzzzzz

sub EVENT_SAY {
if($text =~ /Hail/i) {
quest::say("Greetings $name. Have you come to [rid] us of the vile Emperor?");
}
if($text =~ /rid/i) {
quest::say("Outstanding! All you have to do is kill Emperor Crushbone then bring me the proof in the form of his head.");
}
}
sub EVENT_ITEM{
#Taskmaster earring
if($item1== 1001){
quest::say("You have done it $name! May you be graced with the strength of Brell Seliris!");
quest::exp(25000);
quest::ding();
quest::set_zone_flag(58 );
$client->Message(15, "You received a character flag!");
}
}

LordKahel
04-24-2008, 01:02 PM
Personnally i prefer not to put the return item in a else . That way if they give you the right item with another item , the other items will be returned ...

Example:

sub EVENT_ITEM {

if (plugin::check_handin(\%itemcount, 1001=>1)) {
quest::say("You have done it $name! May you be graced with the strength of Brell Seliris!");
quest::exp(25000);
quest::ding();
quest::set_zone_flag(58 );
$client->Message(15, "You received a character flag!");
}


plugin::return_items(\%itemcount);

}

EvoZak
05-26-2008, 03:12 PM
Also, make sure that your plugin directory is under your eqemu directory, NOT the quests folder

IE: C:\eqemu\plugins

Also, if you don't want to get the player.pl error (Not the cause of your problem), you would have to put an empty player.pl file in every quest zone folder.. or just ignore the error.

This was very helpful. I didn't see anywhere in the install tutorials that this folder needed to be moved and it was fubaring a lot of the quests.