Hi guys.. I cant seem to find anything in the forums about my "special needs" (selling ability)
I am making a simple TD with a probe as the builder of my towers, cannons etc..
What i really want is this: An ability on the probe that can sell all my different towers/buildings with a refund rate set to 50% of the selected (taget) building.
If the ability could be placed on all the towers. that would do the trick too. Just as long its the same ability on everyone (just to keep it simple)
Example: i click on my probe. click on my sell ability and then i sell the individual towers i click on from here with a refund rate in %.. not fixed as the salvage bunker ability.
Or: I click on the building i want to sell and then on its sell ability and then i get the prober amount in refund (50%) (destroying the building in the process)
So if someone could give me an idea to make this happen in a easy way only using the data editor (or simple triggers) i would be very gratefull.
And yes... its just like the other 10000 sell abilities we run into when playing TD's. I think of it as a very simple problem but i just cant figure it out.
Highfives to the community!!! (sry for my bad spelling and gramma)
I couldn't find a way to do it with just data without making a separate version for each tower. I ended up making a dummy ability and a trigger with the event that the ability is used. The trigger gives the player a percent of the cost of the unit's cost (there's a function to get the cost).
I could be wrong about there not being a data-only solution.
I wound up using a generic salvage ability that did nothing but destroys the tower, afterwards a trigger would check what unit type was destroyed and gives the owning player of the casting ability a value of minerals back. (I did a value due to my towers having several upgrades). This way might be a bit long with triggers, but I think it works the best in terms of reliability.
I did... That's why I posted the suggestion. The way I used is 3 lines... Modify player resources, remove tower, display message stating how much was refunded.
silvermage, it's much much easier if you just use the function to get the mineral cost of the tower.
I did... That's why I posted the suggestion. The way I used is 3
lines... Modify player resources, remove tower, display message stating
how much was refunded.
silvermage, it's much much easier if you just use the function to get
the mineral cost of the tower.
Yeah he said has upgrades and he wants to refund the value of the upgrades as well.
depending on how your upgrades work.... you could keep track of the upgrade value .... on the a custom value of the units.... so you can add the ammount saved in the custom value of the triggering unit to the refunded cost.... or such... just a thought.....
if your actually morphing the tower to a different kind of tower for your upgrades... tower cost should be just fine.
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Doesn't the cost of the unit in triggers reflect the total cost spent on it; if you specify in the editor that the upgraded tower costs 700, and the original 400, the upgrade will cost 300. I believe it should refund based on 700 if the tower is upgraded.
I could be wrong, however.
EDIT: Using "" apparently adds strike-through to text. Switched to semi colon.
yeah ... but depending on what you call an "upgrade".... i could make a dummy upgrade that says adds behaviors and such to the unit....
or real data "upgrades" that modify unit properties or weapon damage this would not be picked up by unit cost....
what your talking about is.... "unit morphing" where one unit morphs into another..... then it would use the real cost of the morphed unit... but that still would not take into account the original units cost + the morph cost.... since the original units cost ... is spent towards the morphing cost....
if my cost on marine is 10.... and fire bat is 20..... and i morph a marine into a firebat.... the subtracted minerals is 10.....
so really the upgrade to firebat only costed me 10......
where the cost of the firebat is actually 20....... its been awhile since I touched that stuff though..... but its kinda like how costs on supply depos work where the cost on them is 0..... becase the real cost of each is 10 (im talking about burrowing the supply depot. all zerg burrowing works this way too)
Hi guys... I really didnt find out how to make this "sell button" work..
Thx for all the answers.. I have to admit im kind of a noob with the editor. Thats why it could be very nice if someone could explain this to me in a plain simple step-by-step way..
I have noticed that the easiest way simply might be through one trigger.. my problem here is that i suck when it comes to all other variables than interger and leaderboards :P (think thoose are pretty logic)
Yes i have searched the forums here and i rly dont find anything to use bc it get very complicated before the explanation is halfway completed.
Again sry for my bad language and hope to hear from someone who remember how it is to know "nothing" about the subject..
Peace guys.... BTW: my map is named J's maze project (eu), if anyone wants to check it out. (they will see my sell ability workin fine but not as i want it too) (want % not fixed amount)
Again as we said before, if you want a percent you have to use a trigger. Vexel suggested a great way of doing it. And I suggested a slightly longer, but just as effective way. I'll attach a screenshot of my (long) functional trigger.
Also note that I modified the salvage ability, ie removed everything it does.
Hi there not sure if you have implement the posted methods yet but I just did this and this is what I did. This seems to be the most efficient solution. I simply made a new bogus ability called Sell and based it off of stop, added it to my towers, then created this trigger...
event
Unit - Any unit uses Stop at Generic6 - Complete stage (ignore shared abilities)
...
actions
unit - remove (triggering unit) from the game
player - modify player(triggering player) minerals: add
I did a custom script for this and put in (UnitTypeGetCost(UnitGetType(EventUnit()),c_unitCostMinerals))*75/100
75 is percentage of value to be returned.
This script is very generic and efficient, enjoy!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi guys.. I cant seem to find anything in the forums about my "special needs" (selling ability)
I am making a simple TD with a probe as the builder of my towers, cannons etc..
What i really want is this: An ability on the probe that can sell all my different towers/buildings with a refund rate set to 50% of the selected (taget) building. If the ability could be placed on all the towers. that would do the trick too. Just as long its the same ability on everyone (just to keep it simple) Example: i click on my probe. click on my sell ability and then i sell the individual towers i click on from here with a refund rate in %.. not fixed as the salvage bunker ability. Or: I click on the building i want to sell and then on its sell ability and then i get the prober amount in refund (50%) (destroying the building in the process)
So if someone could give me an idea to make this happen in a easy way only using the data editor (or simple triggers) i would be very gratefull. And yes... its just like the other 10000 sell abilities we run into when playing TD's. I think of it as a very simple problem but i just cant figure it out.
Highfives to the community!!! (sry for my bad spelling and gramma)
@EightLeggedJ: Go
I couldn't find a way to do it with just data without making a separate version for each tower. I ended up making a dummy ability and a trigger with the event that the ability is used. The trigger gives the player a percent of the cost of the unit's cost (there's a function to get the cost).
I could be wrong about there not being a data-only solution.
@Vexal: Go
You do want to use a trigger for this.....
you should search for it... theres many examples already on here.
@EightLeggedJ: Go
I wound up using a generic salvage ability that did nothing but destroys the tower, afterwards a trigger would check what unit type was destroyed and gives the owning player of the casting ability a value of minerals back. (I did a value due to my towers having several upgrades). This way might be a bit long with triggers, but I think it works the best in terms of reliability.
@SouLCarveRR: Go
I did... That's why I posted the suggestion. The way I used is 3 lines... Modify player resources, remove tower, display message stating how much was refunded.
silvermage, it's much much easier if you just use the function to get the mineral cost of the tower.
Yeah he said has upgrades and he wants to refund the value of the upgrades as well.
depending on how your upgrades work.... you could keep track of the upgrade value .... on the a custom value of the units.... so you can add the ammount saved in the custom value of the triggering unit to the refunded cost.... or such... just a thought.....
if your actually morphing the tower to a different kind of tower for your upgrades... tower cost should be just fine.
@SouLCarveRR: Go
Doesn't the cost of the unit in triggers reflect the total cost spent on it; if you specify in the editor that the upgraded tower costs 700, and the original 400, the upgrade will cost 300. I believe it should refund based on 700 if the tower is upgraded.
I could be wrong, however.
EDIT: Using "
" apparently adds strike-through to text. Switched to semi colon.@Vexal: Go
yeah ... but depending on what you call an "upgrade".... i could make a dummy upgrade that says adds behaviors and such to the unit....
or real data "upgrades" that modify unit properties or weapon damage this would not be picked up by unit cost....
what your talking about is.... "unit morphing" where one unit morphs into another..... then it would use the real cost of the morphed unit... but that still would not take into account the original units cost + the morph cost.... since the original units cost ... is spent towards the morphing cost....
if my cost on marine is 10.... and fire bat is 20..... and i morph a marine into a firebat.... the subtracted minerals is 10..... so really the upgrade to firebat only costed me 10......
where the cost of the firebat is actually 20....... its been awhile since I touched that stuff though..... but its kinda like how costs on supply depos work where the cost on them is 0..... becase the real cost of each is 10 (im talking about burrowing the supply depot. all zerg burrowing works this way too)
Hi guys... I really didnt find out how to make this "sell button" work..
Thx for all the answers.. I have to admit im kind of a noob with the editor. Thats why it could be very nice if someone could explain this to me in a plain simple step-by-step way..
I have noticed that the easiest way simply might be through one trigger.. my problem here is that i suck when it comes to all other variables than interger and leaderboards :P (think thoose are pretty logic)
Yes i have searched the forums here and i rly dont find anything to use bc it get very complicated before the explanation is halfway completed.
Again sry for my bad language and hope to hear from someone who remember how it is to know "nothing" about the subject..
Peace guys.... BTW: my map is named J's maze project (eu), if anyone wants to check it out. (they will see my sell ability workin fine but not as i want it too) (want % not fixed amount)
@EightLeggedJ: Go
Again as we said before, if you want a percent you have to use a trigger. Vexel suggested a great way of doing it. And I suggested a slightly longer, but just as effective way. I'll attach a screenshot of my (long) functional trigger.
Also note that I modified the salvage ability, ie removed everything it does.
@silvermage: Go
Thx for the help mate!
This works just fine and very simple..
Hi there not sure if you have implement the posted methods yet but I just did this and this is what I did. This seems to be the most efficient solution. I simply made a new bogus ability called Sell and based it off of stop, added it to my towers, then created this trigger...
event Unit - Any unit uses Stop at Generic6 - Complete stage (ignore shared abilities)
...
actions unit - remove (triggering unit) from the game player - modify player(triggering player) minerals: add I did a custom script for this and put in (UnitTypeGetCost(UnitGetType(EventUnit()),c_unitCostMinerals))*75/100 75 is percentage of value to be returned.
This script is very generic and efficient, enjoy!