Aller au contenu

Photo

Another How do I do: Rewards


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

#1
pizzapicante

pizzapicante
  • Members
  • 122 messages
So I want an Npc to give the player an item at the end of a conversation I assume I can do this through a plot, but when i check the wiki it says some hazy thing about exporting the Rewards.xls or the rewards.2DA (which I dont know where they are), to my export folder (I assume the tosetexport of my module file), the image of http://social.biowar...php/Rewards.xls doesnt correspond to the one Im shown in the toolset and Im kinda confused, can someone help me?
Note: Im a noob so if anyone is going to post a script-based solution can it a step by step solution, please?

Thanks again.

#2
Karma

Karma
  • Members
  • 391 messages
You can give out items either through scripting or through the rewards system. If you just want to give an item, it'll probably be easier to use a plot script. If you want to give out experience as well, it'll probably be easier to use the rewards system.

To add an item to inventory via scripting, add the following line to your plot script under whichever plot flag you want.
UT_AddItemToInventory(R"insert_name_here.uti", 1);

#3
pizzapicante

pizzapicante
  • Members
  • 122 messages
Doesnt do anything, this is what the script looks like:
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "plt_get_your_brother"

//#include "PLOT_NAME_GOES_HERE"

int StartingConditional()
{
event eParms = GetCurrentEvent();
// Contains all input parameters
int nType = GetEventType(eParms); // GET or SET call
string strPlot = GetEventString(eParms, 0); // Plot GUID
int nFlag = GetEventInteger(eParms, 1); // The bit flag # being affected
object oParty = GetEventCreator(eParms); // The owner of the plot table for this script
object oConversationOwner = GetEventObject(eParms, 0); // Owner on the conversation, if any
int nResult = FALSE; // used to return value for DEFINED GET events
object oPC = GetHero();

plot_GlobalPlotHandler(eParms); // any global plot operations, including debug info

if(nType == EVENT_TYPE_SET_PLOT) // actions -> normal flags only
{
int nValue = GetEventInteger(eParms, 2); // On SET call, the value about to be written (on a normal SET that should be '1', and on a 'clear' it should be '0')
int nOldValue = GetEventInteger(eParms, 3); // On SET call, the current flag value (can be either 1 or 0 regardless if it's a set or clear event)
// IMPORTANT: The flag value on a SET event is set only AFTER this script finishes running!
switch(nFlag)
{


}
}
else // EVENT_TYPE_GET_PLOT -> defined conditions only
{

switch(nFlag)
{
case AXE_REWARD:
{
UT_AddItemToInventory(R"kondrat_axe.uti", 1);
break;
}

}

}

plot_OutputDefinedFlag(eParms, nResult);

return nResult;
}

Also 2 other questions, what does the RewardItem function does? every time I try to use it it gave a compiler warning of:
"Unknown state in compiler"

And in the wiki where is the rewards.xls that Im supposed to move to the export folder of my module: http://social.biowar...t_event_scripts

#4
pizzapicante

pizzapicante
  • Members
  • 122 messages
It compiles correctly by the way

#5
Proleric

Proleric
  • Members
  • 2 350 messages
The item creation case needs to be in the "set flag" section of your script. You have it in the "get flag" section.

Personally, I prefer to use the rewards 2DA in all such cases, not least because the script is tried and trusted.

The wiki tells you where to find the spreadsheet rewards.xls.

The table contents are described here.

When you've updated a copy of the spreadsheet, this article explains how to get it into the game (sounds complicated, but boils down to two clicks).

As noted here, you can then edit your plot flag in the toolset - your reward appears in the dropdown list in the Reward field.

This is really very simple (once you've grasped the basic technique of using 2DA files, which is required for most DAO configuration tasks).

#6
Karma

Karma
  • Members
  • 391 messages
RewardItem(), RewardXP(), and RewardMoney() basically do just as the name suggests. They reward the given person the item/XP/money specified. If you prefer scripting over 2da, you could use those functions as well. I suspect it's not compiling because you don't have the required include listed at the top. (I think you need to include sys_rewards_h.)

The rewards.xls is mostly likely found in ...\\Program Files\\Dragon Age\\tools\\Source\\2DA

As a side note:
The EVENT_TYPE_SET_PLOT section is where your main flags go, and the EVENT_TYPE_GET_PLOT section is where your defined flags go.

A side question for anyone:
I read somewhere that using the rewards 2da system doesn't give out the proper amount of XP. Is that true?

Modifié par satans_karma, 06 juillet 2011 - 02:36 .


#7
Proleric

Proleric
  • Members
  • 2 350 messages

satans_karma wrote...

...I read somewhere that using the rewards 2da system doesn't give out the proper amount of XP. Is that true?


For some reason, the rewards system gives exactly half the XP specified in the 2DA. So, you simply have to specify twice the XP you actually want to award. This is documented here.

Modifié par Proleric1, 06 juillet 2011 - 04:50 .


#8
yhana

yhana
  • Members
  • 1 messages
Personally, wanted to tell all the viewers that if you have time, please take a look at the website I have here. Im sure you'll think of it.

violin tutor

Modifié par yhana, 07 juillet 2011 - 02:29 .