Jump to content
Sign in to follow this  
Egozi44

Few questions in regard to RemoveUpgradeUpgrade code

Recommended Posts

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

Share this post


Link to post

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.

 

 

  • Upvote 1

Share this post


Link to post

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

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.

×