Home   Help Search Login Register  

Author Topic: surrender after 100 deaths? EDIT:  (Read 1315 times)

0 Members and 4 Guests are viewing this topic.

UK_SKA_RULES

  • Guest
surrender after 100 deaths? EDIT:
« on: 27 Nov 2003, 16:50:07 »
Okay, so I am making a mission, loosely based on a real battle which took place in oman in 1972 between the SAS and a waaay bigger enemy force.  

The enemy are attacking in waves, of something like, 3 x 10 man groups.  This is done using a respawn script and a script that deletes dead bodies after around 1 minute.

What I am trying to do is once a certain number of east units die, say 100 deaths, the remaining eastern survivors surrender.

I know how to make them surrender, but I dont know how it can be done after 100 eastern losses.

I hope that's clear.  Can anyone help?  I'm not very good at mission making. ;)  Cheers.
« Last Edit: 27 Nov 2003, 23:21:29 by UK_SKA_RULES »

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:surrender after 100 deaths?
« Reply #1 on: 27 Nov 2003, 19:43:39 »
How about putting a counter in your delete deadbodies script?

Initialise a global variable (that exists outside all the scripts):

deadcount = 0

Assuming the script is called once to delete each dead body, add 1 to a each time a corpse is deleted; have a line:

deadcount = deadcount + 1

So, that's racking up the bodycount.  Now stick a trigger on the map.  Ignore the settings except for the condition field - delete the 'this' and type:

deadcount  > 100

Lastly, in the On Activation field:

[] Exec "mysurrenderingscript.sqs"

There are probably much more elegant solutions, but that'll Dhofar now!

UK_SKA_RULES

  • Guest
Re:surrender after 100 deaths?
« Reply #2 on: 27 Nov 2003, 20:03:25 »
That works.  Cheers for that :).  Now all I haveto do is get a surrender script sorted, and polish the mission up abit.

UK_SKA_RULES

  • Guest
Re:surrender after 100 deaths? EDIT:
« Reply #3 on: 27 Nov 2003, 23:23:26 »
Does anyone know how I can end the respawn script, once the surrender script begins?  Do I type something at the end of the respawn script which stops them when "surrender.sqs" begins.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:surrender after 100 deaths? EDIT:
« Reply #4 on: 28 Nov 2003, 00:00:22 »
Just an idea, but possibly you could set a global variable in the surrender script which is checked for in the respawn script.

i.e.
surrender = 0

Initialised at the beginning of the respawns script, or any initialisation script.

surrender = 1
Somewhere appropriate in the surrender script.

Then you could check the value of surrender in the respawn script with a line like:

? (surrender == 1) : goto "exit"

Of course you would need to add:

#exit
exit

in the correct place in the respawn script if it isn't already present.

Of course they may be more elegant ways of doing it, but this is simple enough for me.


Planck
I know a little about a lot, and a lot about a little.