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 06-17-2008, 11:39 AM
kayen85
Sarnak
 
Join Date: Dec 2007
Posts: 50
Default Displaying quest globals

I am having difficulty in getting any quest to use the quest global values that I enter. I used an example script from the site to set the value to ensure I was doing it right, however I can not under an circumstances write a line of code that will display the value, or even use it to trigger an event.

If I get mysql quest global file though, it is infact in there.... So how do I get it out so I can use it?

Quote:
sub EVENT_SAY {

if ($text=~/hail/i) {

quest::say("Hail to you, lesser being!");

} elsif ($text=~/Set/i) {

quest::say("Setting your stupid var human !");
quest::delglobal("AVAR");
quest::setglobal("AVAR", 1, 7, "Y50");

} elsif ($text=~/Get/i) {

quest::say("Here is your results $qglobals{AVAR} " );




}

}
Every time I do get, it just reads the line and omits the value.

I have tried linking it to conditions like

Quote:
if($qglobals{AVAR}) == 1)

or

if(defined($qglobals{AVAR}))
I am not sure what I am doing wrong at this point.

Kayen
Reply With Quote
  #2  
Old 06-17-2008, 11:44 AM
Cripp's Avatar
Cripp
Discordant
 
Join Date: Oct 2003
Location: The Shire
Posts: 474
Default

try this one...
Code:
sub EVENT_SAY
{
	if ($text=~/hail/i)
	{
		quest::say("Hail to you, lesser being!");
	}
	if ($text=~/Set/i)
	{
		quest::say("Setting your stupid var human !");
		if (!defined $qgobals{AVAR})
		{
			quest::delglobal("AVAR");
			quest::setglobal("AVAR", 1, 7, "Y50");
		}
	}
	if ($text=~/Get/i)
	{
		my $avar = $qglobals{AVAR};
		quest::say("Here is your results $avar");
	}
}
PS: not sure if that red semicolon should go there or not.. thats why i made it red.
__________________
Nug Blazers - ServerOP / founder
^^comming... later!

www.nugblazers.com
Reply With Quote
  #3  
Old 06-17-2008, 12:06 PM
kayen85
Sarnak
 
Join Date: Dec 2007
Posts: 50
Default No luck

Tried your code, same problem. Its set perfectly in the mysql file but it will just not display it in the text when retrieved. Semicolon was needed btw.

I understand the code so it just doesn't make sense why it isn't working. Seems simple enough.

Kayen
Reply With Quote
  #4  
Old 06-17-2008, 03:06 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

using your original code, try this:

Code:
sub EVENT_SAY {
    if ($text=~/hail/i) {
        quest::say("Hail to you, lesser being!");
    }
    elsif ($text=~/Set/i) {
        quest::say("Setting your stupid var human !");
        quest::delglobal("AVAR");
        quest::setglobal("AVAR", 1, 7, "Y50");
    }
    elsif ($text=~/Get/i) {
        quest::say("Here is your results $AVAR");
    }
}
Reply With Quote
  #5  
Old 06-17-2008, 05:51 PM
kayen85
Sarnak
 
Join Date: Dec 2007
Posts: 50
Default

Thanks Conglar,

But still no luck. I really don't know why it isn't displaying. Again the variable is in the global file I just can't use it.
Reply With Quote
  #6  
Old 06-17-2008, 08:07 PM
SoTRichard
Sarnak
 
Join Date: Aug 2004
Posts: 67
Default

don't know if this has anything to do with it, but sometimes i forget to set the npc's global to 1... you have to do that to get the globals to work.
__________________
Truth=What is, is.
Reply With Quote
  #7  
Old 06-17-2008, 09:17 PM
kayen85
Sarnak
 
Join Date: Dec 2007
Posts: 50
Default

Hmm maybe, how exactly do I set an NPC's global to 1?
Reply With Quote
  #8  
Old 06-17-2008, 09:52 PM
Cripp's Avatar
Cripp
Discordant
 
Join Date: Oct 2003
Location: The Shire
Posts: 474
Default

ah ya thats it.. the sql syntax UPDATE npc_types SET qglobal=1 where id=npcID; (qglobal or qglobals, not sure which)
__________________
Nug Blazers - ServerOP / founder
^^comming... later!

www.nugblazers.com
Reply With Quote
  #9  
Old 06-17-2008, 09:54 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

find the npc in the npc_types table in the database and set the qglobal value to 1
Reply With Quote
  #10  
Old 06-17-2008, 10:33 PM
kayen85
Sarnak
 
Join Date: Dec 2007
Posts: 50
Default

Yup, that was the problem. All fixed. Thanks guys appreciate it.
Reply With Quote
  #11  
Old 06-17-2008, 11:55 PM
SoTRichard
Sarnak
 
Join Date: Aug 2004
Posts: 67
Default

np, glad i could help
__________________
Truth=What is, is.
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 03:50 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