I'm creating an ability to abandon your base (main structure uses ability, it and all nearby structures change players). To ensure that you don't steal another persons old base when you reactivate one, I use custom values to store which structure the abandoned building used to belong to. In a nutshell: use abandon base ability > set custom value to owner > change owner > alert base is abandoned.
The issue arises when the custom value changes to the player (player 1) then changes again another 6 or so times after the trigger ended (see below code for explanation), and seeing as the new player is neutral the custom value changes to 15 rather than 1. How do I stop it?
I tested this trigger on a single unit. The custom value was changed to 1 (current owner), then the last alert was displayed (trigger ended), then the custom value was displayed another 6 or so times matching player 15 (new owner).
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm creating an ability to abandon your base (main structure uses ability, it and all nearby structures change players). To ensure that you don't steal another persons old base when you reactivate one, I use custom values to store which structure the abandoned building used to belong to. In a nutshell: use abandon base ability > set custom value to owner > change owner > alert base is abandoned.
The issue arises when the custom value changes to the player (player 1) then changes again another 6 or so times after the trigger ended (see below code for explanation), and seeing as the new player is neutral the custom value changes to 15 rather than 1. How do I stop it?
I tested this trigger on a single unit. The custom value was changed to 1 (current owner), then the last alert was displayed (trigger ended), then the custom value was displayed another 6 or so times matching player 15 (new owner).