also, I have a couple of mods that are already adding things to Bodahn's Inventory, if that matters.
// ---- SCRIPT STARTS HERE ----
// Later on in this script,
we will use the UT_AddItemToInventory()
// function to add an item
to the player's inventory.
// But before we could use it, we have to
tell the toolset where
// to look for it. The function is in the
"utility_h" script file
// under _Core Includes, we will include this
file at the top of
// our script file, above the main function.
#include
"utility_h"
#include "plt_my_custom_plot"
void main()
{
// If our plot flag is set to TRUE, that means we have already
// given the items to the player, there is no need to continue
// running this script.
if ( WR_GetPlotFlag( PLT_MY_CUSTOM_PLOT,
MY_ITEM_CHECK_FLAG ) == TRUE )
return;
event ev =
GetCurrentEvent();
int nEventType = GetEventType(ev);
// We will watch for every event type and if the one we need
//
appears we will handle it as a special case. We will ignore the rest
// of the events
switch ( nEventType )
{
//
This event happenes every time the module loads
// This
usually happenes when creating a new game
// or loading a
savegame
case EVENT_TYPE_MODULE_LOAD:
{
// The UT_AddItemToInventory function adds various resources to a
// creature's inventory. Here we add one weapon and one
shield.
UT_AddItemToInventory(R"my_custom_weapon.uti",
1);
UT_AddItemToInventory(R"my_custom_shield.uti", 1);
// Set our plot flag to TRUE, so the next time this script
tries
// to run it will not add extra items to the
player's inventory
WR_SetPlotFlag( PLT_MY_CUSTOM_PLOT,
MY_ITEM_CHECK_FLAG, TRUE );
// We have dealt with the
event we were waiting for.
// At this point we can stop
looking for other events
break;
}
default:
break;
}
}
// ---- SCRIPT ENDS
HERE ----





Retour en haut







