Then base adding the items to the game by looking for the trigger item by tag.
If the item exists, do not add anything. If the item does not exist, add all the items plus the trigger.
The possible advantage, is that if you want the items again, just delete the trigger item, save, and reload.
If you are a mod creator and don't want the naughty players to do this, mark the item as a plot item.
At the end is the script to use for the module's script
If you follow one of the add item mod tutorials, like
http://social.biowar.../5339/blog/576/
or
http://dragonagemodd...player-an-item/
You would still follow the same basic steps.
- Create the Module
- Create Your Items plus the Trigger Item - any item can then be used as a trigger
- Write the Script
- Export
- Play
Everything is based on the single script plus the trigger item.
There has to be a better event to use than EVENT_TYPE_MODULE_LOAD
This event fires on a new game before the character exists, so the script will not add the items to the character until that game is saved and reloaded.
Then on the first load from a save, the items will be added.
#include "utility_h"
#include "wrappers_h"
#include "events_h"
#include "log_h"
/*
If you want an item that can't be destroyed, so the player cannot keep
getting new gear, just mark the item as a plot item.
*/
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
object oTriggerItem = GetObjectByTag("myid_trigger_item_01", 0);
switch(nEventType)
{
case EVENT_TYPE_MODULE_LOAD:
{
PrintToLog("*****************************");
PrintToLog("EVENT_TYPE_MODULE_LOAD seen.");
PrintToLog("*****************************");
if (oTriggerItem == OBJECT_INVALID)
{
PrintToLog("*****************************");
PrintToLog("We can't find the trigger, so add a new one. PLUS");
PrintToLog("Add all the cool stuff we wanted.");
PrintToLog("*****************************");
UT_AddItemToInventory(R"myid_trigger_item_01.uti");
UT_AddItemToInventory(R"gen_im_arm_cht_mas_jug.uti");
//use this as a template to add add item calls
// just paste the tag in before '.uti"'
//UT_AddItemToInventory(R".uti");
}
}
}
}





Retour en haut






