Egozi44 27 Posted February 4, 2018 (edited) So I trying to make upgrade button that will act similar to Training button of unique unit like a Commando or epic unit (meaning it will spawn the unit after the "upgrade" was "researched" and that the button won't let it be train again till the unit dies and remove the upgrade). Thanks to Mjistral's lua codes we were able to create upgrade that fit the conditions but after the last change (Which was: adding StatusBitsUpgrade code that have StatusToClear code in it which is in the trained unit's gameobject xml for lua script reasons) The lua command that make the upgrade button unpressable when X unit was trained no longer works. So I tried few other things via xml like adding Forbddienupgrade code to the upgradetemplet GameDependency but from what I tested earlier (even before we made that upgrade button) the GameDependency doesn't seem to work with Forbddienupgrade code if there's already other code like RequiredObject (which I using for other thing that I need) or maybe even doesn't work at all (never really tried it alone, just saw it don't work if there's already other gamedependency code~ ), And as far as I know there isn't any forbidden object code, So is there anything else I can use to make the upgrade unavailable? (without killing the RequiredObject dummy cause I need it) Edited February 4, 2018 by Egozi44 Share this post Link to post
Lauren 77 Posted February 4, 2018 It should work exactly as you describe it. You're doing something wrong. Share this post Link to post
Egozi44 27 Posted February 4, 2018 (edited) Seem like it was because the upgrade was set to object type and not player type, I did recall I tested both long ago and they both didn't worked with ForbiddenUpgrade, but it seem my memory was off. Edited February 4, 2018 by Egozi44 Share this post Link to post