plot flag firing too soon
#1
Geschrieben 18 Oktober 2014 - 02:52
one of my flags is being a little witch.
belumir is supposed to be
deactivated when the quest is
complete but instead he is
deactivating while you're still talking
to him the first time. here's the
script. seems fairly straight forward.
its flagged in dialog when youre
supposed to return to denerim but it
isn't waiting. I've checked a dozen
tomes to make certain I'm not
accidentally calling it too soon but
everything looks correct.
#include "log_h" #include "utility_h"
#include "wrappers_h" #include
"plot_h" #include "lh_quest_
constants" #include "lh_quest_h" #
include "plt_lh_alistair_quest"
int StartingConditional() {
event eParms = GetCurrentEvent();
int nType = GetEventType(eParms);
string strPlot = GetEventString
(eParms, 0);
int nFlag = GetEventInteger(eParms,
1);
object oParty = GetEventCreator
(eParms);
object oConversationOwner =
GetEventObject(eParms, 0);
int nPlotType = GetEventInteger
(eParms, 5);
int bIsTutorial = GetM2DAInt(TABLE_
PLOT_TYPES, "IsTutorial", nPlotType);
int bIsCodex = GetM2DAInt(TABLE_
PLOT_TYPES, "IsCodex", nPlotType);
int nResult = FALSE;
object oPC = GetHero();
object oWren = GetObjectByTag
("lhqftr_wren");
object oBelumir = GetObjectByTag
("lhqftr_belumir");
plot_GlobalPlotHandler(eParms);
if(nType == EVENT_TYPE_SET_PLOT)
{
int nValue = GetEventInteger(eParms,
2);
int nOldValue = GetEventInteger
(eParms, 3);
switch(nFlag)
{
case LH_ALISTAIR_ACCEPTED_
REQUEST:
{
WR_SetPlotFlag(PLT_LH_ALISTAIR_
QUEST, LH_ALISTAIR_ACCEPTED_
REQUEST, TRUE);
}
case LH_ALISTAIR_CLEAR_PARTY:
{
SetPartyPickerGUIStatus(PP_GUI_
STATUS_USE);
ShowPartyPickerGUI();
}
case LH_ALISTAIR_PARTY_SET:
{
WR_SetWorldMapLocationStatus
(GetObjectByTag(WML_WOW_
CUSTOM_1), WM_LOCATION_ACTIVE)
;
}
case LH_ALISTAIR_TEAM_4:
{
if (WR_GetPlotFlag(PLT_LH_
ALISTAIR_QUEST, LH_ALISTAIR_
RETURN_TO_BELUMIR) == TRUE)
{
WR_SetPlotFlag(PLT_LH_ALISTAIR_
QUEST, LH_ALISTAIR_TALK_WREN,
TRUE);
}
}
case LH_ALISTAIR_RETURN_TO_
BELUMIR:
{
if (WR_GetPlotFlag(PLT_LH_
ALISTAIR_QUEST, LH_ALISTAIR_
TEAM_4) == TRUE)
{
WR_SetPlotFlag(PLT_LH_ALISTAIR_
QUEST, LH_ALISTAIR_TALK_WREN,
TRUE);
}
}
case LH_ALISTAIR_TALK_WREN:
{
UT_Talk(oWren, oPC);
}
case LH_ALISTAIR_RETURN_
DENERIM:
{
DoAreaTransition("lh_denerim_
chantry", "lh_wp_chantry_enter");
}
case LH_ALISTAIR_QUEST_
COMPLETE:
{
SetObjectActive(oBelumir, FALSE);
}
}
}
else
{
switch(nFlag)
{
}
}
plot_OutputDefinedFlag(eParms,
nResult);
return nResult; }
#2
Geschrieben 18 Oktober 2014 - 10:12
I know you are constrained by your internet service and device, but this is incredibly hard to read. I would try to solve this in multiple steps....
1) Remove variables that aren't needed. There are several variables that you seem to have initialized, but never used (ex. blsTutorial, blsCodex). Having extra/unused variables makes it more challenging to figure out what is going wrong especially when the formatting is messed up by technology. If you plan the variables for future use, then comment them out and delete them if you end up not using them.
2) Remove any includes that aren't needed. This is an efficiency issue and for someone trying to help you debug, it spends what few brain cells I have on includes that aren't needed ![]()
3) break; I use it a lot. Maybe it isn't needed, but investigate the command and use where appropriate. Again MAY NOT BE APPROPRIATE IN THIS SCRIPT. but looking at other plot scripts, I think it is.
4) Remove any code that isn't needed. Near the bottom of the script: else{ switch {} } Yes, I know that Bioware devs did it, but they were also working as a team and may have left extra code for future use that they never needed.
This should give you a clean script to work with that is easier to debug. Adding break; may also resolve the problem. I have had many strange things happen when I've forgotten a break;
From there.... I'm GUESSING that this is a plot script and you're not calling it from the dlg. The other part of the equation is the dlg file. If you are setting a flag (whether you intended to or not) in the dlg file, this script may be running before you intended it to.
I'll try to help if the revised version doesn't work, but I'm not the best at reading scripts to figure out what doesn't work. I usually have to comment out sections, test, revise, test, (swear copiously), revise, test, sleep on it, revise, test repeat until resolved.
But that is just me. ![]()
- luna1124 gefällt das
#3
Geschrieben 18 Oktober 2014 - 06:47
- luna1124 gefällt das
#4
Geschrieben 20 Oktober 2014 - 07:53
- MerAnne und luna1124 gefällt das





Nach oben







