Jump to content
Sign in to follow this  
Egozi44

Creative way to block upgrade button from being used?

Recommended Posts

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 by Egozi44

Share this post


Link to post

It should work exactly as you describe it. You're doing something wrong.

Share this post


Link to post

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 by Egozi44

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×