• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Weird Selection Bug using Channel+Spellbook

Status
Not open for further replies.
Level 5
Joined
Sep 29, 2016
Messages
43
Hi guys,

i've tried to create a map myself. However i got a weird problem:

First example:
A Unit has a spellbook. That spellbook has a Channel Spell, Follow Trough Time: 5, Visible Activated.
Trigger: If that unit uses that Channel spell, make the Owner of Triggering Unit select the other unit.
-> Other unit is selected. UI (Move, Attack, anything) vanished. Rightclick movement is possible, Hotkey AttackMove/Stop/Hold Position/etc. do not work.
If you click on the 2nd unit, nothing changes. If you Double click the unit, UI appears again.

Second example:
A Unit has NO spellbook. The Channel Spell is added to the unit, Follow Through Time: 5, Visible Activated.
Trigger: If that unit uses that Channel spell, make the Owner of Triggering Unit select the other unit.
-> Other unit is selected. UI is visible.

I attached a map, where you can test both examples.
You guys got any idea on how to solve it? (while still using lots of abilities inside spellbook)
Or is it a bug, that should be fixed for 1.31?

Edit: Wasn't sure if i should post it in Triggers & Scripts or Patch discussion. I'm not sure if i did something wrong or if it is a bug.
 

Attachments

  • SpellBookChannelSelectionBug.w3x
    17.5 KB · Views: 23
Last edited:
Level 8
Joined
May 21, 2019
Messages
435
Sounds like some odd bug where the game somehow thinks that the other unit is in a channelling state when a spellbook is open as it is selected. Maybe a possible workaround is to first clear the players selection, and then pick the other unit?
I will test this once I have a map editor on me, try my suggestion in the meantime if you can.
 
Level 8
Joined
May 21, 2019
Messages
435
Didn't work. Apparently Clear Selection doesn't clear selection in that case. This thing doesn't happen with other Instant Spells like War Stomp, but i do need to change the Base Order IDs.
Alright, got my home PC and world editor.
I found the root of the issue, and it is as I suspected, the spellbook is preventing the UI from loading properly. No amount of selections swapping and tricks seems to close the spellbook. So... I closed it manually:
  • Normal Trigger
    • Events
      • Unit - Weird Unit 0003 <gen> Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Weird Channel
    • Actions
      • Game - Force (Owner of (Casting unit)) to press Escape/Cancel
      • Selection - Select Archmage 0002 <gen> for Player 1 (Red)
Tested, and it works.
 
Level 8
Joined
May 21, 2019
Messages
435
It worked! Thanks for the help. It seems to be an odd issue with an odd way to solve it.
Well, the issue makes sense if you think about it.
The UI of the spellbook takes up the same space as the base character skills. On a regular selection swap, the game expects to close down a normal unit UI, not a spellbook, so the game doesn't close down the spellbook. This is done with a manual selection, because they accounted for that scenario, which is why double clicking the unit works (as you mentioned), because that executes a regular selection that overwrites the trigger executed one, which accounts for closing down spellbooks. Either way, this fix simply closed down the spellbook, so the trigger selection worked as intended.

Does it make sense or am I rambling? Haha. :D
 
Level 5
Joined
Sep 29, 2016
Messages
43
Well, your explanation does make sense for this situation. But it technically would mean, that the game is missing the action to unselect/close a spellbook UI in case the player is currently in one. Still i don't understand the difference in Selections, or why there is actually a difference between Manual Single Click, Manual Double Click & Trigger Selection...
 
Level 8
Joined
May 21, 2019
Messages
435
Well, your explanation does make sense for this situation. But it technically would mean, that the game is missing the action to unselect/close a spellbook UI in case the player is currently in one. Still i don't understand the difference in Selections, or why there is actually a difference between Manual Single Click, Manual Double Click & Trigger Selection...
The difference between manual single click / double click is fairly simple. If you select multiple units, a single click will switch your selected unit in your selection group. Double clicking, however, clears the entire selection group and selects the single unit. Therefore, the game needs to be able to distinguish the two, as they have very different functions.
As for the trigger selection. It makes sense if you have some general programming experience.
Basically, what it implies, is that the trigger selection doesn't call either of the functions associated with the manual clicks, it just writes directly to the state of the selection.

To put it in perspective, here's something that roughly resembles what the 3 things would look like if they were triggers:

Code:
EVENT: A player Single-Clicks
ACTIONS:
Unselect Selection
Select Clicked Unit.

Code:
EVENT: A player Double-Clicks
ACTIONS:
Clear Selection Group
Unselect Selection
Select Clicked Unit.

Code:
EVENT: Trigger
ACTIONS:
Set Selection = Unit

This is just an illustration of sorts. I have no idea what the real code looks like. But basically, this is why they are different. They are done in different ways. It's also entirely possible that the trigger actually invokes the single click selection. I think it does, given how it gives off that selection sound when it's done.
 
Level 5
Joined
Sep 29, 2016
Messages
43
Well it does make sense, and i do think that the Trigger - Selection "Something" is the same as a Manual Click.
But that means that they use some ways that are not reproducable with GUI to generate the Manual Double Click - Event. Your examples are good, but part of the Clear Selection thing apparently doesn't do what it should to get the player out of that UI.

Thanks for explaining
 
Status
Not open for further replies.
Top