Home   Help Search Login Register  

Author Topic: die civvies die  (Read 3857 times)

0 Members and 1 Guest are viewing this topic.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:die civvies die
« Reply #15 on: 28 Dec 2004, 19:23:16 »
Like I said in reply #10:
Quote
Try:

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

That should fix the titletext problem anyway.


Planck
« Last Edit: 28 Dec 2004, 19:23:47 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 #16 on: 30 Dec 2004, 03:16:35 »
at the end it has error unkown, i think cause it cuts out at about the k

and the plain down doesnt help, same error message

Offline Major Draper

  • Members
  • *
  • Whoooooaaa!!!! to much in formation for me brain
Re:die civvies die
« Reply #17 on: 30 Dec 2004, 03:20:16 »
This is the intire script that im testin

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

error still reads at the title text  :'(

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:die civvies die
« Reply #18 on: 30 Dec 2004, 05:47:04 »
k, i found the error. this is really wierd, i had the same problem with another script:
"?!(alive _x)" foreach _allcivs|#|:titleText ["A civilian has died!","plain down"]...error unknown operator

...

wtf?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:die civvies die
« Reply #19 on: 30 Dec 2004, 19:40:06 »
Hmmmmm.....what about:

? !("alive _x") foreach _allcivs :titleText ["A civilian has died!","plain down"]


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

Offline Mud_Spike

  • Contributing Member
  • **
Re:die civvies die
« Reply #20 on: 30 Dec 2004, 20:06:23 »
Why bother with a trigger and counting alive units when
all you really seem to need is a "killed" eventHandler?

Attach a "killed"-EH to all your civvies (if lots of them, use a trigger covering the whole map to round them up in a nice array), and have the EH count the number of killed civvies and display titleTexts for you.

If you still dont want that, use something like:
in init.sqs:
civnum = "alive _x" count myCivvieTrigger

and in your repeating trigger checking for civilian present, called 'myCivvieTrigger'..
condition: civnum != "alive _x" count thislist
activation: x = "alive _x" count thislist ; titleText [format ["another %1 civvies died", x], "plain.."] ; civnum = x

Or something along those lines (SNG).

(edit: I read the post more carefully the second time)
« Last Edit: 30 Dec 2004, 20:14:45 by Mud_Spike »

Offline Major Draper

  • Members
  • *
  • Whoooooaaa!!!! to much in formation for me brain
Re:die civvies die
« Reply #21 on: 31 Dec 2004, 02:04:13 »
Planck, dint work... :(

Mud Spike, goina have to clarify somethin

how the hell do u atach and Eh to a unit

and how do i get the Eh to title text it

basiclly what the hell is an EH ???

I think that idea might work better, 2nd one might be easier but 1str one sounds best (hittien the prob from a different angle)

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:die civvies die
« Reply #22 on: 31 Dec 2004, 02:12:40 »
An eventhandler detects when an event happens and then does something.

You could use their init field to add a "killed eventhandler.

civi1 addEventHandler ["killed",{_this exec "civikilled.sqs"}]

civikilled would be the script that is run when this civi is killed.

You can add the eventhandler to each civi and the script would run when they are killed.

Basically.........Anyway there is a little tutorial in the Editors Depot.


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