Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 01-02-2015, 07:24 PM
Bandor
Hill Giant
 
Join Date: May 2014
Posts: 209
Default Quest not wanting to work

For whatever reason this quest just won't work. The random color wont even work. Im not sure what I missed.


Code:
Quest File for Steppes - Captain_Vahl

sub EVENT_SAY{
    if($text=~/hail/i){               
        plugin::DiaWind("Hello {gold}$name~! Do you come with {r}news~ from {gold}Deevan~? [I have news>");
    }
    if($text=~/news/i){               
        plugin::DiaWind("Wonderful , now give it to me!");
    }
	 elsif($text=~/news/i) && $ulevel < 35) {               
        plugin::DiaWind("Begone {g}$class~ you waste my {r}time~!!!");
	}
	
	sub EVENT_ITEM { 
	if(plugin::check_handin(\%itemcount, 1270 => 1) && $ulevel > 34) { # Note to Captain Vahl
	plugin::DiaWind("Wonderful , Just what Ive been {y}waiting~ for! [Why have you been waiting>");
	}
	if($test=~/waiting/i){
	plugin::DiaWind("These are the {g}battle plans~ from {gold}Deevan~ Himself! I must look them over , for the meantime seek to earn the {y}favor~ of my Advisors. Speak to me again when you have done all they {r}require~");
	}
	}
	
	
	
	
sub EVENT_SPAWN {
	plugin::SetMobColor(quest::ChooseRandom(0..255), quest::ChooseRandom(0..255), quest::ChooseRandom(0..255));
}
__________________
Owner and Developer - Everquest: A New World
Reply With Quote
  #2  
Old 01-02-2015, 07:43 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

What does #questerrors show and you have downloaded the plugin from the SVN right?

I've yet to mess around with Akka's plugin, so syntax wise, he's your best bet.
Reply With Quote
  #3  
Old 01-02-2015, 08:42 PM
Bandor
Hill Giant
 
Join Date: May 2014
Posts: 209
Default

ya ive used this plugin multiple times its basically a copy of a different quest with a couple tweaks...quest errors shows nothing.
__________________
Owner and Developer - Everquest: A New World
Reply With Quote
  #4  
Old 01-02-2015, 09:21 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

You simply need to comment out and narrow down what is not working.

Your event item looks completely wrong and to make sure that your random color stuff is working or not comment out the section to make sure the quest is working again then slowly uncomment lines until it is not working to eliminate what part has issues.
Reply With Quote
  #5  
Old 01-03-2015, 03:42 PM
Bandor
Hill Giant
 
Join Date: May 2014
Posts: 209
Default

So in an effort to test this I renamed mob completely,renamed the PL to fit new mob name,and removed ervything in script but the random color. And to ensure it is the right script I copied from working NPC's. Still nothing. Have another NPC in zone and his pl file works perfectly fine,so not really sure whats going on.
__________________
Owner and Developer - Everquest: A New World
Reply With Quote
  #6  
Old 01-03-2015, 05:24 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

you're doing it wrong. completely.

1) you are not correctly using conditional logic chains. everything after your opening if statement should be an elsif or else statement. otherwise, you run the risk of more than one entry matching, as you have had happen previously.

2) you are missing a close bracket at the end of your EVENT_SAY subroutine.

3) the above syntax error would have likely been made clear if you'd run your scripts through the perl interpreter with a couple of command line switches, as has been previously suggested twice.

example
Code:
perl -cW path/to/script.pl
the c means compile-only
the w means show warnings
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #7  
Old 01-03-2015, 05:50 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

here's what you'd see if you were to use the -cW switches to check for simple stuff like syntax errors in your scripts (this is what it spat out at me in notepad++). they're not always easy to find manually when you have a large amount of nested statements.


test script contents
Code:
Quest File for Steppes - Captain_Vahl

sub EVENT_SAY{
    if($text=~/hail/i){               
        plugin::DiaWind("Hello {gold}$name~! Do you come with {r}news~ from {gold}Deevan~? [I have news>");
    }
    if($text=~/news/i){               
        plugin::DiaWind("Wonderful , now give it to me!");
    }
    elsif($text=~/news/i) && $ulevel < 35) {               
        plugin::DiaWind("Begone {g}$class~ you waste my {r}time~!!!");
    }

sub EVENT_ITEM { 
    if(plugin::check_handin(\%itemcount, 1270 => 1) && $ulevel > 34) { # Note to Captain Vahl
        plugin::DiaWind("Wonderful , Just what Ive been {y}waiting~ for! [Why have you been waiting>");
    }
    if($test=~/waiting/i){
        plugin::DiaWind("These are the {g}battle plans~ from {gold}Deevan~ Himself! I must look them over , for the meantime seek to earn the {y}favor~ of my Advisors. Speak to me again when you have done all they {r}require~");
    }
}

sub EVENT_SPAWN {
    plugin::SetMobColor(quest::ChooseRandom(0..255), quest::ChooseRandom(0..255), quest::ChooseRandom(0..255));
}
console output
Code:
NPP_EXEC: "perl [check syntax]"
NPP_SAVE: C:\Users\*****\Desktop\Captain_Vahl.pl
perl -cW "C:\Users\*****\Desktop\Captain_Vahl.pl"
Process started >>>
syntax error at C:\Users\*****\Desktop\Captain_Vahl.pl line 3, near "Captain_Vahl

sub EVENT_SAY"
Missing right curly or square bracket at C:\Users\*****\Desktop\Captain_Vahl.pl line 27, at end of line
C:\Users\*****\Desktop\Captain_Vahl.pl had compilation errors.
<<< Process finished. (Exit code 255)
================ READY ================
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #8  
Old 01-03-2015, 05:52 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

there's also a missing hash to comment out the first line, and you've got what looks to be another conditional line for your EVENT_SAY subroutine inside your EVENT_ITEM subroutine with the variable used to check spelled incorrectly.

here... i'm assuming this should be $text, not $test, and that it shouldn't be in your EVENT_ITEM sub
Code:
if($test=~/waiting/i){
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #9  
Old 01-03-2015, 09:05 PM
Bandor
Hill Giant
 
Join Date: May 2014
Posts: 209
Default

I see the stupid mistakes Made now that theyve been pointed out,however im still getting nowhere with this npc lol. Ive just coppied/pasted working quests( that I wrote and tested) and with no luck.For instance just gave him a simple quest code that I know for a fact works as I just did the quest 5minutes ago.


Code:
sub EVENT_SAY {
	if($text=~/hail/i) {
		plugin::Whisper("Hail $class. Do you seek to earn some " . quest::saylink("armour", 1) . "?");
	} 
	elsif($text=~/armour/i) {
		plugin::Whisper("I can make you armor provided you have the proper " . quest::saylink("materials", 1) . " for me.");
	}
	elsif($text=~/materials/i) {
		plugin::Whisper(" Bring me a armor " . quest::saylink("pattern", 1) . " and a " . quest::saylink("crafting", 1) . " piece.");
	} 
	elsif($text=~/pattern/i) {
		plugin::Whisper("Indeed, they can be found from most creatures. Keep your eyes and ears open.");
	}
    elsif($text=~/crafting/i) {
		plugin::Whisper("Yes you fool! Infact I happen to sell them. Plate for Plate,Chain for Chain get it?!");
	}
	}


As far as the code for the perl interpreter im just failing to understand what to do with the code at all,do I make a new PL file or what? Sorry for all these noob quests but Im trying here guys.
__________________
Owner and Developer - Everquest: A New World
Reply With Quote
  #10  
Old 01-03-2015, 09:46 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

And what is the value of the isquest field for this NPC (type) ?
Reply With Quote
  #11  
Old 01-03-2015, 10:01 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Quote:
Originally Posted by ghanja View Post
And what is the value of the isquest field for this NPC (type) ?
That shouldn't affect whether or not the NPC runs a quest file. Reading the issues, I'm thinking the NPC is named different, the quest file is in the wrong location, or the quests weren't reloaded.
Reply With Quote
  #12  
Old 01-03-2015, 10:06 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

you need to post the entire script. if there are syntax errors somewhere else outside of the subroutine you're showing us, the script won't run.

as far as running the script with the switches -cW, you open a command prompt and call perl that way, including the switches and the correct full path to where your script resides on your computer. you don't have to have your server or client running to do that. if there are syntax errors in the script in question, it will catch them there.

truthfully, it's going to be worth your while to learn some perl basics outside of scripting for the emulator if you intend to do anything other than minor changes to existing quests.
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #13  
Old 01-03-2015, 10:24 PM
Bandor
Hill Giant
 
Join Date: May 2014
Posts: 209
Default

Script is as follows..Using this script for testing because I know it works. Using it on a pc named Test. File is named Test.pl and is in steppes folder. I have another npc in steppes (a custom teleporter) he is functioning 100%.



Code:
Quest File for Steppes - Captain_Vahl

sub EVENT_SAY {
	if($text=~/hail/i) {
		plugin::Whisper("Hail $class. Do you seek to earn some " . quest::saylink("armour", 1) . "?");
	} 
	elsif($text=~/armour/i) {
		plugin::Whisper("I can make you armor provided you have the proper " . quest::saylink("materials", 1) . " for me.");
	}
	elsif($text=~/materials/i) {
		plugin::Whisper(" Bring me a armor " . quest::saylink("pattern", 1) . " and a " . quest::saylink("crafting", 1) . " piece.");
	} 
	elsif($text=~/pattern/i) {
		plugin::Whisper("Indeed, they can be found from most creatures. Keep your eyes and ears open.");
	}
    elsif($text=~/crafting/i) {
		plugin::Whisper("Yes you fool! Infact I happen to sell them. Plate for Plate,Chain for Chain get it?!");
	}
	}
__________________
Owner and Developer - Everquest: A New World
Reply With Quote
  #14  
Old 01-03-2015, 10:28 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

is this line commented out?

Code:
Quest File for Steppes - Captain_Vahl
is the NPC also named Test?
__________________
I muck about @ The Forge.
say(rand 99>49?'try '.('0x'.join '',map{unpack 'H*',chr rand 256}1..2):'incoherent nonsense')while our $Noport=1;
Reply With Quote
  #15  
Old 01-03-2015, 10:43 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Quote:
Originally Posted by joligario View Post
That shouldn't affect whether or not the NPC runs a quest file. Reading the issues, I'm thinking the NPC is named different, the quest file is in the wrong location, or the quests weren't reloaded.
Oh. Well, learn something new everyday. I've gotten in the habit of setting that field if an associated script for the npc type existed. So, emu runs a check upon every event? (beginning with event_spawn) regardless that fields setting? Seems like an awful lot of wasted checks. Or is that not quite how it works (will look at the source to see precisely what is going on -- just figured I'd ask).
Reply With Quote
Reply


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 09:42 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