View Single Post
  #37  
Old 12-29-2006, 08:39 PM
Aerewen
Hill Giant
 
Join Date: Dec 2006
Posts: 110
Default

the only issue i have found after testing this for like 5 hours is this:

if you have multiple npc's using a quest global and one of them deletes that global, the other npc's will still show that global cached.

example:
Arias sets a global "intro" to value of "1" when hailed. Then when you hail Absor, he responds with something and deletes that global. If you hail absor again he will respond with his normal text since as far as his perl file knows, that variable is unset. Arias however will continue to respond as if the global is still set because he never called a delglobal command which would have told the perl quest system to undefine that variable.

The fix that i use is this:
Code:
sub EVENT_SIGNAL{
  if($signal == 1){
    $intro = undef;
  }
}
you put that code into arias' quest file, then add the following line to the response absor gives when hailed with the global intro set to 1:

Code:
quest::signalwith(189013,1);
this assumes that arias' npc id is 189013 in the npc_types table.

this way absor will delete the global from the database with delglobal("intro") and arias will clear the cached version of it.

whether a fix is later implemented to cause npc's to update their globals whenever any sub EVENT_BLAH is triggered or not... this is a safe way to code your quests in perl for the time being and will not cause any conflict if a fix is later added.
Reply With Quote