Home   Help Search Login Register  

Author Topic: Random Kill group script using init.sqs  (Read 1009 times)

0 Members and 1 Guest are viewing this topic.

Offline Case

  • Members
  • *
Random Kill group script using init.sqs
« on: 10 May 2007, 23:42:23 »
I have bits and pieces (from reading here), of what I need to do.

What I eventually want to do, is create a random number, 0 or 1 and set dammage to a group of civilians to that number.  So basically, at the start of a mission either all the civilians are alive or dead.

I have created a group of civilians, and in the leader set init to 'grpCiv1 = Group This'.

For now, I am not randomizing the 0 or 1, I am just try to kill them all the time.

So,

In init.sqs I have:

"_x setdamage 1" foreach units grpCiv1;

This gives an error on mission load talking about string, expected code.

So, I create a radio trigger calling script that has the same line in it, but nothing happens when I activate the radio.

Can anyone help me out?

Thanks!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Random Kill group script using init.sqs
« Reply #1 on: 11 May 2007, 00:42:38 »
hmmm, let me see......I think.......

{_x setdamage 1} foreach units grpCiv1;

might be the answer.....possibly.


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

Offline Case

  • Members
  • *
Re: Random Kill group script using init.sqs
« Reply #2 on: 11 May 2007, 01:50:56 »
Thanks,

That worked perfectly, and just before you post I found a reference to the " being replaced by {} in Arma, thankfully, I can see how people had problems with using quotes...

Anyway, sorry for the newbie question, but thanks for the help.