• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Suggestion] Battle mode option

Status
Not open for further replies.
Level 7
Joined
Aug 23, 2014
Messages
208
I know, Zwiebelchen wrote "I think we have reached a point where I think the game can and should be feature-locked", but I still write it :)

How often have you met such a situation: "you cast a spell; you want again cast a spell; you hitting spell shortcut, but it still on CD; you clicking on target automatically, and you select enemy/friend unit; you spend your time to re-select hero and re-open spellbook"?

I suggest a solution!

"Battle mode" option in game options (turned off by default). What does it offer?
- "Battle mode" activates when you enter into battle and disables automatically in a peaceful time
- Every time you select something, "Battle mode" immediatly selects your hero and opens spellbook automatically
- Every 0.03125 seconds "Battle mode" checks your selection circle. If your hero doesn't selected, it automatically selects him and opens spellbook.
- You can easily disable "Battle mode" even in battle, simple hit "ESC=>Z=>Q" (i suggest "Q" shortcut for it)
- Inventory and Resource bag shortcuts (F2, F3) hidden during battle mode
- Scoreboard automatically opens battle/aggro/spelltrack tab


Pros:
- No more wasting time for re-selection hero and re-opening spellbook
- More compact hero shortcuts

Cons:
- You can not look at target buffs/debuffs (except your buffs/debuffs in tracker)
- You can not open inventory during battle

What do you think?
 
Last edited:
While I see what you are coming from, I highly doubt that this would work the way you want it to be. Selection natives are terribly slow in multiplayer. Also, there is no way to check if the player has the spellbook open or not, so even if we could deal with the delay, it's technically impossible.
 
Level 7
Joined
Aug 23, 2014
Messages
208
While I see what you are coming from, I highly doubt that this would work the way you want it to be. Selection natives are terribly slow in multiplayer.
Even with delay it faster than manually press "F1" and "Q" on keyboard. (checked in JNGP local multiplayer session for 6 players, maybe with real players with 200+ ping situation will be much worse? hmm...)

Also, there is no way to check if the player has the spellbook open or not, so even if we could deal with the delay, it's technically impossible.
It is not necessary.

You simply check whether the player chose something. If the selection does not contain player hero, trigger: clears selection, selects hero, waits a bit (because selection doesn't work instantly), presses spellbook shortcut automatically. That's all.

I made a simple triggers that implement this idea (I can not say whether they are optimal but they work). You can test them in attached map.

JASS:
function Trig_BattleModeRed_Timer takes nothing returns nothing
    if (GetLocalPlayer()==Player(0)) then // local player operations
        call ForceUIKey("Q")
    endif
endfunction

function Trig_BattleModeRed_Conditions takes nothing returns boolean
    if ( udg_BattleModeStatus[0] == true ) then // check Battle Mode ON/OFF status
        if ( true == true ) then // place combat check here
            if ( GetTriggerUnit() == gg_unit_h000_0001 ) then // place RED hero handle here (protection from endless loop)
                return false
            endif
            return true
        endif
    endif
    return false
endfunction

function Trig_BattleModeRed_Actions takes nothing returns nothing
    local timer t=CreateTimer() // create a timer for all players (desync protection)
    if (GetLocalPlayer()==Player(0)) then // local player operations
        call ClearSelectionForPlayer( Player(0) )
        call SelectUnitForPlayerSingle( gg_unit_h000_0001, Player(0) ) // place RED hero handle here
    endif
    call TimerStart(t, 0.05, false, function Trig_BattleModeRed_Timer) // press Q button after 0.05 seconds (lower values can "fail" sometimes, and higher are too slow)
    set t=null
endfunction

//===========================================================================
function InitTrig_BattleModeRed takes nothing returns nothing
    set gg_trg_BattleModeRed = CreateTrigger(  )
    call TriggerRegisterPlayerSelectionEventBJ( gg_trg_BattleModeRed, Player(0), true )
    call TriggerAddCondition( gg_trg_BattleModeRed, Condition( function Trig_BattleModeRed_Conditions ) )
    call TriggerAddAction( gg_trg_BattleModeRed, function Trig_BattleModeRed_Actions )
endfunction
What do you think?
 

Attachments

  • BattleMode.w3x
    13.9 KB · Views: 43
You simply check whether the player chose something. If the selection does not contain player hero, trigger: clears selection, selects hero, waits a bit (because selection doesn't work instantly), presses spellbook shortcut automatically. That's all.
This would work if it would happen instantly. But that's not the case.
This implementation would be terrible and clunky. If the player interferes in the wrong moment, everything goes crazy. ForceUI key is what it is: it forces a UI key. If for some reason you open the spellbook inbetween the delay, the game will instead cast the spell on the "Q" button.

If your ping is bad, players would almost instantly get annoyed by this and turn it off. And to be honest; I don't like to have a system in this map that works only 90% of the time. It feels like a broken workaround. And it is.
 
Level 7
Joined
Aug 23, 2014
Messages
208
If your ping is bad, players would almost instantly get annoyed by this and turn it off. And to be honest; I don't like to have a system in this map that works only 90% of the time. It feels like a broken workaround. And it is.
Just checked how it works with 500 ms ping. Well... Warcraft III sync system really ruins everything. Trigger fires after 1 second and makes a mess, as you said.
It is a pity that there is no local triggers that work without network sync for local player. They could be very useful in some cases.

It seems that the idea unrealizable :(

UPD:
Just found awesome native function for it!

  • Game - Disable selection and deselection functionality (Disable selection circles)
But it works for all players and all selections must be controlled via triggers. So it can be added only as a global option.
 
Last edited:
Status
Not open for further replies.
Top