Home   Help Search Login Register  

Author Topic: Whats wrong with this: Script that was working before but its not now.  (Read 440 times)

0 Members and 1 Guest are viewing this topic.

Offline Laviski

  • Members
  • *
ok, i made a fugitives misison before got it working then PC got broke so remaking it again. the story is 3 resistance guys are on the run from the east and have to make it to the extraction point  which is defended by the west (AI). So basically have I have 3 end scenarios - Time up , Resistance extracted and Resistance killed. now the script i used before to end the game when all the resistance are killed doesn't seem to be working now.


My resistance refugees are called ResGuy1 and ResGuy2 and ResGuy3, declare three variables in my init.sqs script as ResGuy1Dead = false and ResGuy2Dead = false. and ResGuy3Dead = false Create three triggers (size 0 by 0, activated by none, repeat) with conditions alive ResGuy1 and alive ResGuy2 and alive ResGuy3, on activation put ResGuy1Dead = true; ResGuy1 exec "res_guy_dead.sqs" and ResGuy2Dead = true; ResGuy2 exec "res_guy_dead.sqs" and ResGuy3Dead = true; ResGuy3 exec "res_guy_dead.sqs". Here's the script res_guy_dead.sqs:

Code: [Select]
; Make sure this is only displayed to the player who is respawning
; *and* only if at least 5 seconds have passed - otherwise this script
; will run when the game starts (assuming the player isn't killed after
; only 5 seconds ;)
? not local _this or time < 5 : exit

; Fade to black.
cutText ["You are dead!","BLACK OUT", 1]

; Move the player out of the playing area - so he's not killed while waiting
; to respawn. This is on a small island off Malden.
_this setPos [9875, 2265, 13]

; This should force the unit to stop.
disableUserInput true

; Keep looping until they're both dead.
#loop
~1

; When both guys are dead, the game can end.
? ResGuy1Dead and ResGuy2Dead and ResGuy3Dead: goto "game_over"
goto "loop"

#game_over
; Fade back in.
cutText ["","BLACK IN"]

; And finally give control back to the player.
disableUserInput false

so ermm what happens is when they are killed they screen goes black for less than a secound and reappears as normal, But another problem is that east side  expiences the same goes black for less than a secound showing "you Are Dead" then fades back out lets u continue playing as normal.

any help would be much appreciated.


« Last Edit: 28 Sep 2004, 20:17:38 by Laviski »

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
what you initiate via script will happen to all players. I don't know if you can single out one player but I don't think you can. Instead create a script that says "Resistance Man 1" is dead, or something to that effect.
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
If this is a MP question then it should be on the MP board.

Once you've asked a mod to move it, read snYpir's OFPEC Guide:  Multiplayer editing.    ;)    Triggers are global, scripts are local.    You must have a profound understanding of this - I don't - before you attempt any MP editing.
Plenty of reviewed ArmA missions for you to play