Aller au contenu

Photo

Addin for Single Player fires only once.


1 réponse à ce sujet

#1
Aslend

Aslend
  • Members
  • 63 messages
I followed a tutorial on how to create and Addin for the Single Player Campaign, and after starting a new game it works only once. I am thinking the plot flag is staying set. Here is the script, any assistance would be greatly appreciated.
[b]
event handler script
#include "utility_h"
#include "wrappers_h"
#include "plt_makers_set_plot"
void main()
{
    if ( WR_GetPlotFlag( PLT_MAKERS_SET_PLOT, MAKERS_SET_CHECK_FLAG ) == TRUE )
    return;
    event ev = GetCurrentEvent();
    int nEventType = GetEventType(ev);
    switch ( nEventType )
    {
    case EVENT_TYPE_MODULE_LOAD:
    {
            UT_AddItemToInventory(R"makers_hat.uti", 1);
            UT_AddItemToInventory(R"makers_light_armor.uti", 1);
            UT_AddItemToInventory(R"makers_light_hat.uti", 1);
            UT_AddItemToInventory(R"makers_light_slippers.uti", 1);
            UT_AddItemToInventory(R"makers_longsword.uti", 1);
            UT_AddItemToInventory(R"makers_med_armor.uti", 1);
            UT_AddItemToInventory(R"makers_shield.uti", 1);
            UT_AddItemToInventory(R"makers_slippers.uti", 1);
            UT_AddItemToInventory(R"makers_sting.uti", 2);
            UT_AddItemToInventory(R"makers_wand.uti", 1);
            UT_AddItemToInventory(R"makers_med_touch.uti", 1);
            UT_AddItemToInventory(R"makers_light_touch.uti", 1);
             WR_SetPlotFlag( PLT_MAKERS_SET_PLOT, MAKERS_SET_CHECK_FLAG, TRUE );
          break;
        }
        default:
            break;
    }
}
Posted Image

#2
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
What exactly is the problem? That seems like the kind of code you wouldn't only want to run once. Is the problem that it's only running once per game, or somehow that it's only running once even if you start a new character? If it'sthe former, how often/when do you want it to load? That would determine what event to move it to, and the plot flag would have to be removed. If it's the latter, then that is very unusual behavior.