Aller au contenu

Photo

How to start a conversation after a fight if PC or other is unconscious?


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

#1
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

I am converting several conversations to CreateIPSpeaker, which is great and works, but it doesn't solve one problem, and that is how to ensure the conversation fires if, at the end of a fight, the PC or one of the key party members involved in the conversation is unconscious. 

 

I assume that there is some way to immediately perform a minimum-heal on everyone in the party (the thing that automatically happens after combat is over) and prep the party for a conversation, but I can't get that working. 

 

I have tried calling: 

 

ActionDoCommand(ExecuteScript("hench_o0_heal", oPC));

 

But it doesn't do anything. 

 

Hints, tips? I am sure there is a "preferred/correct/intended" way to do this, but I am at a loss as to what that method is. 



#2
kevL

kevL
  • Members
  • 4 070 messages

roughly speaking,

the IPSpeaker should make a call to MakeConversable() ( in 'ginc_cutscene' ) via AttemptIPSConversation() ( in 'ginc_ipspeaker' itself )

MakeConversable() resurrects dead partymembers, removes bad effects


have you had trouble with it? (there are some holes, but they're very small, iirc)



#3
Tchos

Tchos
  • Members
  • 5 072 messages

Something important I forgot to mention about using the IP Speaker is that you need to make sure a certain global object is set, because the system checks it to see who the party leader should be.  Then it'll do the resurrections if necessary.

 

In my case, I have this line in my on module load slot:

// set up custom ipspeaker script
    SetGlobalString(CAMPAIGN_STRING_CUSTOM_IPSPEAKER , "ka_get_party_leader");

Then, the script ka_get_party_leader:

#include "x2_inc_switches"

void main()
{
	object oPC = GetFirstPC();
	object oLeader = GetFactionLeader(oPC);

	SetLocalObject(GetModule(), CAMPAIGN_STRING_CUSTOM_IPSPEAKER, oLeader);


#4
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

roughly speaking,

the IPSpeaker should make a call to MakeConversable() ( in 'ginc_cutscene' ) via AttemptIPSConversation() ( in 'ginc_ipspeaker' itself )

MakeConversable() resurrects dead partymembers, removes bad effects


have you had trouble with it? (there are some holes, but they're very small, iirc)

 

Yeah, I see that now. I decided to start tracing through the function calls to see what CreateIPSpeaker does, and noticed that it eventually tries to make calls to MakeConversable(). 

 

Right now, it appears to not be working. My PC stays down for a little bit, then finally revives, and the conversation doesn't start. 

 

I think my next step is going to be to copy the contents of ginc_ipspeaker to a new script, append all the function names with "2", and add some additional debug statements to find out what is not being called. 

 

I have my logfile flag =1 in my .ini file, and none of the ginc_ipspeaker statements are getting written to the log. But other stuff is. 



#5
Tchos

Tchos
  • Members
  • 5 072 messages

See above, if you missed it.



#6
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

It looks like the issue is that my deathscripts for the enemies is not firing, so the IPSpeaker is never getting created when the last one dies. 

 

Looking into it. 



#7
kevL

kevL
  • Members
  • 4 070 messages

ok.

Just going to point out that if no Faction is left alive the situation appears to abort:
 

// if someone is [bPartyAlive] continue as normal, otherwise skip the rest of function
if (bPartyAlive)
{


#8
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

Got it figured out. 

 

The script that starts the fight was assigning the bad guys to a group and assigning a script to execute on GroupDeath, which was overriding my DeathScript on the individual enemies. Once I commented out the group stuff, my DeathScripts fired and it worked. 

 

CreateIPSpeaker... good stuff. 



#9
ColorsFade

ColorsFade
  • Members
  • 1 271 messages

I have to thank you Tchos, for pointing out the CreateIPSpeaker. This is going to fix a lot of issues, and make sure I have a much more stable way of doing things as I move forward. Really appreciate you pointing m in the right direction here. Big save. 



#10
Tchos

Tchos
  • Members
  • 5 072 messages

I'm glad to see more people using such a well-made tool.

 

The group death script is also useful in this situation, but is done slightly differently.  The group functions are powerful and much like the CreateIPSpeaker function, are made to do a lot of things automatically.  If I recall correctly, the reason it overrides the custom death scripts is so that it can spawn an IPspeaker of its own.