I need an event to trigger as soon as a plot flag is set.
#1
Posté 29 janvier 2010 - 06:54
The split second a specific plot flag is set, I need to know and instantenously respond with certain actions.
How can I achieve this? I have knowledge of overriding events but I failed when it came to overriding EVENT_TYPE_SET_PLOT
#2
Posté 29 janvier 2010 - 07:04
Then, create an event handler like so
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "plt_NAME_OF_PLOT_FILE"
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)
{
case NAME_OF_PLOT_FLAG:
{
// DO SOME SCRIPTING HERE
break;
}
}
}
return nResult;
}
Substitute in NAME_OF_PLOT_FILE and NAME_OF_PLOT_FLAG.
So, whenever NAME_OF_PLOT_FLAG is set, you do some scripting.
Modifié par Bibdy, 29 janvier 2010 - 07:07 .
#3
Posté 29 janvier 2010 - 07:21
This sounds too good to be true, certainly there is some type of catch?
You're saying as soon as the plot flag is set, let's say from a conversation that those script actions will INSTANTLY take place?
Modifié par JackFuzz, 29 janvier 2010 - 07:29 .
#4
Posté 29 janvier 2010 - 11:21
JackFuzz wrote...
so essentially we are replacing plot_core for my custom plot which is ok?
This sounds too good to be true, certainly there is some type of catch?
You're saying as soon as the plot flag is set, let's say from a conversation that those script actions will INSTANTLY take place?
Yes
#5
Posté 29 janvier 2010 - 04:23
JackFuzz wrote...
so essentially we are replacing plot_core for my custom plot which is ok?
This sounds too good to be true, certainly there is some type of catch?
You're saying as soon as the plot flag is set, let's say from a conversation that those script actions will INSTANTLY take place?
Exactabingo.
#6
Posté 29 janvier 2010 - 11:35
Bibdy wrote...
JackFuzz wrote...
so essentially we are replacing plot_core for my custom plot which is ok?
This sounds too good to be true, certainly there is some type of catch?
You're saying as soon as the plot flag is set, let's say from a conversation that those script actions will INSTANTLY take place?
Exactabingo.
This is working great. Thanks for your help.





Retour en haut







