lfnetwork.com mark read register faq members calendar

Thread: Talk, fight, talk, fight, talk problem
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 05-16-2012, 09:33 AM   #1
Trex
Forumite
 
Trex's Avatar
 
Join Date: Dec 2006
Location: UK
Posts: 505
Veteran Modder 
Talk, fight, talk, fight, talk problem

Hi all.

I'm trying to put together a big duel which is in 4 parts. You fight, talk, then fight, then talk etc.

I have this this script in the utc's ScriptDamaged :

Code:
void main() {
   int nFlag = IntToFloat( GetCurrentHitPoints( OBJECT_SELF ) ) < ( 0.1 * GetMaxHitPoints( OBJECT_SELF ) );
   if( nFlag && !GetLocalBoolean( OBJECT_SELF , 10 ) ) {
      SetLocalBoolean( OBJECT_SELF, 10, TRUE );
      SetMinOneHP( OBJECT_SELF, FALSE );

CancelCombat(OBJECT_SELF);
        SurrenderToEnemies();
        ChangeToStandardFaction(OBJECT_SELF, STANDARD_FACTION_NEUTRAL);

        object oNPC=GetObjectByTag("syyth");
  location lMe=GetLocation(GetFirstPC());
    ActionDoCommand(SetCommandable(TRUE,oNPC));
  AssignCommand (oNPC, ActionStartConversation(GetFirstPC()));
   }
  
}
Which works fine, but only for the first round. After the first mid-fight conversation has happened, my baddie just keeps fighting and never turns to neutral and talks to you a second time.

How can I make this work?


KNIGHTS OF THE OLD REPUBLIC : THE JEDI MASTERS
PLAY THE TOTAL CONVERSION MOD NOW! . | If you're interested, my almighty fanfic can be read here.
Trex is offline   you may: quote & reply,
Old 05-16-2012, 09:44 AM   #2
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 557
Well, it only runs if local boolean 10 is not set. Here it's set.
Maybe if you want a second happening use another boolean number instead, and repeat the script, with different damage value...
Hassat Hunter is offline   you may: quote & reply,
Old 05-16-2012, 09:51 AM   #3
Trex
Forumite
 
Trex's Avatar
 
Join Date: Dec 2006
Location: UK
Posts: 505
Veteran Modder 
I see.

So, in theory, if I add a script into the actual conversation to reset the local boolean to false each time, it should work?

EDIT : SOLUTION FOUND

Add a little to the end of the script to reset it (using a seperate script doesn't really work)

Code:
void main() {
   int nFlag = IntToFloat( GetCurrentHitPoints( OBJECT_SELF ) ) < ( 0.1 * GetMaxHitPoints( OBJECT_SELF ) );
   if( nFlag && !GetLocalBoolean( OBJECT_SELF , 10 ) ) {
      SetLocalBoolean( OBJECT_SELF, 10, TRUE );
      SetMinOneHP( OBJECT_SELF, FALSE );

CancelCombat(OBJECT_SELF);
        SurrenderToEnemies();
        ChangeToStandardFaction(OBJECT_SELF, STANDARD_FACTION_NEUTRAL);

        object oNPC=GetObjectByTag("syyth");
  location lMe=GetLocation(GetFirstPC());
    ActionDoCommand(SetCommandable(TRUE,oNPC));
  AssignCommand (oNPC, ActionStartConversation(GetFirstPC()));
  DelayCommand(0.5, SetLocalBoolean( OBJECT_SELF, 10, FALSE ));
   }
  
}


KNIGHTS OF THE OLD REPUBLIC : THE JEDI MASTERS
PLAY THE TOTAL CONVERSION MOD NOW! . | If you're interested, my almighty fanfic can be read here.

Last edited by Trex; 05-16-2012 at 11:49 AM.
Trex is offline   you may: quote & reply,
Old 05-16-2012, 01:16 PM   #4
Hassat Hunter
Forumite
 
Join Date: Jan 2010
Posts: 557
Works, but not really dependant on HP. And the NPC can be killed before that time. I was more thinking (not using 2 scripts);

Code:
void main() {
   int nFlag = IntToFloat( GetCurrentHitPoints( OBJECT_SELF ) ) < ( 0.5 * GetMaxHitPoints( OBJECT_SELF ) );
   int nFlag2 = IntToFloat( GetCurrentHitPoints( OBJECT_SELF ) ) < ( 0.1 * GetMaxHitPoints( OBJECT_SELF ) );
   if( nFlag && !GetLocalBoolean( OBJECT_SELF , 10 ) ) {
      SetLocalBoolean( OBJECT_SELF, 10, TRUE );

      CancelCombat(OBJECT_SELF);
        SurrenderToEnemies();
        ChangeToStandardFaction(OBJECT_SELF, STANDARD_FACTION_NEUTRAL);

        object oNPC=GetObjectByTag("syyth");
  location lMe=GetLocation(GetFirstPC());
    ActionDoCommand(SetCommandable(TRUE,oNPC));
  AssignCommand (oNPC, ActionStartConversation(GetFirstPC()));
   }
  
    if( nFlag2 && !GetLocalBoolean( OBJECT_SELF , 15 ) ) {
      SetLocalBoolean( OBJECT_SELF, 15, TRUE );
      SetMinOneHP( OBJECT_SELF, FALSE );

CancelCombat(OBJECT_SELF);
        SurrenderToEnemies();
        ChangeToStandardFaction(OBJECT_SELF, STANDARD_FACTION_NEUTRAL);

        object oNPC=GetObjectByTag("syyth");
  location lMe=GetLocation(GetFirstPC());
    ActionDoCommand(SetCommandable(TRUE,oNPC));
  AssignCommand (oNPC, ActionStartConversation(GetFirstPC()));
  DelayCommand(0.5, SetLocalBoolean( OBJECT_SELF, 10, FALSE ));
   }
}
Hassat Hunter is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > Holowan Laboratories > Talk, fight, talk, fight, talk problem

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:51 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.