trevius
02-26-2008, 05:05 PM
Yes, another post in the quest forum by me. I am constantly trying new things, and every now and then I get stuck and can't find a solution on the forums.
The current issue I am running into right now appears to be a problem with a certain NPC I created using #spawn. For some reason, the quest I gave that NPC is able to flag my character just fine by using quest globals, but it doesn't recognize the flags after it gives them. I checked the quest globals in Navicat and the flag is definitely showing up for my character as being set to 1 as it should. But, when I hail the mob, it just replies to me with the text as if I wasn't flagged even though I have other text set for flagged responses.
This isn't the actual script I am using, it is just a simple example to show what I mean. If I set the below quest on my NPC in nexus, and I hail and then say "flag", I can check the Quest Globals and see that it did add a flag for my character. So, if it was working right, the next time I hail this NPC, it should give the flagged hail response telling me that I have a flag. Instead, I only get the initial undefined flag response. Here is the example quest:
sub EVENT_SAY {
if ($text=~/hail/i && $level_quest == undef) {
quest::say("Hello, $name, you don't have a flag defined for this quest yet. Would you like a flag?");}
if ($text=~/flag/i && $level_quest == undef) {
quest::say("Hello, $name, you don't have a flag defined for this quest yet. Would you like a flag?");
quest::setglobal("level_quest", 1, 5, "F");
}
if ($text=~/hail/i && $level_quest == 1) {
quest::say("Hello, $name, you are flagged with 1 for this quest.");}
}
$level_quest = undef;
}
}
Then to test if there was maybe something in the quest that was causing it to skip the flagged responce, I tried a code similar to this:
sub EVENT_SAY {
if ($text=~/hail/i && $level_quest == 1) {
quest::say("Hello, $name, you are flagged with 1 for this quest.");}
}
$level_quest = undef;
}
}
The only possible response in this case is the flagged response. But, when I do a #reloadquest and try hailing the NPC with this quest set, the NPC doesn't respond at all.
So, to further troubleshoot this, I went to PoV where I have slightly modified the PEQ quest for access to Aerin'Dar's lair. It has flagging via quest globals and it is working perfectly. My character is flagged from that quest to have the last flag. When I hail the quest NPC in PoValor, it says "Good Luck", which is the response for having all of the flags. So, that is working properly. I then copied that NPC's quest and pasted it to my problem NPC in Nexus. When I hail that NPC, it says the initial response as if I had no flags for that quest. And to be clear, that particular quest uses global option 5 which means it should be recognized by ALL npcs in ALL zones for THIS player (me). So, basically the problem NPC in Nexus seems to not be recognizing flags at all. I even tried simplifying the PoV quest I copied to it so it only had 1 response choice. Here is basically what I had:
sub EVENT_SAY {
if ($text=~/hail/i && $pov_key_quest == 5) {
quest::say("Good Luck.");}
}
$pov_key_quest = undef;
}
}
As suspected, I still got no response from the problem NPC with this quest in place. I even tried rebooting my server to see if that might help the NPC recognize flags, but it made no difference. This same quest works fine on the PoValor NPC.
The only thing I haven't tried (but I will tonight when I get home) is to try copying the initial quest I was trying to get working on the problem Nexus NPC and pasting it to the PoValor NPC to see how it responds. I am pretty sure it would work as intended and recognize the flags.
So, as far as I can tell, the the cause seems to be something with that particular NPC in Nexus which I used #spawn to create. The NPC in PoValor is from PEQ and so is the the quest with globals that I have been using for my testing. I did modify the quest slightly on my server, since it wasn't complete in the PEQ DB. I simply reworded a few things and made the final reward easier to get.
So, is there something I am missing? Maybe there is a reason why mobs that are created using #spawn don't recognize quest globals? I know there must be something slightly different about them, because there seems to be a known issue that causes #spawn created NPCs to not always pop on repops or zone starts. I have this problem from time to time on my server, particularly in Nexus where I have all #spawn created NPCs.
So, maybe there is some setting causing these NPCs to not recognize quest globals for some reason. If anyone can look into this, it would be much appreciated. I will continue to do more testing and provide my results when I get them.
The current issue I am running into right now appears to be a problem with a certain NPC I created using #spawn. For some reason, the quest I gave that NPC is able to flag my character just fine by using quest globals, but it doesn't recognize the flags after it gives them. I checked the quest globals in Navicat and the flag is definitely showing up for my character as being set to 1 as it should. But, when I hail the mob, it just replies to me with the text as if I wasn't flagged even though I have other text set for flagged responses.
This isn't the actual script I am using, it is just a simple example to show what I mean. If I set the below quest on my NPC in nexus, and I hail and then say "flag", I can check the Quest Globals and see that it did add a flag for my character. So, if it was working right, the next time I hail this NPC, it should give the flagged hail response telling me that I have a flag. Instead, I only get the initial undefined flag response. Here is the example quest:
sub EVENT_SAY {
if ($text=~/hail/i && $level_quest == undef) {
quest::say("Hello, $name, you don't have a flag defined for this quest yet. Would you like a flag?");}
if ($text=~/flag/i && $level_quest == undef) {
quest::say("Hello, $name, you don't have a flag defined for this quest yet. Would you like a flag?");
quest::setglobal("level_quest", 1, 5, "F");
}
if ($text=~/hail/i && $level_quest == 1) {
quest::say("Hello, $name, you are flagged with 1 for this quest.");}
}
$level_quest = undef;
}
}
Then to test if there was maybe something in the quest that was causing it to skip the flagged responce, I tried a code similar to this:
sub EVENT_SAY {
if ($text=~/hail/i && $level_quest == 1) {
quest::say("Hello, $name, you are flagged with 1 for this quest.");}
}
$level_quest = undef;
}
}
The only possible response in this case is the flagged response. But, when I do a #reloadquest and try hailing the NPC with this quest set, the NPC doesn't respond at all.
So, to further troubleshoot this, I went to PoV where I have slightly modified the PEQ quest for access to Aerin'Dar's lair. It has flagging via quest globals and it is working perfectly. My character is flagged from that quest to have the last flag. When I hail the quest NPC in PoValor, it says "Good Luck", which is the response for having all of the flags. So, that is working properly. I then copied that NPC's quest and pasted it to my problem NPC in Nexus. When I hail that NPC, it says the initial response as if I had no flags for that quest. And to be clear, that particular quest uses global option 5 which means it should be recognized by ALL npcs in ALL zones for THIS player (me). So, basically the problem NPC in Nexus seems to not be recognizing flags at all. I even tried simplifying the PoV quest I copied to it so it only had 1 response choice. Here is basically what I had:
sub EVENT_SAY {
if ($text=~/hail/i && $pov_key_quest == 5) {
quest::say("Good Luck.");}
}
$pov_key_quest = undef;
}
}
As suspected, I still got no response from the problem NPC with this quest in place. I even tried rebooting my server to see if that might help the NPC recognize flags, but it made no difference. This same quest works fine on the PoValor NPC.
The only thing I haven't tried (but I will tonight when I get home) is to try copying the initial quest I was trying to get working on the problem Nexus NPC and pasting it to the PoValor NPC to see how it responds. I am pretty sure it would work as intended and recognize the flags.
So, as far as I can tell, the the cause seems to be something with that particular NPC in Nexus which I used #spawn to create. The NPC in PoValor is from PEQ and so is the the quest with globals that I have been using for my testing. I did modify the quest slightly on my server, since it wasn't complete in the PEQ DB. I simply reworded a few things and made the final reward easier to get.
So, is there something I am missing? Maybe there is a reason why mobs that are created using #spawn don't recognize quest globals? I know there must be something slightly different about them, because there seems to be a known issue that causes #spawn created NPCs to not always pop on repops or zone starts. I have this problem from time to time on my server, particularly in Nexus where I have all #spawn created NPCs.
So, maybe there is some setting causing these NPCs to not recognize quest globals for some reason. If anyone can look into this, it would be much appreciated. I will continue to do more testing and provide my results when I get them.