I want an ability to give 50 minerals to the user when used. Under Cost>Resource>Minerals i set it to -50, but it doesn't work.. When building buildings it uses a different interface for the cost, so i have nothing to reference off of :(.. Any help is greatly appreciated =/.
I had trouble with this as well and got no reply for my post but I did find that Using the Stop Ability and then from that using a trigger Event to process the action however my problem was that it only worked for 1 trigger, so if you did this it wouldn't work for 2 things.
Events
Unit - Any Unit uses Stop at Generic1 - Any stage (Ignore shared abilities)
Local Variables
Conditions
Actions
Player - Modify player (Owner of (Triggering unit)) Minerals: Add 50
You can do this purely in the data editor too, its really simple and does what you want. And since this is so simple you really should use the data editor instead of a trigger so you have one less trigger running and hurting performance, this way is more efficient. I assume you already have your ability set up somewhere with a button that you click in game?
Then just go to data editor, go to the"Effects" data type tab, right-click the top-left list box and choose "Add Object...". Name it like "Add Minerals" and click the suggest button, then in the "Effect Type:" drop down box, choose "Modify Player" and click OK. Now make sure you have table view selected (menu View->Show Table View, its just easier) and select the newly created "Add Minerals" effect on the left if it isnt already. Now look at the table on the right, find the "Effect - Resources" field, double click the cell next to it, choose Minerals, and type the value you want in the box below, and hit OK. Now go to the "Abilities" data type tab and select your ability. Make sure its of the type "Effect - Instant", if it isnt, double click it and you can change the ability type. Now double click next to the "Effect - Effect" field, click the green button to add a new entry, find "Add Minerals" in the list, hit ok, and should be all set to go.
Seems like alot, but thats only because I explained every step. Takes like 10 seconds.
You can do this purely in the data editor too, its really simple and does what you want. And since this is so simple you really should use the data editor instead of a trigger so you have one less trigger running and hurting performance, this way is more efficient. I assume you already have your ability set up somewhere with a button that you click in game?
Then just go to data editor, go to the"Effects" data type tab, right-click the top-left list box and choose "Add Object...". Name it like "Add Minerals" and click the suggest button, then in the "Effect Type:" drop down box, choose "Modify Player" and click OK. Now make sure you have table view selected (menu View->Show Table View, its just easier) and select the newly created "Add Minerals" effect on the left if it isnt already. Now look at the table on the right, find the "Effect - Resources" field, double click the cell next to it, choose Minerals, and type the value you want in the box below, and hit OK. Now go to the "Abilities" data type tab and select your ability. Make sure its of the type "Effect - Instant", if it isnt, double click it and you can change the ability type. Now double click next to the "Effect - Effect" field, click the green button to add a new entry, find "Add Minerals" in the list, hit ok, and should be all set to go.
Seems like alot, but thats only because I explained every step. Takes like 10 seconds.
Sweet alright thanks a lot man!
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I want an ability to give 50 minerals to the user when used. Under Cost>Resource>Minerals i set it to -50, but it doesn't work.. When building buildings it uses a different interface for the cost, so i have nothing to reference off of :(.. Any help is greatly appreciated =/.
I had trouble with this as well and got no reply for my post but I did find that Using the Stop Ability and then from that using a trigger Event to process the action however my problem was that it only worked for 1 trigger, so if you did this it wouldn't work for 2 things.
Events
Unit - Any Unit uses Stop at Generic1 - Any stage (Ignore shared abilities)
Local Variables
Conditions
Actions
Player - Modify player (Owner of (Triggering unit)) Minerals: Add 50
@MapCrafter: Go
Thanks.. too bad i dont know shit about triggers yet -.-
Just open your trigger editor and create a new trigger, add a new event and find "Unit Uses an Ability" and fill in the remaining fields.
In actions create a new and scroll down to Player, Select modify player property and fill in the remaining fields.
Triggers are not hard to understand, they are after all a controlled language that if understood should work.
@LeetBox: Go
You can do this purely in the data editor too, its really simple and does what you want. And since this is so simple you really should use the data editor instead of a trigger so you have one less trigger running and hurting performance, this way is more efficient. I assume you already have your ability set up somewhere with a button that you click in game?
Then just go to data editor, go to the"Effects" data type tab, right-click the top-left list box and choose "Add Object...". Name it like "Add Minerals" and click the suggest button, then in the "Effect Type:" drop down box, choose "Modify Player" and click OK. Now make sure you have table view selected (menu View->Show Table View, its just easier) and select the newly created "Add Minerals" effect on the left if it isnt already. Now look at the table on the right, find the "Effect - Resources" field, double click the cell next to it, choose Minerals, and type the value you want in the box below, and hit OK. Now go to the "Abilities" data type tab and select your ability. Make sure its of the type "Effect - Instant", if it isnt, double click it and you can change the ability type. Now double click next to the "Effect - Effect" field, click the green button to add a new entry, find "Add Minerals" in the list, hit ok, and should be all set to go.
Seems like alot, but thats only because I explained every step. Takes like 10 seconds.
@Joshjje: Go
Sweet alright thanks a lot man!