Egozi44 28 Posted January 21, 2018 (edited) So I want to remove player upgrade with some unit (the moment it spawned) but I don't really know any other method aside from the UpgradeDie code (which not help me in this situation since I don't want the upgrade to be removed only when the unit dies), So aside from lua all that I have left is the RemoveUpgradeUpgrade, The issue is that I never really used RemoveUpgradeUpgrade code before, I thought at first that all I need to do was to put in in the unit's behavior (Something like this: <RemoveUpgradeUpgrade id="ModuleTag_RemoveUpgrade" UpgradeToRemove="Upgrade"/> ) similar to the GrantUpgrade code, but after Stygs -clear my suspicion I realized I need a way to trigger the remove upgrade with trigger like upgrade. That actually raised a bit more questions as for how I can trigger it, Do I need to make upgrade ID xml for the remove upgrade just like we do with normal Upgrade? Can I tell it which Type of upgrade to remove (Object or Player)? When I trigger it do I need to use Grant upgrade to trigger a upgrade that trigger the RemoveUpgradeUpgrade ? (lol) If someone could show my example or tell me of other method to remove upgrade I will be glad :/ Edited January 21, 2018 by Egozi44 Share this post Link to post
Ravendark 46 Posted January 22, 2018 Have a look at the GDI firehawk how its used. As for OBJECT <> PLAYER i don't think there is a difference on how its used. What maybe differ is the following: If the Trigger Upgrade is local (OBJECT) it will only remove the upgrade on the unit/object it is triggered on. If the trigger upgrade is global(PLAYER) it will remove the upgrade from each object that has the module in its behavior section. The following i haven't tested yet myself so this is a assumption based on logic: Object A,B and C have a PLAYER Upgrade >>> then you trigger the remove upgrade with a OBJECT upgrade From Unit A, but not from B or C, the following effect should happen: Unit A looses the Player upgrade but unit B and C don't due to it being locally trigger (OBJECT upgrade) on unit A. If you want unit B and C to loose their upgrade aswell from the localy triggered upgrade in unit A (OBJECT upgrade) you can try to add RemoveFromAllPlayerObjects="true" to the module. Or ofc use a global (PLAYER) upgrade that effect all 3 units. the RemoveFromAllPlayerObjects Needs testing, i havent used that yet myself so far. 1 Share this post Link to post
Egozi44 28 Posted February 4, 2018 Thanks, I sort of forgot to report I found other way to do it thanks to Stygs 5 mins after I opened the thread by simple give the removeupgrade code a trigger <RemoveUpgradeUpgrade id="ModuleTag_RemoveUpgrade"> <TriggeredBy>Upgrade_trigger</TriggeredBy> <UpgradeToRemove>Upgrade</UpgradeToRemove> </RemoveUpgradeUpgrade> I got stuck on other thing now but I'll open new thread for it Share this post Link to post