Home   Help Search Login Register  

Author Topic: 1 heli left = end mission  (Read 1191 times)

0 Members and 1 Guest are viewing this topic.

O Neil

  • Guest
1 heli left = end mission
« on: 03 Jul 2003, 11:28:06 »
Hey

Umm.....I'm making an MP mission, where you try to shoot each other down inside helicopters, and their all on the WEST side.

I need the game to end (Or at least have a cut-scene happen)  when there is only 1 chopper left alive (Or one MP player)

O'Neil

Captain Wacky

  • Guest
Re:1 heli left = end mission
« Reply #1 on: 03 Jul 2003, 13:06:41 »
One way for it too work could be this:

Example: If you've got 4 choppers. Names: h1, h2, h3, h4.

Place a trigger with Activation: None
Text: helis down
Condition: not(alive h1) AND not(alive h2) AND not(alive h3) OR not(alive h1) AND not(alive h2) AND not(alive h4) OR not(alive h1) AND not(alive h3) AND not(alive h4) OR not(alive h2) AND not(alive h3) AND not(alive h4)
On Activation: this exec "cutscene.sqs"

Depending on how many choppers you've got, you need to have a line of code for each surviving one.

If that doesn't work you could also try this:

Place 5 triggers.
Activation: None
Text: heli down
Condition: h1 getDammage 1
On Activation: h1down=true

Activation: None
Text: heli down
Condition: h2 getDammage 1
On Activation: h2down=true

Activation: None
Text: heli down
Condition: h3 getDammage 1
On Activation: h3down=true

Activation: None
Text: heli down
Condition: h4 getDammage 1
On Activation: h4down=true

Activation: None
Text: cutscene
Condition: h1 AND h2 AND h3 OR h1 AND h3 AND h4 OR h1 AND h2 AND h4 OR h2 AND h3 AND h4
On Activation: this exec "cutscene.sqs"

I hope this helps.

O Neil

  • Guest
Re:1 heli left = end mission
« Reply #2 on: 04 Jul 2003, 07:42:43 »
OK, thxs I'll try it on all.....16 helicopters ;)

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:1 heli left = end mission
« Reply #3 on: 04 Jul 2003, 08:51:42 »
nd u can simplify it all by usin 1 triger dat have da next line in condition field :P ;D

"not alive _X" count [h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h13,12,h14,h15,h16] == 15

;D

nd u can use h4 getDammage 1

it shud b

getDammage H4 == 1

nd u wil b mesing w/ 2 long condition field - if u get dis and or system 4 16 copters  ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Captain Wacky

  • Guest
Re:1 heli left = end mission
« Reply #4 on: 04 Jul 2003, 11:07:39 »
I thought I'd done something wrong, LCD. Cheers for that, I always confuse the syntax for setDammage and getDammage.

O Neil

  • Guest
Re:1 heli left = end mission
« Reply #5 on: 04 Jul 2003, 11:25:21 »
...................................

So...I type this in the cond field:

"not alive _X" count [h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h13,12,h14,h15,h16] == 15

?

Soz LCD, it's your wording ;) Been like that since I can remember ;) ;) ;)

O'Neil

Captain Wacky

  • Guest
Re:1 heli left = end mission
« Reply #6 on: 04 Jul 2003, 11:35:00 »
Yes. That goes in the Condition field.

Offline Grinning_Giant

  • Members
  • *
  • Do not let them get away with it!
Re:1 heli left = end mission
« Reply #7 on: 04 Jul 2003, 12:23:46 »
How does the _X function work? I have often wondered how and why it is used. Could you offer an explination and some more examples?  :)

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:1 heli left = end mission
« Reply #8 on: 04 Jul 2003, 14:59:04 »
@ 0 neil

yeah dats da syntax or u can make it shorter (remove da not nd add change da 15 2 5) like dat

"alive _X" count [h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h13,12,h14,h15,h16] < 2

;D

@ giant

ma eng is notgood enough 2 write TUTs ;) so u beter get uself som LCDish dicionary (just send me 50$ nd ill send u a copy ;D ;))

da _X function is a way2 do action (or condition) on array

4 example

"_X moveincargo truck" foreach [dumb,dumber,dumbest,grinning,giant]

wil tell all da units in da array (after da foreach) 2 move in da cargo of da truck

or it can b used as condition

4 example

"(vehicle _X)==_X" count  [dumb,dumber,dumbest,grinning,giant]  == 4

will wait til da condition is true for 4 of da units in da array above

nd u can use da foreach command 4 if...then syntax

4 example

"if (_X in array) then {array=array-[_X]}" foreach [dumb,dumber,dumbest,grinning,giant]  

so it wil check 4 each 1 of da units nd if da unit it checks is in da array it wil remove it ;D

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Grinning_Giant

  • Members
  • *
  • Do not let them get away with it!
Re:1 heli left = end mission
« Reply #9 on: 04 Jul 2003, 16:48:49 »
Ah!  :D

So it saves you writing tonnes of script in Init and Activation fields...

I understand better now cheers LCD   ;)

===============================

I dont understand this code:

Code: [Select]
"(vehicle _X)==_X" count  [dumb,dumber,dumbest,grinning,giant]  == 4Does the vehicle command return info about who is in the vehicle? What does "(vehicle _X)==_X" count do?

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:1 heli left = end mission
« Reply #10 on: 04 Jul 2003, 17:53:25 »
da vehicle commands check da vehicle da unit is in

so lets say u got a soldier named dumb

if dumb is in choper1 nd u write like dat

_veh = vehicle dumb

so now _veh is choper1

nd if he is outside ny oder vehicle

so vehicle dumb wil b dumb

so den

_veh = vehicle dumb

now _veh wil b da man himself

so wat i checked dere is dat 4 of da units in da array r outside ny oder vehicle

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Burn

  • Members
  • *
Re:1 heli left = end mission
« Reply #11 on: 04 Jul 2003, 18:14:10 »
HEY GUYS I'VE GOT AN PIRATE COPY OF "LCDish" ;D :moon:

From Macguba:
Quote
LCD dictionary

(I'd hate to see anybody not being able to benefit from his most excellent advice ..... just as much as I'd hate to see him change style.)

2 dos - to those
al - all
b - be
b4 - before
bout - about
c - see
cuz - because
da - the
dat - that
dere - there
on activision - On Activation
r - are
sec - second, 2nd
shud - should
triger - trigger
nd - and
u - you

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:1 heli left = end mission
« Reply #12 on: 04 Jul 2003, 23:41:43 »
:moon: :noo: NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
:moon: :noo:

ill sue u  :P ;)

how can i live if no1 wil buy da dictionaty  :o  :-X

i need 2 invent new words ;D ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Burn

  • Members
  • *
Re:1 heli left = end mission
« Reply #13 on: 09 Jul 2003, 18:03:47 »
ROFLMAO
I'll better hire Sefe then so I'll win ;D

[edit]
Sefe will you be my defence lawyer ;D :P???
« Last Edit: 09 Jul 2003, 18:06:23 by Bizon »