Jump to content

Having issues with the Rewards.xls


Recommended Posts

So I wanted to find a way to trigger items via plot for some companion upgrades (kind of like how Zeveran gets to wear 2 of his gifts), and I found Rewards.xls. Problem is for one plot it is giving the item in duplicate (ALISTAIR_GIVEN_AMULET) and another plot (I used LOT_DONALL_RECEIVES_LOCKET) just one as it should. Then for a side project I tried to double the experience in an event (PRE_JOINING_RITUAL_COMPLETE 2500 -> 5000) but it didn't (but I think it may have added 250 more? smh).

 

Is there a reason it is finicky or am I missing something?

 

Short and the long trying to have:

 

genpt_alistair_events.plo -> ALISTAIR_EVENT_GIVEN_MOTHERS_AMULET -> ALISTAIR_GIVEN_AMULET -> item reward: alistairs_mothers_amulet.uti

 

But every time no matter what item I have it's x2

Link to comment
Share on other sites

  • 2 weeks later...

I'm guessing it's because that flag (ALISTAIR_EVENT_GIVEN_MOTHERS_AMULET) is invoked twice in the dialogue with Alistair. Once to check if it's true, another to clear it. In the case with Donall the reward flag SIR_DONALL_GIVE_REWARD is called only once.

 

This explanation appears consistent with the fact that other similar rewards - Duncan's Shield, Zevran's Gloves/Boots - are not attached to the reward table. They are all handled in the character's main plot script where the items are spawned then immediately equipped.

Edited by DLuf
Link to comment
Share on other sites

Take a look at werikk's Custom Items tutorial; that's a very good primer on granting items, with a script that can be easily adapted to hook to 'milestone' plot points for granting quest rewards. (Originally on old!BSN, the tutorial has been archived here.)

 

I can't script to save my life, but I used the script below to add an item as a plot milestone reward:

 

 

// ---- 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_tsm_shield_plot"
#include "plt_pre100pt_generic"
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_TSM_SHIELD_PLOT, TSM_SHIELD_CHECK_FLAG ) == TRUE )
return;

// The Warden has completed the meeting, so continue to give shield
if( WR_GetPlotFlag( PLT_PRE100PT_GENERIC, PRE_GENERIC_STRATEGY_MEETING_END )
== FALSE )
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 Alistair's ring.
UT_AddItemToInventory(R"tsm_kings_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_TSM_SHIELD_PLOT, TSM_SHIELD_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 ----

 

 

I used basically the same script for this mod, and this one... you can even see the commented out references to a 'ring' that became a shield when I reused the script. (Feel free to pull the mods apart to look at the scripting, etc... I'm pretty sure I packed the NSS - uncompiled script - files for that very purpose. Also, take a look at rak72's mods here on the Nexus; she has several mods that grant items at plot points, and IIRC, they all include the plain text NSS files allowing the perusal of the uncompiled script.)

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...