Aller au contenu

Photo

Plot script issues/questions


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

#1
st4rdog

st4rdog
  • Members
  • 104 messages
I'm having issues adding an item to my inventory. I can complete the quest I've made fine, but the sword is never added/removed. When SPOKEN_JOHN is flagged in the convo it doesn't add anything.

Is this script always there in the background? When/how does it get fired?

I could just add a script to the conversation line, but that's not how the Demo does it. Here's what I have:

#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"

#include "plt_rtb_plot1" // my plot

#include "rtb_script_constants" // FATHERS_SWORD_R constant etc


int StartingConditional()
{
event eParms = GetCurrentEvent();
int nType = GetEventType(eParms);
string strPlot = GetEventString(eParms, 0);
int nFlag = GetEventInteger(eParms, 1);
object oParty = GetEventCreator(eParms);
object oConversationOwner = GetEventObject(eParms, 0);
int nResult = FALSE;
object oPC = GetHero();

plot_GlobalPlotHandler(eParms);

if(nType == EVENT_TYPE_SET_PLOT)
{
int nValue = GetEventInteger(eParms, 2);
int nOldValue = GetEventInteger(eParms, 3);

switch(nFlag)
{

case SPOKEN_JOHN:
{
if (!WR_GetPlotFlag(PLT_RTB_PLOT1,SPOKEN_JOHN))
{
UT_AddItemToInventory(FATHERS_SWORD_R);
break;
}
}

case SWORD_RETURNED:
{
UT_RemoveItemFromInventory(FATHERS_SWORD_R);

break;
}

}
}
plot_OutputDefinedFlag(eParms, nResult);

return nResult;
}


Modifié par st4rdog, 16 novembre 2009 - 07:06 .


#2
st4rdog

st4rdog
  • Members
  • 104 messages
Anyone know? It must be something simple.

#3
Astorax

Astorax
  • Members
  • 324 messages
That script is on a conversation line, no?

#4
st4rdog

st4rdog
  • Members
  • 104 messages
Doh. It was the "!WR_GetPlotFlag"



! means NOT of course (I'm no C++ genie). I don't get how I did that when I was copying the demo code. Anyhow...