• 🏆 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!

[Trigger] Local Player and Ability Modify

Level 20
Joined
Jul 12, 2010
Messages
1,717
Hello everybody, I was testing locally changing Ability Descriptions and Icons and it seems to work BUT I want to be 100% it doesn't desync before I start mass implementing it into my map.

  • Chat
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -1
        • Then - Actions
          • Ability - Set Tooltip of Ability Test 1 to Weapon +2 for level 0
          • Ability - Set Extended Tooltip of Ability Test 1 to Testing New Description|n|nNew Trigger for level 0
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Entered chat string) Equal to -2
            • Then - Actions
              • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
              • Ability - Set Tooltip of Ability Test 1 to Weapon +3 Local for level 0
              • Ability - Set Extended Tooltip of Ability Test 1 to Testing New Description|n|nNew Trigger Local Player for level 0
              • Custom script: endif
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Entered chat string) Equal to -3
                • Then - Actions
                  • Custom script: if GetLocalPlayer() == GetTriggerPlayer() then
                  • Ability - Set Icon of Ability Test 2 to ReplaceableTextures\CommandButtons\BTNMoonArmor.blp
                  • Ability - Set Tooltip of Ability Test 2 to Armor +5 for level 0
                  • Ability - Set Extended Tooltip of Ability Test 2 to Your Hero now has an amazing armor! for level 0
                  • Custom script: endif
                • Else - Actions

I also tested this on LAN and it didn't cause any desyncs but again I want to be 100% sure because I was super surprised that these triggers seem to be asynchronous.

Warcraft_III_QRUyObJVxh.jpg

I attached the test map if anybody wants to give it a go.
 

Attachments

  • Desync Test.w3m
    18.2 KB · Views: 3

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,557
If that doesn't answer your question, I believe @Tasyen would know (thanks!)
 
They need to be async as the game supports many languages, all of them most likely have an unique tooltip. And the tooltips do not matter for the gamestate anyway, they are for the player not for the game.
It is said that: there can be a desync because of a dismatching stringlist, I don't believe it. But if you want to be 100% safe create the strings in sync space and then in GetLocalPlayer use the value you created outside of GetLocalPlayer. (Edit: oh the Linked posts say something similiar)

  • At 0s
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set NewTooltip = Whatever
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Local Player Equal to (Triggering player)
        • Then - Actions
          • Ability - Set Tooltip of Holy Light to NewTooltip for level 0
        • Else - Actions
 
Top