Author Topic: NPC Surrender  (Read 318 times)

Legacy_eucletes

  • Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
NPC Surrender
« on: June 21, 2013, 05:36:40 am »


               Hi All,

I have a faction called "orcs" the global flag is set. They are initially hostile. When the orc leader is down to 25% of its max HP, I try to stop the orc leader and his faction members from attacking,by setting his faction to 80. Problem is I have henchman and they keep attacking. I thought they shared the same faction as the PC.

Any advise on how to stop the entire fight and go into conversation with the orc leader?

Regards.

One more thing I'm doing this in the EVENT_END_COMBAT_ROUND.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
NPC Surrender
« Reply #1 on: June 21, 2013, 05:01:51 pm »


               One thing you could try would be to turn all the Orcs plot at that point, or even all combatants temporarily.  There are other approaches such as setting temporary friend etc...but the plot idea seems easiest.
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
NPC Surrender
« Reply #2 on: June 21, 2013, 09:21:15 pm »


               ffbj,  + 1.... the plot suggestion is very useful in these cases.

In addition to that you may want to ClearAllActions(TRUE) on all those in the PCs company. That may keep them from continuing the fight too. Once the baddies are plot it should work without this, but it can look odd to have the baddies take hits and stay blue.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
NPC Surrender
« Reply #3 on: June 21, 2013, 09:33:32 pm »


               

meaglyn wrote...
In addition to that you may want to ClearAllActions(TRUE) on all those in the PCs company.


This is critical to do.

Once a fight has started a faction adjustment does not stop a critter from hammering away at a target. The combat loop will keep going unless it is broken. ClearAllActions(TRUE) should break the combat loop if it is applied AFTER the faction adjustment has completed.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
NPC Surrender
« Reply #4 on: June 21, 2013, 10:43:38 pm »


               Yeah that is important too. Forgot to mention that since things become such a matter of routine, you just don't think to point them out.
               
               

               
            

Legacy_eucletes

  • Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
NPC Surrender
« Reply #5 on: June 22, 2013, 07:21:21 pm »


               Thank you all for your suggestions. I found a forum thread call surrender script and it had some code that help me visualize my coding approach. It's all good :-)

Regards.
               
               

               
            

Legacy_Nevercallmebyname

  • Full Member
  • ***
  • Posts: 164
  • Karma: +0/-0
NPC Surrender
« Reply #6 on: July 30, 2013, 10:23:49 am »


               Is it posible to make this same script as a random chance outcome?
So sometimes they will surender but sometimes they wont?