Home   Help Search Login Register  

Author Topic: Guardteam script  (Read 1538 times)

0 Members and 1 Guest are viewing this topic.

Offline The Unknown

  • Members
  • *
Guardteam script
« on: 04 Jul 2006, 19:08:31 »
I am working on a script where once a guard spots a enemy it will put all guards on alert that part works.
Now ofcourse I want them to shoot at the enemy.
I am trying to get the targets revealed in the trigger area to be added to there target list with the reveal command so far its not working cause it says it is missing someting.

'_unit reveal _targetlist |#|': Error reveal Type array ,expected object,group

I tryed the script in 2 ways but in both ways it gave the error. (1 of them with diffent names of ocurse)

This are the scripts:

Code: [Select]
;[this,[g1,g2,g3,g4]] exec "ga.sqs"
_trigger = _this Select 0
_targetList = List _trigger
_unit = _this Select 1
~5
@GA1
?GA1 : goto "GA1"

#GA1
_unit reveal _targetlist
~1
g1 setbehaviour "combat"
g2 setbehaviour "combat"
g3 setbehaviour "combat"
g4 setbehaviour "combat"
~2
g1 setunitpos "UP"
g2 setunitpos "Down"
g3 setunitpos "UP"
g4 setunitpos "UP"
~5
goto "exit"
#exit
exit

and

Code: [Select]
;[this] exec "ga.sqs"
_trigger = _this Select 0
_targetList = List _trigger
~5
@GA1
?GA1 : goto "GA1"

#GA1
g1 reveal _targetlist
g2 reveal _targetlist
g3 reveal _targetlist
g4 reveal _targetlist
~1
g1 setbehaviour "combat"
g2 setbehaviour "combat"
g3 setbehaviour "combat"
g4 setbehaviour "combat"
~2
g1 setunitpos "UP"
g2 setunitpos "Down"
g3 setunitpos "UP"
g4 setunitpos "UP"
~5
goto "exit"
#exit
exit

If anyone knows how to fix this please help.

The Unknown

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Guardteam script
« Reply #1 on: 04 Jul 2006, 20:09:48 »
Code: [Select]
;[trigger_name,[g1,g2,g3,g4]] exec "ga.sqs"

_trigger = _this Select 0
_targetList = List _trigger
_unit = _this Select 1

@GA1

_i = 0
#loop
_who = (_targetlist select _i)
{_x reveal _who} foreach _unit
_i = _i +1
?not (_i==count _targetlist):goto "loop"
~1

{_x setbehaviour "combat"} foreach _unit
~2

{_x setunitpos "up"} foreach _unit

g2 setunitpos "Down"

exit



not tested, but give it a go. main things is to use the trigger's name rather than 'this'in the activation.

Offline The Unknown

  • Members
  • *
Re: Guardteam script
« Reply #2 on: 05 Jul 2006, 18:36:37 »
well i tryed it out and it seems to work.

thanks

The Unknown