Home   Help Search Login Register  

Author Topic: I want to simplfly a script  (Read 894 times)

0 Members and 1 Guest are viewing this topic.

Offline matthew_duggan1

  • Members
  • *
I want to simplfly a script
« on: 23 Jul 2007, 18:09:54 »
I just need some help iv wrote a set of scripts for a shooting range and I have 2 problems. 1 there really long winded because in a newbie to scripting and. 2 iv added an add action command to a computer object, so I can turn the range on and off but the off wont work the targets keep replacing.

Iv used an inviserable target object infront of the Target E, the shooters shoot at the invisable targets knocking over the TargetE, when all targets have been knocked over they reswarm agian.


Invisable targets named target 1 to 9 and target 1_1 to 1_9 and targets 2_1 to 2_9
the target E Objects Are named t1 to 9 and t1_1 to t1_9 and t2_1 to t2_9

iv used a triggers over each target to disable the invisable targets once shot
Condition field=   !(alive t1_6)
activation field=  target1_6 setDammage 1

this is what my scripts do

hereford range.sqs - sets the weapon loadouts for the shooters and spotters and knows about commands so they will shoot the invisable targets

hereford range target loop.sqs - loops with a 60 seconds delay checking when a target is knocked over then exacutes hereford range targets 1.sqs

hereford range targets 1.sqs - resets all targets with no delay

hereford range off.sqs - this is meant to turn off all the scripts when range off is pressed on the computer object

here are the scripts any help with these is much appreciated. thanks

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: I want to simplfly a script
« Reply #1 on: 24 Jul 2007, 16:40:55 »
Not sure what this line is supposed to be doing, but at the moment it is doing nothing:
Code: [Select]
"!(alive _x)" count [t1,t2,t3,t4,t5,t6,t7,t8,t9,t1_1,t1_2,t1_3,t1_4,t1_5,t1_6,t1_7,t1_8,t1_9,t2_1,t2_2,t2_3,t2_4,t2_5,t2_6,t2_7,t2_8,t2_9] > 0;
What you can do is get rid of one of your scripts completely (hereford_range_targets_1.sqs)
 and use this to reset the targets up:
Code: [Select]
{if ( not alive _x) then {_x setDamage 0}} forEach  [t1,t2,t3,t4,t5,t6,t7,t8,t9,t1_1,t1_2,t1_3,t1_4,t1_5,t1_6,t1_7,t1_8,t1_9,t2_1,t2_2,t2_3,t2_4,t2_5,t2_6,t2_7,t2_8,t2_9];

Also, in your range off script you forgot to:
Code: [Select]
stopRange = TRUE   :P
« Last Edit: 24 Jul 2007, 16:47:34 by Mr.Peanut »
urp!