Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI Triggers: buggy specifications in triggerdata.txt #20

Open
Luashine opened this issue Dec 6, 2023 · 3 comments
Open

GUI Triggers: buggy specifications in triggerdata.txt #20

Luashine opened this issue Dec 6, 2023 · 3 comments

Comments

@Luashine
Copy link

Luashine commented Dec 6, 2023

External URLs

No response

Game Versions

1.36.0 (1.36.0.20144, 1.36.0.20171, 1.36.0.20200, 1.36.0.20210)

Summary

The functions' specifications in "triggerdata.txt" (for WorldEditor GUI trigger use) have unintended typos.

Description

1. BlzGetUnitCollisionSize is not categorized

_BlzGetUnitCollisionSize=TC_UNIT is supposed to be
_BlzGetUnitCollisionSize_Category=TC_UNIT

2. BlzGetAbilityRealLevelField does not have limits specified

_BlzGetAbilityRealLevelField_Limites=_,_,_,_,0,_ is supposed to be _BlzGetAbilityRealLevelField_Limits=_,_,_,_,0,_ (typo in Limits)

3. TriggerRegisterUnitInRangeSimple has Defaults specified twice

_TriggerRegisterUnitInRangeSimple_Defaults=256,_
_TriggerRegisterUnitInRangeSimple_Defaults=0,_,_,_

Result: the first "Defaults" is applied with 256,_ -- also that's matching the function signature, because it only has 2 user-defined parameters.

4. SetTimeOfDayScalePercentBJ: Defaults specified twice

_SetTimeOfDayScalePercentBJ_Defaults=100
_SetTimeOfDayScalePercentBJ_Defaults=0,_

Result: the 100 value is applied, it's also the one with correct number of parameters.

5. SetUnitLifeBJ: double defaults

_SetUnitLifeBJ_Defaults=GetTriggerUnit,GetUnitStateSwap
_SetUnitLifeBJ_Defaults=_,_,0,_

Result: the former is applied, OK

Fix: Second Defaults look like it is supposed to be _Limits

6. _BlzSetAbilityIntegerLevelFieldBJ_Defaults: doubled

_BlzSetAbilityIntegerLevelFieldBJ_Defaults=_,_,0,50
_BlzSetAbilityIntegerLevelFieldBJ_Defaults=_,_,_,_,0,_,0,_

Fix: Second Defaults look like it is supposed to be _Limits

7. CreateFogModifierRadiusLocBJ_Defaults: doubled

_CreateFogModifierRadiusLocBJ_Defaults=EnabledDisabledEnabled,Player00,FogStateVisible,GetRectCenter,512
_CreateFogModifierRadiusLocBJ_Defaults=_,_,_,_,_,_,_,_,0,_

Fix: Second Defaults look like it is supposed to be _Limits

Duplicate _Defaults property

The line was duplicated and it looks like the second entry was always supposed to be called _Limits (because twice the values specified, for min/max limit respectively)

_BlzSetAbilityIntegerLevelField_Defaults=_,_,0,50
_BlzSetAbilityIntegerLevelField_Defaults=_,_,_,_,0,_,0,_
---

Additional Information

Based on w3t-1.36.0.20144-b8db0de

Search with grep/ripgrep:

rg '^_' war3.w3mod/ui/triggerdata.txt | rg -v '_(Defaults|Category|CATEGORY|Parameters|DisplayName|Limits|ScriptName|UseWithAI|AIDefaults)'

Expected

Correct definitions

Actual

BlzGetUnitCollisionSize: "Collision Size" does not have an assigned category in editor

BlzGetAbilityRealLevelField: a negative ability level can be entered due to missing limits

Reproduction steps

In GUI Trigger editor: set variable real = ... for both

TriggerRegisterUnitInRangeSimple: Create new Trigger Event and select "Unit - Unit Within Range" to view the defaults.

SetTimeOfDayScalePercentBJ Create new trigger action: "Game - Set Time of Day Speed"

Workaround

No response

Screenshots, test maps, other material

No response

@Luashine Luashine changed the title GUI Triggers: buggy specification for BlzGetUnitCollisionSize and BlzGetAbilityRealLevelField GUI Triggers: buggy specifications in triggerdata.txt Dec 6, 2023
@Luashine
Copy link
Author

Luashine commented Dec 6, 2023

I changed the title and noted all issues that are present in triggerdata.txt. They don't appear game editor breaking, but still wrong. I will rewrite the text again in a minute for better presentation.

@GrapesOfWath
Copy link

the second line of each of the duplicate Defaults entries is definitely supposed to be a limits entry yeh

@Luashine
Copy link
Author

Luashine commented Dec 31, 2023

TriggerRegisterCommonCommandEventBJ has no parameters specified (jassdoc link):

TriggerRegisterCommonCommandEventBJ=1,unitcommonorderEx
_TriggerRegisterCommonCommandEventBJ_Defaults=_
_TriggerRegisterCommonCommandEventBJ_Category=TC_GAME

Same for CreateCommonCommandButtonEffectBJ (jassdoc)

CreateCommonCommandButtonEffectBJ=1,unitcommonorderEx
_CreateCommonCommandButtonEffectBJ_Defaults=
_CreateCommonCommandButtonEffectBJ_Category=TC_GAME

I have not looked at these in the WE, but they both use the type unitcommonorderEx.


Tilde type parameters not separated by a comma (1.36.0.20144):

rg '"~'
triggerdata.txt
4665:_PingMinimapLocForForceEx_Parameters="Ping minimap for ",~Player Group," at ",~Point," for ",~Duration," seconds, using a ",~Style," ping of color ("~Red,"%, ",~Green,"%, ",~Blue,"%)"
4715:_SetMinimapIconVisible_Parameters="Set Minimap Icon Visible for ",~Minimap Icon," to "~Visible
4721:_SetMinimapIconOrphanDestroy_Parameters="Set Minimap Icon ",~Minimap Icon," self destroy when attached unit is dead to "~type
8636:_BlzGetAbilityBooleanField_Parameters="Ability: ",~Ability,"'s Boolean Field: "~BooleanField
9999:_BlzGetAbilityIntegerField_Parameters="Ability: ",~Ability,"'s Integer Field: "~IntegerField
10653:_BlzGetAbilityRealField_Parameters="Ability: ",~Ability,"'s Real Field: "~RealField
10919:_BlzGetAbilityStringField_Parameters="Ability: ",~Ability,"'s String Field: "~StringField

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants