Welcome to the Iron Front Fan Forums!
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
Poor Old Spike

Avatar / Picture

IFR Team
Registered:
Posts: 415
Reply with quote  #1 
When setting up an ambush (for example with AT guns), is there a code to make them hold their fire right from the start of the game?
It'll prevent them blowing their cover by firing at units outside effective range in the first seconds of a game before you've had time to issue a "Hold Fire" order.
Later you can order them to Open Fire to spring the ambush when the enemy is closer. 
0
Santa Six

Avatar / Picture

Colonel
Registered:
Posts: 360
Reply with quote  #2 
http://community.bistudio.com/wiki/setCombatMode
0
Poor Old Spike

Avatar / Picture

IFR Team
Registered:
Posts: 415
Reply with quote  #3 
Thanks, I followed the link and tried typing this into an AT guns initialisation field to make it hold fire except in self-defence

_group1 setCombatMode "GREEN"

but got a message saying it was invalid syntax or something. Any idea what I did wrong?
0
Rydygier

Avatar / Picture

IFR Team
Registered:
Posts: 179
Reply with quote  #4 
In the init fields local variables are not allowed. Local are these with underscore at the beginning. Remove "_" form the group name to make it global (change also group name itself of course, so first set group name) and should be fine. Ready code would look like:

group1 = group this;group1 setCombatMode "GREEN";

or just:

(group this) setCombatMode "GREEN";

Of course name of the group may be other.

Below code into one unit init also should do the trick for all group, I guess:

this setCombatMode "GREEN";
0
Poor Old Spike

Avatar / Picture

IFR Team
Registered:
Posts: 415
Reply with quote  #5 
Thanks guys, it works fine, I'll do a screenshot in the Help thread..
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.