Home   Help Search Login Register  

Author Topic: INIT.sqs  (Read 455 times)

0 Members and 1 Guest are viewing this topic.

Judge856

  • Guest
INIT.sqs
« on: 01 May 2003, 06:59:28 »
If I was to make an INIT.sqs to say

_unit setcombatMode "Combat"
_unit setskill "1!

Would that make every AI on the map swtich to combat mode and give him maxium skill? Please don't tell me I have to edit each unit individually because there are literally dozens :-[

Judge856

  • Guest
Re:INIT.sqs
« Reply #1 on: 01 May 2003, 07:00:55 »
Also,  unitname playmove "effectsstandstillsit"  <-- I can't remeber the proper command, pelase help

Offline Killswitch

  • Members
  • *
  • Peace, cheese and ArmA
Re:INIT.sqs
« Reply #2 on: 01 May 2003, 08:16:26 »
Quote
If I was to make an INIT.sqs to say

_unit setcombatMode "Combat"
_unit setskill "1!

Would that make every AI on the map swtich to combat mode and give him maxium skill?
Nope. Actually, putting those exact two lines in an init.sqs would do nothing except perhaps give you an error message, since the _unit variable has no value, i.e. it is not referring to anything. To give you a short example of an init.sqs that actually would do something (but not what you want), this would "work":

Code: [Select]
_unit = player
_unit setcombatMode "Combat"
_unit setskill "1"

(Just showing you that the local variable _unit has to be given a value, in this case a reference to the player, before one can use it)

Quote
Please don't tell me I have to edit each unit individually because there are literally dozens
Good news! You don't  ;D Here's what you do:

1: Put a big trigger in (or near) the center of the map and make its size 12800 by 12800 to make it cover the entire island.
2 :Choose whatever side you want to do the above stuff for in the "Activated by" part. Choose "Anybody" to do it for each and every little unit on map, regardless of its side, be it East/West/Res/Civ.
3: In the 'On activation' field of the trigger, put this:
Code: [Select]
{_x setCombatMode "combat"; _x setSkill 1} forEach thislist4: Done!

If you wanted to add that playMove-thing to the trigger, it would look like this:
Code: [Select]
{_x setCombatMode "combat"; _x setSkill 1; _x playMove "EffectStandSitDown"} forEach thislist
(This will make all soldiers sit down, if that was what you were looking for).

Note: since that script line is executed on all units including vehicles manned by the AI (I believe), I don't
know what vehicles would do when given the instruction to sit down... try it and see what happens.



« Last Edit: 01 May 2003, 08:23:11 by Killswitch »