Home   Help Search Login Register  

Author Topic: die civvies die  (Read 3859 times)

0 Members and 1 Guest are viewing this topic.

AnarCHy

  • Guest
die civvies die
« on: 03 Dec 2004, 05:34:00 »
(ive had trouble with too much chatter before, so im putting this blunt)

I need a trigger or script that would activate repetedly for when a specific unit in a side has died (i.e. civvie in this case)

what it would do is tell u when he/she died, in a TitleTxT in the bottom part of the screen (much like serialkiller)  i.e. it would say (A civilian has died!)

and, last but not least, i need to find a way to log the number of deaths and show how many have died when a civilian dies. (in hint form)

AAA

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:die civvies die
« Reply #1 on: 03 Dec 2004, 21:43:18 »
to answer both questions, here's what you can do, so long as you don't create any more civs during the mission

make a civilian present trigger covering the whole map.
condition:this
activation:[thislist] exec "deadcivs.sqs" or whatever you name it

Code: [Select]
_allcivs = _this select 0
civsdead = 0
#loop
;added this just so you don't waste cpu
?_allcivs = []:exit

;what you actually need
"?!(alive _x)" foreach _allcivs:civsdead = titleText ["A civilian has died!", "bottom"];civsdead = civsdead + 1;_allcivs = _allcivs - [_x]
;don't know if i need that second part for the exit command to work

;once again, save cpu, plus it won't lag at all, you don't really need to check very often
~5
goto "loop"

then at the end of the mission just you a hint command with the variable civsdead
« Last Edit: 16 Dec 2004, 22:27:39 by Triggerhappy »

AnarCHy

  • Guest
Re:die civvies die
« Reply #2 on: 06 Dec 2004, 04:54:15 »
hey it worked :)

thanks for your help Trig

i put it thru its paces and found everytthing owrked fine, except from some errors I amde whilst making the mission :P

thanks
AAA

Offline Major Draper

  • Members
  • *
  • Whoooooaaa!!!! to much in formation for me brain
Re:die civvies die
« Reply #3 on: 16 Dec 2004, 06:25:53 »
This sounds perfect for a script that i want, but it doesnt work for me... ???  i mean it doesnt do anything when used in a mission.  I did exactly everything u said to do on the post If u can bare with my noob ness maybe make a simple sample mission.

Also if it could log the deaths of the civies could it end the mission if so many civies die?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:die civvies die
« Reply #4 on: 16 Dec 2004, 22:29:08 »
i just noticed an error i made, so i'm guessing anarchy changed the script a little, but what kind of trigger is it, how is it activated, how are you calling the script?

also use what is now posted, i corrected the error

Offline Major Draper

  • Members
  • *
  • Whoooooaaa!!!! to much in formation for me brain
Re:die civvies die
« Reply #5 on: 17 Dec 2004, 02:14:30 »
 ;D hehe.... I had the names of the script and the trigger activation diferent....

BUT in game it says theres an error with the line(w/ edited one):

"?!(alive _x)" foreach _allcivs:civsdead = titleText ["A civilian has died!", "bottom"];civsdead = civsdead + 1;_allcivs = _allcivs - [_x]

I used the edited one u put in, changed the names and that error pops up  :o

now the trigger type is none, activation Civilian, and its activated with
[thislist] exec="diecivies.sqs"

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:die civvies die
« Reply #6 on: 17 Dec 2004, 03:23:26 »
..... ???
something got messed up on the script, it has a line in the middle of another..wtf?

here:
Code: [Select]
_allcivs = _this select 0
civsdead = 0
#loop
?_allcivs = []:exit
;what you actually need
"?!(alive _x)" foreach _allcivs:titleText ["A civilian has died!", "bottom"];civsdead = civsdead + 1;_allcivs = _allcivs - [_x]
~5
goto "loop"

Offline Major Draper

  • Members
  • *
  • Whoooooaaa!!!! to much in formation for me brain
Re:die civvies die
« Reply #7 on: 17 Dec 2004, 07:09:41 »
 :-\ yeah... it still not workin for me......

the error is gone with the  newest version of the script, but it does absoultly nothing..... ???

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:die civvies die
« Reply #8 on: 17 Dec 2004, 21:45:35 »
it needs to be a 'present' trigger, with civilian
otherwise, civvies don't go into the list, nothing will.

Offline Major Draper

  • Members
  • *
  • Whoooooaaa!!!! to much in formation for me brain
Re:die civvies die
« Reply #9 on: 18 Dec 2004, 01:01:03 »
Well thats fixed but now another error pops up with the part about tile text.....

 :D yes anither error Whoohooo j/k

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:die civvies die
« Reply #10 on: 18 Dec 2004, 01:05:18 »
Try:

titleText ["A civilian has died!", "plain down"]


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

Offline Major Draper

  • Members
  • *
  • Whoooooaaa!!!! to much in formation for me brain
Re:die civvies die
« Reply #11 on: 18 Dec 2004, 03:27:10 »
hmmm thx for advice ;D

but still doesnt work..... :-[

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:die civvies die
« Reply #12 on: 18 Dec 2004, 14:06:00 »
It would help a lot if we knew what the error was.

Can you post the exact error message?


Planck
« Last Edit: 18 Dec 2004, 14:06:28 by Planck »
I know a little about a lot, and a lot about a little.

Offline Major Draper

  • Members
  • *
  • Whoooooaaa!!!! to much in formation for me brain
Re:die civvies die
« Reply #13 on: 28 Dec 2004, 04:16:18 »
yea that might help...

its in the line
 "?!(alive _x)" foreach _allcivs:civsdead = titleText |#|(<== error there)
 ["A civilian has died!", "bottom"];civsdead = civsdead + 1;_allcivs = _allcivs - [_x]

and sory for long time for post, holidays and all.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:die civvies die
« Reply #14 on: 28 Dec 2004, 05:14:55 »
Quote
Can you post the exact error message?

can you see any of the other stuff where it tells to the problem, or does it get cut off?

also, if you like, i just remembered that i could put in a counter and every time a civvie dies it will tell you how many have died