perl quest variables mess
it has to do with the perl quest variables that are set for quests; i don't think it happens in qst format, though there might be similarities.
In short : variables ($text, $name, $charid,...) are set accordingly for an event, but not reset. e.g. you might be processing an EVENT_DEATH, but still get $text pertaining to a previous say to this npc (or event another one), by the same or other player. This discrepancy is shared by all events (it's perl related), and may or may not be harmful (it IS harmful for default.pl quest, or if you are using global variables) example : A says 'hail may name is A' to NPC, then leaves . B comes around, and gives item #1001. $text is 'hail my name is A. B leaves, and C comes around. $text, $itemxxxx still set. C has a global var enabled "killed_brother" to "true" on this NPC. C speaks (overrides $text), and NPC reacts attacking C as the quest was designed for. Then D comes around, having never killed anyone. D says 'Hail', and immediatly gets attacked, because "killed_brother" was still set to true. the guts : the embparser stores quests in packages, one for each NPC (qst1234), and one (qstdefault) for quests that don't. When an event is triggered, variables are set in the package. Then an other event, variables are set again. But only the variables that are valid/known in the time of the event are set. Different events - differents variables. Thus some variables keep the values set in event #1. i can't think of any fix at the moment, just wanted to get a feedback. This is really a pain somewhere imho :evil: , but some might think it's just usable undocumented feature :) |
hmm
is there no way to have the variables set back to defaults after a duration?
or were you championing induvidual variables for each player char? *whoosh* most of that went about 19 inches over my head |
There are two possible solutions that come to mind:
1. Have a list of all the variables that are defined prior to perl call. After the perl call, create a variable (a new perl script) that undefines these variables for the package. 1a. Keep moving variables to getVariable (ala getItemName) functions. Less undefines to do. 2. After a perl call is done, delete the package, and reload it. If I recall correctly, though, there are problems with deleting packages because of possible dependencies, etc. However, I seem to remember a safe_delete call in some perl docs somewhere. Not recommending this.. just another option. |
does the qglobal variables work well for you ?
I have big problems with it |
All times are GMT -4. The time now is 09:06 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.