Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

Passive acquire mode

Open TaranDahl opened this issue 3 months ago • 14 comments

Passive acquire mode

  • Now you can order the units to enter "Ceasefire Mode" or "Aggressive Mode", just like in RA3.
    • In ceasefire mode, units will only attack the targets specified by the player.
    • In aggressive mode, units will automatically attack all enemies, including buildings without weapons.
    • In normal mode, units will auto-target like usual.
  • You can use two hotkeys to switch between these two modes if [General] -> EnablePassiveAcquireMode is set to true. When you press one of these hotkeys:
    • If all selected units are in that mode, they will switch to the normal mode. Otherwise, they will enter that mode. Units that cannot switch modes are not counted.
    • If any unit successfully switches its mode, a sound effect will be emitted. This sound can be customized through [TechnoType] -> Voice(Enter/Exit)(Aggressive/Ceasefire)Mode.
  • You can use [TechnoType] -> PassiveAcquireMode.Togglable to specify whether the unit can toggle its mode.
  • You can use [TechnoType] -> PassiveAcquireMode to specify the unit's initial mode.

In rulesmd.ini:

[General]
EnablePassiveAcquireMode=false        ; boolean

[SOMETECHNO]                          ; TechnoType
PassiveAcquireMode=Normal             ; passive acquire mode, Normal / Aggressive / Ceasefire
PassiveAcquireMode.Togglable=true     ; boolean
VoiceEnterAggressiveMode=             ; Sound entry, default to VoiceAttack or VoiceMove
VoiceExitAggressiveMode=              ; Sound entry, default to VoiceMove or VoiceSelect
VoiceEnterCeasefireMode=              ; Sound entry, default to VoiceSelect or VoiceMove
VoiceExitCeasefireMode=               ; Sound entry, default to VoiceAttack or VoiceMove

[ ] Ceasefire Mode

  • Order the selected units to enter or exit the ceasefire mode. See this for details.
  • For localization add TXT_CEASEFIRE_MODE, TXT_CEASEFIRE_MODE_DESC, MSG:CEASEFIRE_MODE_ON and MSG:CEASEFIRE_MODE_OFF into your .csf file.

[ ] Aggressive Mode

  • Order the selected units to enter or exit the aggressive mode. See this for details.
  • For localization add TXT_AGGRESSIVE_MODE, TXT_AGGRESSIVE_MODE_DESC, MSG:AGGRESSIVE_MODE_ON and MSG:AGGRESSIVE_MODE_OFF into your .csf file.

TaranDahl avatar Sep 10 '25 04:09 TaranDahl

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

github-actions[bot] avatar Sep 10 '25 04:09 github-actions[bot]

Previously when discussing stances we figured there should be a button/indicator at bottom bar. Have this went anywhere? If I recall correctly, someone even had the code to add custom buttons there.

Metadorius avatar Sep 10 '25 07:09 Metadorius

Previously when discussing stances we figured there should be a button/indicator at bottom bar. Have this went anywhere? If I recall correctly, someone even had the code to add custom buttons there.

Hmmmm ... where is that code then🤔

TaranDahl avatar Sep 10 '25 07:09 TaranDahl

Aggressive stance if I'm not wrong :-/

FS-21 avatar Sep 10 '25 09:09 FS-21

Aggressive stance if I'm not wrong :-/

https://github.com/Phobos-developers/Phobos/pull/1464 did not touch the bottom bar.

TaranDahl avatar Sep 10 '25 09:09 TaranDahl

Could there be visual indicator on techno to tell which of them is in aggressive/passive stance if it’s toggleable?

Coronia avatar Sep 10 '25 09:09 Coronia

Maybe it could be drawn next to the unit like the insignia. But I don't think this is a good idea. We already have too many things to draw next to the unit. I'm asking Crim to open a pr for his bottom bar.

TaranDahl avatar Sep 10 '25 09:09 TaranDahl

Maybe it could be drawn next to the unit like the insignia. But I don't think this is a good idea. We already have too many things to draw next to the unit. I'm asking Crim to open a pr for his bottom bar.

I think @Otamaa had the code for custom vanilla bottom bar buttons?

Metadorius avatar Sep 12 '25 11:09 Metadorius

About the buttons on bottom: https://github.com/CrimRecya/Phobos-Mix/blob/Mix-ECpack/src/Commands/Commands.cpp#L180C1-L180C69 https://github.com/CrimRecya/Phobos-Mix/blob/Mix-ECpack/src/Commands/Commands.h#L17

CrimRecya avatar Sep 13 '25 13:09 CrimRecya

Maybe it could be drawn next to the unit like the insignia. But I don't think this is a good idea. We already have too many things to draw next to the unit. I'm asking Crim to open a pr for his bottom bar.

I think @Otamaa had the code for custom vanilla bottom bar buttons?

my code is more big than Crim one , i do play around with these for a bit just for fun : https://github.com/Otamaa/Phobos-Minimal/blob/f2ac3f68b7561d3b91b1d59d13ac9f6a601cb573/src/Misc/Hook.CommandButtons.cpp

Otamaa avatar Sep 18 '25 09:09 Otamaa

Previously when discussing stances we figured there should be a button/indicator at bottom bar. Have this went anywhere? If I recall correctly, someone even had the code to add custom buttons there.

@Metadorius The existing code has exceeded 500 lines. I think it's better to complete this PR before initiating a new one to finish these tasks, to avoid overwhelming the reviewer with too much code. What do you think?

TaranDahl avatar Oct 30 '25 09:10 TaranDahl

@Metadorius The existing code has exceeded 500 lines. I think it's better to complete this PR before initiating a new one to finish these tasks, to avoid overwhelming the reviewer with too much code. What do you think?

@TaranDahl I propose to take CrimRecya's implementation of the bottom bar buttons from #1453 separately as a new PR without any extra logics (maybe could do a new button for triggering Select Next Idle Harvester command; however, I am not sure if the buttons have to be always tied to CommandClass, this is up for discussion), reviewing/refactoring it so it fits our standards, merging, and then rebasing this PR so it can use it.

oh and don't merge latest develop commit, we're deciding how to proceed on it

Metadorius avatar Oct 30 '25 09:10 Metadorius

resolved the situation with develop, feel free to merge it

Metadorius avatar Oct 30 '25 22:10 Metadorius

@TaranDahl I propose to take CrimRecya's implementation of the bottom bar buttons from https://github.com/Phobos-developers/Phobos/pull/1453 separately as a new PR without any extra logics (maybe could do a new button for triggering Select Next Idle Harvester command; however, I am not sure if the buttons have to be always tied to CommandClass, this is up for discussion), reviewing/refactoring it so it fits our standards, merging, and then rebasing this PR so it can use it.

@CrimRecya How about this

TaranDahl avatar Nov 09 '25 13:11 TaranDahl