Home   Help Search Login Register  

Author Topic: what the... combatmode  (Read 1276 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
what the... combatmode
« on: 22 Sep 2004, 01:06:15 »
I got a problem with the command combatmode...

When I order my squad to hold fire, combatmode should be "GREEN",at least that's what the comref says.

But when I debug...

Code: [Select]
hint format ["%1",combatmode group player]

...it returns "YELLOW" which is Fire at will.

Starnge thing is that it works when I place a MOVE waypoint, HOLD FIRE, but not when I give the order.

Is this an OFP bug?



 


« Last Edit: 22 Sep 2004, 01:07:44 by Blanco »
Search or search or search before you ask.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:what the... combatmode
« Reply #1 on: 22 Sep 2004, 08:33:44 »
When I was young and innocent and had just started mission editing, I quickly gave up using setCombatMode commands.    They never seemed to acheive what I wanted.    That was well before I discovered things like format or even the forums so I put it down to bad luck or bad editing and didn't think any more about it.     But  this probably explains it.  

Have you tried any of the other colours?
Plenty of reviewed ArmA missions for you to play

Offline Blanco

  • Former Staff
  • ****
Re:what the... combatmode
« Reply #2 on: 22 Sep 2004, 12:46:16 »
So it is another OFP bug....  >:(

I didn't try other colors yet...
I need it for a script when your team is in HOLD FIRE mode.
When the leader-player  fires his first shot, the whole groups combatmode changes to FIRE AT WILL automatically.
Usefull for stealth or ambush missions.

It simple to do with a EH fired in the init of the commander (player)

Code: [Select]
this addeventhandler ["fired",{_this exec "foc.sqs"}]

and then foc.sqs
Code: [Select]
_shooter = _this select 0

?_shooter != player : exit
_Weapon = _this select 1
_pri = primaryweapon _shooter

?(combatmode group _shooter != "GREEN") : exit
?_weapon != _pri : exit

group _shooter setcombatmode "YELLOW"
exit

« Last Edit: 20 Oct 2004, 03:52:08 by Blanco »
Search or search or search before you ask.

Unnamed

  • Guest
Re:what the... combatmode
« Reply #3 on: 22 Sep 2004, 13:47:01 »
I think Combatmode only works when you call SetCombatMode from a script, it seems to ignore it when a player orders his squad to hold fire in game. So if you set them all to hold fire with SetCombatMode at the start of a mission, your fired event should work?

Offline Blanco

  • Former Staff
  • ****
Re:what the... combatmode
« Reply #4 on: 22 Sep 2004, 15:42:15 »
True, but that will only work one time.

I have to add an action to the leader "ALl Hold fire" so the order can be executed by a script.

 
Search or search or search before you ask.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:what the... combatmode
« Reply #5 on: 22 Sep 2004, 15:42:24 »
I think Unnamed is partly right...

combatMode (and setCombatMode) works on AI with no problems, but apparently when the AI is in players group it gets treated a bit differently by the game engine (all of this is just afaik) and BIS forgot to implement that into their combatMode function...
Or maybe BIS thought why the hell someone would like to know in what combat mode the players AI group is in, as the player already knows it ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:what the... combatmode
« Reply #6 on: 22 Sep 2004, 22:56:57 »
Well.... "combatmode" is a group property, not an individual unit property. The only way you can order specific members of a group to change combatmode is via the player's controls. So I guess it shouldn't be that odd that the player doesn't actually change the group's combatmode via his controls, since those controls have a unique function that can't be duplicated via scripting.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:what the... combatmode
« Reply #7 on: 23 Sep 2004, 09:15:35 »
Combatmode seems to be picked up by what the leader is set to...

General Barron's right, it's definately a group property. However it's not taken on the group as a whole (as you might expect it to be :P).
I noticed while writing a platoon command engine that detecting combatmode for a player led squad would only return what the player's combatmode is.

If you set the player's combatmode (via a script or trigger) to another mode, then it will return correctly. You'll also notice the red square next to the player's unit (if set to hold fire), which you won't be able to get rid of unless you use another combatmode change via a script/trigger.

Anyway, bottom line: I don't think the player can change their own combatmode in game... only that of their group. The combatmode command will return the player's combatmode, not that of the group as a whole.

Offline Maddmatt

  • Members
  • *
Re:what the... combatmode
« Reply #8 on: 25 Sep 2004, 14:33:33 »
You could get the combatmode of the second guy in the squad.
Code: [Select]
combatmode (units player select 1)
If you did "select 0", it would return the player.
You should also disable that when the player's squad dies.
http://bushfires.org/
African Conflict Mod
Mission editor and scripter

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:what the... combatmode
« Reply #9 on: 25 Sep 2004, 18:50:06 »
You could get the combatmode of the second guy in the squad.
Code: [Select]
combatmode (units player select 1)
No, you can't unfortunately. :( That's what I meant by saying 'its a group property'; that is, everyone in the group always has the same combatmode, no matter what. :(
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Unnamed

  • Guest
Re:what the... combatmode
« Reply #10 on: 26 Sep 2004, 19:35:05 »
You can move a guy out of the group, assign a combat mode and return him. He will retain his new unique combat mode, until told otherwise.

Code: [Select]
_Group=Group _Unit
_Unit Join GrpNull
_Unit setcombatmode "YELLOW"
_Unit Join _Group

It seemed to work ok for my observer, although it was not an ideal solution. It might work for your idea in reverse? Move the guy to his own group, then check his combat mode, then move him back?

« Last Edit: 26 Sep 2004, 19:36:03 by Unnamed »

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:what the... combatmode
« Reply #11 on: 26 Sep 2004, 22:24:33 »
Didn't know that, Unnamed. However, if you are talking about a player's squad, moving guys into and out of the squad isn't very pretty. The guy's change numbers, they get told to fall back into formation, etc.... this could all easily be solved just by adding an action or radio option for the player, that says 'fire on my command' or something similar.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Unnamed

  • Guest
Re:what the... combatmode
« Reply #12 on: 27 Sep 2004, 13:07:45 »
Quote
However, if you are talking about a player's squad, moving guys into and out of the squad isn't very pretty. The guy's change numbers, they get told to fall back into formation

They seem to remember there original position, when you move them from a group to GrpNull and back again. Another quirk, if the orders are made via a waypoint it continues with the original order. If you give them as the squad leader in game, he tries to return to formation. I had them always defaulting to DoStop, that's what I wanted them to do along with holding fire.

It is possible, but yeah. Although it looks seamless when the mission isn't lagging, would probably not be a good idea calling it from a fired event. The action menu sounds like the way to go, or you could automate it, using a delay. If no shots fired for 60 seconds (or whatever) reset your squad to holdfire.

Offline Blanco

  • Former Staff
  • ****
Re:what the... combatmode
« Reply #13 on: 20 Oct 2004, 03:47:16 »
I wrote the script with the action and submitted it to the editor depot.

http://www.ofpec.com/editors/resource_view.php?id=704#comments

Gonna try and test another "automatic" version (as Unnamed suggested) and see how it goes...

 
« Last Edit: 20 Oct 2004, 03:47:44 by Blanco »
Search or search or search before you ask.