Aller au contenu

Photo

help with item adding script


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
larry77777

larry77777
  • Members
  • 6 messages
hi i made my own item set and  i used a script i found. it adds the item to the inventory  of the player on the game loading. it works fine with games created before the mod was added. but it does not work with new games.


#include "utility_h"#include "plt_my_custom_plot"
void main(){
    if ( WR_GetPlotFlag( PLT_MY_CUSTOM_PLOT, MY_ITEM_CHECK_FLAG ) == TRUE )        return;
    event ev = GetCurrentEvent();    int nEventType = GetEventType(ev);

    switch ( nEventType )    {
        case EVENT_TYPE_MODULE_LOAD:        {
            UT_AddItemToInventory(R"cousland_honor.uti", 1);            UT_AddItemToInventory(R"family_armor.uti", 1);            UT_AddItemToInventory(R"family_boots.uti", 1);            UT_AddItemToInventory(R"family_gloves.uti", 1);            UT_AddItemToInventory(R"family_helm.uti", 1);
            WR_SetPlotFlag( PLT_MY_CUSTOM_PLOT, MY_ITEM_CHECK_FLAG, TRUE );s            break;        }        default:            break;    }}

#2
Craig Graff

Craig Graff
  • Members
  • 608 messages
Are your files global, by any chance?

#3
Proleric

Proleric
  • Members
  • 2 357 messages
Is this the same problem?

I'm wondering whether character generation wipes the inventory. That would explain why these scripts work with saved games but not with new ones.

At any rate, perhaps PRCSCR would be a more reliable method?

#4
Craig Graff

Craig Graff
  • Members
  • 608 messages
Chargen does indeed wipe items most of the time. That's certainly the simplest and most likely reason this isn't working as expected.

#5
larry77777

larry77777
  • Members
  • 6 messages
yup that's the problem.



thanks

#6
larry77777

larry77777
  • Members
  • 6 messages
is there a way to force the game to reset a plot flag? (using console commands)