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-11-2009, 09:50 PM
Daecor
Fire Beetle
 
Join Date: Feb 2004
Posts: 4
Default qglobals not working for me

hive searched the froums a few time and been playing with the code for around 5 hours and still cant figure out whats wrong i even went into the database and made sure the npc was able to use quest globals

basic idea im trying to do is this
i have a mob that sets the variable
(and indeed it makes it i checked database)
and another to check it and say one thing if its set and another if its not

E.G.
Code:
sub event_say 
 {
   if ($qglobals{var_name} >= 1)
    {
      if ($text =~/hail/i)
        {
          quest::say("blah blah blah");
        }
    }
   else
    {
      if ($text =~/hail/i)
        {
          quest::say("blah2 blah2 blah2");
        }
    }
 }
the prob is nomatter it the variable is set or not the NPC still says the "blah2 blah2 blah2 part anyone have anyidea what im dooing wrong
thank you in advance for any help
Reply With Quote
  #2  
Old 01-11-2009, 10:18 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

I would check to make sure you are setting the right option during setting the global.

http://www.eqemulator.net/forums/showthread.php?t=27207
Reply With Quote
  #3  
Old 01-11-2009, 10:23 PM
Daecor
Fire Beetle
 
Join Date: Feb 2004
Posts: 4
Default

i set the var using
Code:
quest::setglobal("var_name",1,5,"F");
Reply With Quote
  #4  
Old 01-11-2009, 10:56 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Try this modified version:
Code:
sub event_say 
	{
	if (defined($qglobals{var_name})) 
		{
		if ($qglobals{var_name} >= 1)
    			{
      			if ($text =~/hail/i)
        			{
          			quest::say("blah blah blah");
        			}
    			}
		}
	else
    		{
      		if ($text =~/hail/i)
        		{
          		quest::say("blah2 blah2 blah2");
        		}
    		}
 	}
Reply With Quote
  #5  
Old 01-11-2009, 11:15 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

The npcs also have to be set to use globals in the DB, qglobal = 1 in npctypes.
Reply With Quote
  #6  
Old 01-11-2009, 11:28 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Upon reflection, shouldn't this be rewritten to something like this?
Code:
sub event_say 
	{
	if ($text =~/hail/i)
		{
		if (defined($qglobals{var_name})) 
			{
			if ($qglobals{var_name} >= 1)
    				{
          			quest::say("blah blah blah");
        			}
    			}
		else
        		{
          		quest::say("blah2 blah2 blah2");
        		}
    		}
	}
Reply With Quote
  #7  
Old 01-11-2009, 11:32 PM
Daecor
Fire Beetle
 
Join Date: Feb 2004
Posts: 4
Default

Quote:
Originally Posted by KLS View Post
The npcs also have to be set to use globals in the DB, qglobal = 1 in npctypes.
Thank you KLS that was my prob NPC's didnt have qglobals set to 1 in DB
Reply With Quote
  #8  
Old 06-16-2009, 11:43 PM
Yeormom
Discordant
 
Join Date: Apr 2004
Location: 127.0.0.1
Posts: 402
Default

Quote:
Originally Posted by KLS View Post
The npcs also have to be set to use globals in the DB, qglobal = 1 in npctypes.
I spent 2 hours last night before I remembered to check this.
__________________
Yeorwned
Bane of Life [Custom Classic/PvP]
Reply With Quote
  #9  
Old 06-16-2009, 11:46 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Quote:
Originally Posted by Yeormom View Post
I spent 2 hours last night before I remembered to check this.
And now you will never forget it again!
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #10  
Old 06-19-2009, 03:04 PM
Yeormom
Discordant
 
Join Date: Apr 2004
Location: 127.0.0.1
Posts: 402
Default

Trevius, you would have thought so...but then I wasted another 15 minutes this afternoon trying to figure out what I did wrong with a replacement for the setglobal function. I didn't flip the bit again...
__________________
Yeorwned
Bane of Life [Custom Classic/PvP]
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 04:14 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