// ---- 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_armor_bow.uti", 1);
UT_AddItemToInventory(R"my_armor_.uti", 1);
UT_AddItemToInventory(R"my_armor_boots.uti", 1);
UT_AddItemToInventory(R"my_armor_gloves.uti", 1);
UT_AddItemToInventory(R"my_armor_ring", 1);
UT_AddItemToInventory(R"my_armor_tunic.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 ----
Is this a right script? By the way demo is the weapon, been practicing.
However, there is also another problem, when i do Export - Export without dependent variables, it says in the log that there was "No area specified for campaign". I have tried almost everything to get rid of the error but it just sticks there
Can someone please help me on these matters, btw im quite new to Toolset





Retour en haut






