lep / jassdoc

Document the WarCraft 3 API
52 stars 20 forks source link

Some curious findings about events #136

Open WaterKnight opened 4 months ago

WaterKnight commented 4 months ago

Since there are gaps in the event ids (https://docs.google.com/spreadsheets/d/1-NSMX9DMqIEAqvLgb_dYNZnM3bKYkittpePcB5_cnAc/edit#gid=0), I have been searching for hidden events with bruteforce methods. So far, there has not been too much luck, but still there were some curious things to be observed.

TriggerRegisterDialogEvent emits event id 92 rather than EVENT_DIALOG_CLICK = ConvertDialogEvent(91). 92 is not listed, seems to be a confusion. I could not get 91 to be emitted.

The unnamed event id 316 is used for TriggerRegisterCommandEvent and TriggerRegisterUpgradeCommandEvent.

The newer 1.31 event responses can be called in unrelated contexts and tap into (seemingly other event) data. See attached picture where they are called in a mouse move event (event id 307) or unit damaged event (event id 52).

image

image

In TriggerRegisterPlayerChatEvent context, BlzGetTriggerFrameText and BlzGetTriggerSyncPrefix yield the entered chat string.

BlzGetTriggerFrameText, BlzGetTriggerSyncPrefix, and BlzGetTriggerSyncData can crash the game when called in wrong context.