Its a tower defense, there no "evolution" tower. The tower can have multiple effect (Upgrade) added for a certain cost (as example, splash 1.0 range, cost 5 mineral, then can be upgrade again for 2.0 cost 10 etc...). I want to be able to track the value of those buff so if I salvage the tower I get the same amount of mineral back as I invested. I tryed to use SetCustomValue, but player property or modify variable cannot use that value.
Clear question :
It is possible to track down a "local" integer on a target that can be tracked back with Modify player property?
This is the salvage script I currently "tested" a freaking giant retarded loop that I have no intention to use, that was just a test. Yet that the only idea I found to keep track of it.
I see its your first post, not a very friendly introduction but i might be able to help you out.
A while ago i needed a refund trigger and made this small trigger that refunds 0.75 of the units original cost.
What i thought you could do is for every upgrade you do on this structure, add to the cost of that unit with the same amount that the upgrade cost.
So what to do:
Copy and adjust the trigger to your needs.
Make an instant effect ability and add it to the event of the trigger and the units commandcard.
For each upgrade on the unit you need to apply an effect that increases the cost of the unit by the amount of the upgrade cost.
This method will only work if the player has only 1 unit of this specific unit type and if you also want other players to also have this structure you must copy it and make a new one for each player.
I assume you want more units of this type for a single player so this means whenever a player has the unit with upgrades and wants to make a new one, the cost has increased.... I couldn't think of any other way, im not a pro so there is prolly a better way., but maybe this will lead you to ideas.
Yes, you can "store" an integer (actually a float) in a unit. Use the UnitSetCustomValue(unit, index, value) function, where:
- unit is the unit in which you want to store your value
- index is the index of your value (consider this as if your unit were an array and this is the index where you want to put your value)
- value is... the value !
You can then access your value with UnitGetCustomValue(unit, index).
If you have problems with using custom values you must know that it only works for real values (i think). So you must use Convert integer to real first nad then use Custom value of unit.
Wanted 100% of the value back :) regardless after 1 hour of scripting I found a good way to handle all that. Thank you for the help :) first demand and answer in a period of 24 hour.
Its how I did it. You can mark the topic solved :)
Situation :
Its a tower defense, there no "evolution" tower. The tower can have multiple effect (Upgrade) added for a certain cost (as example, splash 1.0 range, cost 5 mineral, then can be upgrade again for 2.0 cost 10 etc...). I want to be able to track the value of those buff so if I salvage the tower I get the same amount of mineral back as I invested. I tryed to use SetCustomValue, but player property or modify variable cannot use that value.
Clear question :
It is possible to track down a "local" integer on a target that can be tracked back with Modify player property?
This is the salvage script I currently "tested" a freaking giant retarded loop that I have no intention to use, that was just a test. Yet that the only idea I found to keep track of it.
@ILikeKillAndYou: Go
I see its your first post, not a very friendly introduction but i might be able to help you out. A while ago i needed a refund trigger and made this small trigger that refunds 0.75 of the units original cost. What i thought you could do is for every upgrade you do on this structure, add to the cost of that unit with the same amount that the upgrade cost. So what to do:
This method will only work if the player has only 1 unit of this specific unit type and if you also want other players to also have this structure you must copy it and make a new one for each player.
I assume you want more units of this type for a single player so this means whenever a player has the unit with upgrades and wants to make a new one, the cost has increased.... I couldn't think of any other way, im not a pro so there is prolly a better way., but maybe this will lead you to ideas.
@ILikeKillAndYou: Go
Yes, you can "store" an integer (actually a float) in a unit. Use the UnitSetCustomValue(unit, index, value) function, where: - unit is the unit in which you want to store your value - index is the index of your value (consider this as if your unit were an array and this is the index where you want to put your value) - value is... the value !
You can then access your value with UnitGetCustomValue(unit, index).
@ILikeKillAndYou: Go
If you have problems with using custom values you must know that it only works for real values (i think). So you must use Convert integer to real first nad then use Custom value of unit.
Wanted 100% of the value back :) regardless after 1 hour of scripting I found a good way to handle all that. Thank you for the help :) first demand and answer in a period of 24 hour.
Its how I did it. You can mark the topic solved :)
@ILikeKillAndYou: Go
so i did give you ideas, yay :p
You can close the topic yourself by edtiting the name.