Aller au contenu

Photo

Can't find an old post...start conversation at 1 hp?


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

#26
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
It doesnt work

#27
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages

Modifié par Eguintir Eligard, 27 août 2013 - 03:58 .


#28
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
This is the best I could come up with so far. The conversation node that begins after the talk NEEDS to be set to infinite repeat (as in not one time only).

I can get conversations to start problem is they often get broke on the first node. By repeating, you can restart the conversation. This can account for late cheap shots in the fight. But on the other hand this basically throws a series of delayed conversation starts at the user, which gets choppy fast if its more than once so you have to set the constant value COUNT_MAX accordingly.

Now you'll notice I commented out the two lines that checked if the OWNER or PLAYER were
in conversation... why? Because they are total crap that give a false no matter what.

For example if the conversation is open and I can see it in game, our talk has begun. But both the NPC and Player obviously show a negative because it will loop through again and then violently restart the conversation. The only thing that ever stops the loop is the count limit being reached. Maybe it's because the engine instantly creates all the delayed conversations, Im guessing thats why. But regardless even if it didn't like I said, a late cheap shot breaks conversations so I pretty much have to force restart it a few times. But hey why should anything work right in this shoddy toolset all the sudden?

This goes in the on damaged event of the creature.


// This on damaged function causes the creature to cease combat, and switch to neutral faction, and converse
// Eguintir Eligard, Aug 2013 * * * * *
//*
#include "ee_debug"
#include "ginc_param_const"

void main()

{
string sTalk = GetLocalString(OBJECT_SELF, sTalk); // optional conversation tag
object oPC = GetFirstPC(FALSE);
object oNext = GetFirstFactionMember(GetFirstPC());
object oFaction = GetObjectByTag("ip_describer");  // assumes invisible man with neutral faction of this tag name
effect ePause = EffectEthereal(); // Pause so we can remove this creature from combat
effect eHold = EffectCutsceneParalyze();
effect eInvis = EffectInvisibility(INVISIBILITY_TYPE_IMPROVED); // used to test if effects work or not
float rDelay = 1.0f;
int iCount = 0; 
int COUNT_MAX = 5; // # of conv attempts and delay increments each time based on this value * .25 seconds
// Adjust accordingly as this will restart a failed conversation but will also restart one in progress which
// can get choppy if repeated too much

int iHP = GetCurrentHitPoints(OBJECT_SELF);

if (iHP < 5) // do the process of ending combat without death
	{
	DBT("Hit points < 5, initiating combat end/clear...");
	AssignCommand(OBJECT_SELF, ClearAllActions(TRUE) );
	ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePause, OBJECT_SELF, 7.0f);
	ChangeFaction(OBJECT_SELF, oFaction);	
	
	// START do - calm the combatants
	do	{		
		DBT("Paralysing party member " + GetName(oNext) );
		AssignCommand(oNext, ClearAllActions(TRUE) );
		ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePause, oNext, 1.5f);				
		ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHold, oNext, 1.5f);				
		AssignCommand(oNext, ClearAllActions(TRUE) );
		oNext = GetNextFactionMember(oPC, FALSE);
		} while (GetIsObjectValid(oNext) );
	// END do
	// try to converse until sucess now that battle is paused/cleared	
	DBT("Attempt conv..");
	
	// START do - Conversation attempts
	do {	
		rDelay = 1.25 + (0.25 * IntToFloat(iCount) );
		DBT("Attempt made # and delay: ", iCount, rDelay);
		// NEVER WORKS SO COMMENTED OUT if (IsInConversation(OBJECT_SELF)==FALSE) // skip this round if NPC is talking
		DelayCommand(rDelay, ActionStartConversation(oPC, sTalk, FALSE, FALSE, TRUE, TRUE) );
		iCount++; 
		// continue to keep retrying in case NPC was in a talk but it was interrupted by late combat
		// movements
		// ** NEVER WORKS SO COMMENTED OUT if (IsInConversation(oPC)==TRUE) return; // stop immediately if it worked
		} while (iCount < COUNT_MAX);
	// END do
	
	} else ExecuteScript("nw_c2_default6", OBJECT_SELF); // use regular script otherwise if object healthy
	


}


#29
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
http://pastebin.myrror.net/3455

#30
andysks

andysks
  • Members
  • 1 645 messages
If I remember correctly Leldon starts talking when he's down. The script that is used is the same that Kaldor wrote here, although it has a comment that I don't know how important it is.

// JYL 06/18/05 Altered this so that the PC starts the conversation with himself. Special case for Leldon.

#31
diophant

diophant
  • Members
  • 116 messages
Edit: Oops, sorry, mispost. Just ignore this.

Modifié par diophant, 27 août 2013 - 06:00 .


#32
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 585 messages
I'm pretty certain my script works just fine or at least did when tested back in 2009. The spawn script sets the conditions for the ud script to be used. The scripts are in my King's Festival campaign which can be downloaded from the Vault.

Personally I don't let my frustration lead to pissing on people who are trying to help. But y'know that's just me.

Use it or don't. I don't care. I just offered it.

Regards

#33
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
Where did I ****** on anyone? The script didn't work and I reported it as such.

Save the drama for the WoW forums please.

#34
Tchos

Tchos
  • Members
  • 5 030 messages

andysks wrote...

Is this thread closed? If so, may I ask how the script that Kaldor posted is handled? Is it an OnDamage event or it requires something more?


First, you attach gb_surrender_sp to the creature's On Spawn event.  This is a standard script that comes with the game.  The only important thing that this script does is this line:

    // * Fire User Defined Event 1006
    SetSpawnInCondition(NW_FLAG_DAMAGED_EVENT);

That can be done in other ways if you don't want to use this spawn script.

The second step is to attach Kaldor's script to the creature's On User Defined event.

Modifié par Tchos, 28 août 2013 - 08:53 .


#35
andysks

andysks
  • Members
  • 1 645 messages
Works fine. I just wanted to say that, once you have a question, you go to the forums. Sometimes the problem is not solved immediately but you should keep your calm and try to find the solution with the people that are trying to help you. I never saw swearing and stuff like that on this forum, and this is quite rare in the gaming community these days. Please keep it like that.

Oh and thanks Kaldor and Tchos for a solved problem that was giving me a headache for quite some time.( I knew Leldon surrendered to me, I just didn't know how! :) )

Modifié par andysks, 28 août 2013 - 02:44 .


#36
Eguintir Eligard

Eguintir Eligard
  • Members
  • 1 832 messages
Is this some kind of joke between you and Kaldor that no one else gets? Where did anyone "lose their calm" or swear?