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 08-01-2014, 12:55 AM
BasketCase209's Avatar
BasketCase209
Fire Beetle
 
Join Date: Feb 2006
Location: California
Posts: 28
Default problems with quest globals?

Firstly, yes I made sure the qglobals was set to 1 on the npc.
Secondly, after flagging them I repopped, rezoned and reset the server.
Thirdly, yes, I have quest_globals in my database.

What I'm trying to do is write a simple blackjack quest where you can give plat to the npc and have them open a tab for you. But the second I put anything related to a qglobal in the quest it seems to stop working. I've been copying directly off of the wiki page. I tried troubleshooting by taking only the beginning of the quest off. She won't even reply to a hail. Here is the fragment I'm testing on the other dealer in highkeep.
Quote:
sub EVENT_SAY {
my $cashout = quest::saylink("cash out");
my $play = quest::saylink("play");
my $hit = quest::saylink("hit");
my $stay = quest::saylink("stay");

if($text=~/Hail/i){
quest::say("My dialog is working.");
}
if($text=~/Hail/i && !defined $qglobals{BlackJackTab}){
quest::say("Hello, $name. Are you looking for a rousing game of black jack? Go ahead and give me some platinum to get started and I'll open a tab for you.");
}
if($text=~/Hail/i && defined $qglobals{BlackJackTab}){
quest::say("Welcome back, $name. Your current balance is $qglobals{"BlackJackTab"} platinum. If you'd like to $cashout please tell me.");
}
}
When I hail her with that as the quest she turns to me but won't respond at all. Not even with, "My dialog is working." I put that in when she wasn't responding to see if she'd get that far but she doesn't
However, when I remove all references to qglobals it works.

Quote:
sub EVENT_SAY {
my $cashout = quest::saylink("cash out");
my $play = quest::saylink("play");
my $hit = quest::saylink("hit");
my $stay = quest::saylink("stay");

if($text=~/Hail/i){
quest::say("My dialog is working.");
}
}
when this is her quest and I hailer he responds just fine with, "My dialog is working."

What am I missing here?
Knowing me it's probably something painfully obvious.
Thanks, guys. =)
Reply With Quote
  #2  
Old 08-01-2014, 08:42 AM
vsab's Avatar
vsab
Discordant
 
Join Date: Apr 2014
Location: United Kingdom
Posts: 276
Default

It might be that your if statements are missing quotation marks.

Code:
if($text=~/Hail/i && defined $qglobals{"BlackJackTab"}){
Reply With Quote
  #3  
Old 08-01-2014, 09:07 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Quote:
Originally Posted by vsab View Post
It might be that your if statements are missing quotation marks.

Code:
if($text=~/Hail/i && defined $qglobals{"BlackJackTab"}){
Quotes not necessary.
Reply With Quote
  #4  
Old 08-01-2014, 11:13 AM
BasketCase209's Avatar
BasketCase209
Fire Beetle
 
Join Date: Feb 2006
Location: California
Posts: 28
Default

I don't think it's the quotes because it worked just fine when I took all mentions of globals out. She said, "My dialog is working."
However, when it does have qglobals in it she doesn't even say that.
Thanks for helping me brainstorm, though. =)
Reply With Quote
  #5  
Old 08-01-2014, 11:16 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

I have noticed that some systems fail if you don't put parenthesis around the defined/not defined check. Most likely not your case, but wouldn't hurt to try.

Do qgloabls work for you in any script? If not, I am thinking something with your folder structure - perhaps you don't have all the quest/plugin/global files in the right location.
Reply With Quote
  #6  
Old 08-01-2014, 02:39 PM
BasketCase209's Avatar
BasketCase209
Fire Beetle
 
Join Date: Feb 2006
Location: California
Posts: 28
Default

So I tried putting parenthesis around the defined check and it didn't change it.
Here is what it looked like just in case I misunderstood.

Quote:
sub EVENT_SAY {
my $cashout = quest::saylink("cash out");
my $play = quest::saylink("play");
my $hit = quest::saylink("hit");
my $stay = quest::saylink("stay");

if($text=~/Hail/i){
quest::say("My dialog is working.");
}
if($text=~/Hail/i && (!defined $qglobals{BlackJackTab})){
quest::say("Hello, $name. Are you looking for a rousing game of black jack? Go ahead and give me some platinum to get started and I'll open a tab for you.");
}
if($text=~/Hail/i && (defined $qglobals{BlackJackTab})){
quest::say("Welcome back, $name. Your current balance is $qglobals{"BlackJackTab"} platinum. If you'd like to $cashout please tell me.");
}
}
It appears quest globals are working. I copied the "hails" quest over from the wiki page and that worked just fine. I even checked the database to see if it put the global in there and it had.

So that means it's probably an error with the structure of the one I wrote? I'll keep playing with it and keep you guys posted.
Reply With Quote
  #7  
Old 08-01-2014, 02:58 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

I found the issue with your quest, where you're using $qglobals{"BlackJackTab"} it's throwing this error: http://prntscr.com/48ks7c

To find errors like this in your quest you can use this: #logs quest.

Here is a copy that works using concatenation.

EDIT: Here's a screenshot of it working.
Reply With Quote
  #8  
Old 08-01-2014, 03:09 PM
BasketCase209's Avatar
BasketCase209
Fire Beetle
 
Join Date: Feb 2006
Location: California
Posts: 28
Default

You're right, Kingly. I think I got it going now.
I think the error was being caused by the usage not being set up correctly.
I had it as:
Quote:
quest::say("Welcome back, $name. Your current balance is $qglobals{"BlackJackTab"} platinum. If you'd like to $cashout please tell me.");
But when I copied the working "hail" and put my own info in I noticed it had to be formatted as such:
Quote:
quest::say("Welcome back, $name. Your current balance is " . $qglobals{"BlackJackTab"} . " platinum. If you'd like to $cashout please tell me.");
I also didn't know about the #logs command. I'm definitely going to be using this.

I REALLY appreciate the help all.
Reply With Quote
  #9  
Old 08-01-2014, 03:13 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

You're welcome. Also, I'd recommend using plugin::Whisper, as it only sends to one client and doesn't flood the chat whenever someone interacts with the NPC.
Reply With Quote
  #10  
Old 08-01-2014, 03:36 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Quote:
Originally Posted by BasketCase209 View Post
So I tried putting parenthesis around the defined check and it didn't change it.
Here is what it looked like just in case I misunderstood.
Sorry I wasn't more clear. I meant like this:
if($text=~/Hail/i && !defined($qglobals{BlackJackTab})){

But like I said, it is rare and usually system specific. Good to see you are set. Good luck!
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 06:00 PM.


 

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