Home   Help Search Login Register  

Author Topic: Way to start mission with my men divided into two different "colors"?  (Read 2795 times)

0 Members and 2 Guests are viewing this topic.

Offline desertjedi

  • Members
  • *
I played a little with assigning two different colors to the AI men in the squad I commanded in the middle of a mission thus sort of splitting my squad into two teams - that both still reported to me.

It was a bit tedious doing it in the middle of a mission. Is there a way to have this done before the mission starts? Maybe putting something on the init line of every AI soldier in my squad? The colors would be hard-coded - I simply need my squad broken into two "colored" teams. If I could do it with three I'd be like a pig in...uh, mud.

I did a search on groupcolor but it looked like the peeps were trying to do something a bit more sophisticated and I did not understand it.

I play alone with AI mates and so many missions are written for A LOT of players. By having multiple teams, I could probably do much better than having everyone together. BTW, anyone know what the max number of AI mates I can have in my squad?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Not sure it is doable in ArmA1, you can create teams in ArmA2 with new commands not present in A1.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
If you mean the in-game colours (e.g., red, green, blue, yellow etc) then you can simply use assignTeam before the mission starts.  :good:

If you mean something else, e.g. having half the team be Alpha Blue 1 and half the team Gamma Green 3 or whatever, then I don't think that'll work out...

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
It is said that a leader can have 133 units in his team in ArmA....
and 11 units in his team when he is in OFP.

[But i don't think you can handle 100+ men!!!!! Damn its something that'll boil your brain!]
Haroon1992.............................................
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline desertjedi

  • Members
  • *
Quote
If you mean the in-game colours (e.g., red, green, blue, yellow etc) then you can simply use assignTeam before the mission starts.

Could I do that in the INIT line of each of the soldiers?

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
try { return true; } finally { return false; }

Offline desertjedi

  • Members
  • *
Quote
Could I do that in the INIT line of each of the soldiers?
I tried this and it did not work. It seems that it's simply ignored.

Offline tcp

  • Members
  • *
    • Violator Gaming
I don't know why that wouldn't work in the init line, but you could try:
Nul = [this,"RED"] execVM "assignTeam.sqf";

Code: (assignTeam.sqf) [Select]
sleep 1;
waitUntil {alive (leader (_this select 0))};
(_this select 0) assignTeam (_this select 1);

(leader (_this select 0)) might need to be replaced by whatever you name the unit you are going to play as.
« Last Edit: 12 Oct 2009, 18:18:22 by tcp »

Offline desertjedi

  • Members
  • *
Thanks - that worked great - just as is!

In my failed attempt using the init line of each AI soldier, I used 'this assignTeam "RED"' if I recall correctly. Should I have used "_this" instead?
« Last Edit: 13 Oct 2009, 00:22:45 by desertjedi »

Offline tcp

  • Members
  • *
    • Violator Gaming
No, everything you do in the editor will use global variables (this, without the _). Anything being done in a script should use local variables (_this) unless you explicitly want the variable to persist and retain its value when running other scripts.

If you're interested, to take it one step further, local variables can actually been seen by any functions you call from within a script, unless you use the private command. Also, a global variable is exclusive to the client is was set on. If you want to pass it to all clients, you would use publicVariable command.

Offline desertjedi

  • Members
  • *
Quote
If you're interested, to take it one step further, local variables can actually been seen by any functions you call from within a script, unless you use the private command. Also, a global variable is exclusive to the client is was set on. If you want to pass it to all clients, you would use publicVariable command.

Wow, it sounds like some high-level programming languages I've dealt with. Thanks for the clarification. I knew a little of these concepts in Arma but I've never seen it explained SO CLEARLY before!