PDA

View Full Version : Quest script handling


Lillu
03-29-2010, 06:31 PM
As part of a quest line, we have a npc that might apper in different zones (zone A and B), and has different scripts in the different zones (script X in zone A and script Y in zone B).

Today our players triggered the npc in zone A and B the same time however the npc gave script Y in zone A too (instead of script X).

Is this a bug or a simply "work as intended" how scripts are loaded into memory and are bound to an npc? If so, is there any workaround?

Any help would be appreciated.

ChaosSlayerZ
03-29-2010, 08:16 PM
basing off my experienced its based on npc id.

You have zone A, and npc B with id 1001, and a script attached to him.

If you spawns this npc in ANY other zone, where he doesn't have a default script for THAt zone, the script from zone A will trigger. (if it does have a separate script per zone, and still triggers wrong scripts- then I don't know what is wrong)

The BEST way to avoid this issue, is have similarly named npc in the other zone under different ID, and assign script to np ID rather than his name. (1002.pl instead of John.pl)

I may however be wrong on all accounts =)

nenelan
03-29-2010, 10:03 PM
I have seen the same thing. It is rather confusing to say the least, as it is intermittent at best. Also there's issues trying to use default.pl, and I've also noticed that more than 500 quests active in one zone makes some just stop working or not work at all.

As ChaosSlayer said, make a new npc, and rather than A_Quest_Giver.pl, use the NPCID#.pl. Sometimes it will work with the name, but, it is not a guaranteed solution. If you MUST use names, add some numbers in the name, as that will distinguish it. Trakanon_1, Trakanon_2, #Trakanon. The underscore, the pound, and the numbers get parsed out in displaying, but it does signify a unique mob for scripts, and you won't get that nasty crossover.

Lillu
03-30-2010, 03:01 AM
# and numbers are perfect ideas! Thanks :)

Aeolwind
03-30-2010, 08:27 PM
I'm going to assume you are using global variables for this. If that is the case you may want to use different variable values and have your watchers scan for specific values of said variable instead of the variable itself.

Does that make sense?

Lillu
03-31-2010, 09:25 AM
No, the npc might spawn in zone A when another npc is killed or in zone B when a specific zone instance is booted up. The issue is what I described in my first post, but spawning a different npcid with the same name (with #) works perfectly as workaround.

Thanks for the replies.