EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Quest Globals broken (https://www.eqemulator.org/forums/showthread.php?t=22060)

Dymerius 12-10-2006 08:42 AM

Quest Globals broken
 
Since I began using the latest build I've been having a problem with quest globals.

Here is a quick example:

Code:

sub EVENT_SAY{

if($text=~/hail/i && $aflag == ""){
quest::setglobal("aflag", 1, 5, "F");
quest::say("Now Flagged.");}

if($text=~/hail/i && $aflag == 1){
quest::say("You are already flagged.");}

}

In this case, "aflag" will be put into the quest_globals table like it should, but the second If will never execute - the first If executes every time.

Again, these are quest globals that all work with previous builds.

Does anyone know what might be causing this?

Thanks in advance,

Cripp 12-10-2006 09:00 AM

Code:

sub EVENT_SAY
{

        if($text=~/hail/i)
        {
                if (!defined $aflag)
                {
                        quest::setglobal("aflag", 1, 5, "F");
                        quest::say("Now Flagged.");
                }
                if (defined $aflag)
                {
                        quest::say("You are already flagged.");
                }
        }
}

try this...

edit: Moved to Quests::Q&A
edit2: Dont forget to set qglobals to 1 for the npc in npc_types table.

Dymerius 12-10-2006 09:21 AM

Thanks, Cripp. I wasn't sure whether or not this classified as Quest support since the code referenced was simply to help give the reader understanding of what my problem is. The problem itself does not stem from any Quest script and the global variables (if you classify them as quest-related) seem to also be working properly. It seems that the problem is not quest-related at all, but, rather, lies in some other area.

Also, qglobals is true for the NPCs. Again, everything worked properly with previous builds.

Angelox 12-10-2006 09:45 AM

Quest globals is pretty confusing at first - took me a while to understand it. And to top it off, I was using the "EqEmu Perl Quest Lexicon" manual, which is very nice, but outdated, and information there has changed.
The new good information I found (and helped me a lot), was at the Wiki.

Dymerius 12-28-2006 01:43 PM

Still haven't resolved this; if anyone has any ideas, I'd love to hear 'em. ;)

Angelox 12-28-2006 02:08 PM

Quote:

Originally Posted by Dymerius
Still haven't resolved this; if anyone has any ideas, I'd love to hear 'em. ;)

Well, quest globals really is broken now - if you use anything above EQEmu-0.7.0-933 , then they will not work right. Might have been your problem before, I just realized this recently.
EQEmu-0.7.0-933 runs pretty nice, and is what I'm using.

Also, do this in you scripts;

Code:

quest::delglobal("aflag");            #delete  globals first
quest::setglobal("aflag", 1, 5, "F");  #set the new global
$aflag=undef;                          #clear any cache



All times are GMT -4. The time now is 11:00 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.