Aller au contenu

Photo

Initiating combat in dialogue?


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

#1
Balumpus

Balumpus
  • Members
  • 5 messages
So I've figured out how to add a player to the group through the plots and scripting / action tab (GEN_HIRE_FOLLOWER)  but  cannot figure out how to have a creature attack the pc this way (have tried HEN_GO_HOSTILE and GEN_OWNER_TURNS_HOSTILE to no avail).

Or do I need to make a script for this?

Your help pointing someone just learning the basics to this toolset in the right direction would be greatly appreciated.

#2
avantoreon

avantoreon
  • Members
  • 115 messages
I wasn't able to get it to work perfectly using any of the generic scripts. But what you can do is set up your own plot flag and script to handle it---this is how, for example, the bandits go hostile in the demo module.



Maybe something like this:

-------------------------------------------

#include "log_h"

#include "utility_h"

#include "wrappers_h"

#include "plot_h"



#include "plt_yourplot"







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 MAKE_TEAM_HOSTILE:

{

//This causes all members of the bandit's "team" (the bandit and

//the other bar patrons) to turn hostile. Since they're in the presence

//of the player already, they'll immediately percieve him and initiate

//combat.

UT_TeamGoesHostile(101);

break;

}





}

}

else // EVENT_TYPE_GET_PLOT -> defined conditions only

{



}



plot_OutputDefinedFlag(eParms, nResult);



return nResult;

}

#3
Balumpus

Balumpus
  • Members
  • 5 messages
I was looking at the scripts in the demo module as well, but I never would have been able to take out what I needed correctly like that, many thanks!



So after plugging in my plot and flag names, setting this as the area script, setting the creatures to team 1, compiling and exporting everything again, my creature team still does not go hostile. The flag sets in the conversation, but nothing. Somewhere I am missing something...

#4
Suikoden

Suikoden
  • Members
  • 158 messages
Make a script for SetGroupHostility and trigger it through a conversation - way easier then writing a massive plot.

#5
Ashmaran

Ashmaran
  • Members
  • 52 messages
I've had success triggering a simple script via a conversation node action.



In my script I used UT_CombatStart to get the action happening:



UT_CombatStart(object oAttacker, object oTarget, int bTargetSelectionOverride = FALSE, int nOverridePermanent = FALSE)



Make sure you include utility_h to get it to work.

#6
avantoreon

avantoreon
  • Members
  • 115 messages
@Balumpus--- the team that goes hostile in my script is team # 101.



UT_TeamGoesHostile(101);

#7
Balumpus

Balumpus
  • Members
  • 5 messages
Wow, finally figured out that I needed to look in the object inspector for my plot and change the script there instead of replacing area script and then it worked like a charm.



Should have figured that out a day ago, but right now I'm gald I can move on.



Appreciate your help avantoreon.