Jump to content

Photo
- - - - -

End Trigger if player dies without all objectives finished ?


  • Please log in to reply
3 replies to this topic
Thread Starter
CaptainBravo
CaptainBravo

    Master Sergeant

  • Members
  • 730 posts

  • Joined: 24-November 2005

Posted 03 March 2012 - 09:04 #1

I have a mission with Objectives 1, 2 and 3

I want mission to end if player dies but not all objectives accomplished. The twist is the player is supposed to die in last objective so if dies after accomplishing all objectives he wins and if he dies with one objective not finsihed he loses. Any tips are appreciated.
Captain Bravo
One of the serious problems in planning the fight against American doctrine, is that the Americans do not read their manuals, nor do they feel any obligation to follow their doctrine"
From a Russian General's Notebook

Join Bravo Company
A highly trained unit run by an ex cook, a hooker and an old pensioner, so expect the best!
http://forums.bistud...ead.php?t=80906

Demonized
Demonized

    Warrant Officer

  • Members
  • 2653 posts

  • Joined: 16-November 2010

Posted 03 March 2012 - 13:51 #2

Loose trigger condition if dead and not all completed:
!alive player AND (!obj1 OR !obj2 OR !obj3)
Make sure you have set obj1,2,3 to false in mission start, also set each of them to true once a objective is completed.

Now for all completed and dead, im sure you can figure it out now:
Spoiler

My scripts:



Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

galzohar
galzohar

    First Lieutenant

  • Members
  • 5575 posts

  • Joined: 03-June 2009

Posted 04 March 2012 - 20:10 #3

In MP, if all playable units are dead, mission ends immediately (or pretty much immediately), and your scripts won't even run.

In SP, if the player dies mission is over as well, and again your scripts won't even run. You won't even get a debriefing screen when dying in SP.
You don't mess with the Zohar!
YouTube channel: http://www.youtube.com/user/galzohar
Steam: http://steamcommunity.com/id/galzohar
ArmA Israel: http://www.arma-il.info
Check out and support upcoming Ground Branch: http://www.groundbranch.com/

Thread Starter
CaptainBravo
CaptainBravo

    Master Sergeant

  • Members
  • 730 posts

  • Joined: 24-November 2005

Posted 09 March 2012 - 10:01 #4

Thanks Demonized for the script, much appreciated.
@galzohar: you are right the mission will end right away before script is even run. My way of getting around it, is to creat a "playable" unit somewhere on map so if all players die, player can switch to the last remaining playable unit for mission end. Not sure if there is a better way of doing it, but this seems to work.
Captain Bravo
One of the serious problems in planning the fight against American doctrine, is that the Americans do not read their manuals, nor do they feel any obligation to follow their doctrine"
From a Russian General's Notebook

Join Bravo Company
A highly trained unit run by an ex cook, a hooker and an old pensioner, so expect the best!
http://forums.bistud...ead.php?t=80906