I'm trying to make an ability hide default and then get activated by a trigger later in the game but i can't figure out how to hide the ability by default.
I do not have access to the Data Editor right now, but I do believe you need to go to (Commands +). Then there should be a drop down box down box titled "State" or "Availability" I do not remember which. Select from that "Available". Maybe someone with access to the editor would be better to answer this right now =P
I removed it from the command card and tried to use a show trigger but its not working for some reason. I could use the hide/show trigger for each ability but because of how my game works it will be extremely long and tedious even if i copy and paste the commands. Is there any other way?
There are two ways you can accomplish this that I know of:
The less complicated way is to have a trigger that runs on map initialization and call "Unit - Hide the <ability name> ability for <specific unit>". Note that this only hides the ability for that specific unit. Any newly created units of that unit type will not have the ability hidden. Not sure about reviving units, you'll have to test that. As a side note, this will not work if you are just using a button on the command card with no ability attached to it as the trigger requires an ability.
The harder way is to create a new upgrade for that ability. The upgrade doesn't need to do anything, just exist. Under "Affected Unit Array" add in the unit that will be using the ability. Now make a new Requirement and double click "Requirement - Node Link". There are two folders, "Use" and "Show". Since you want the ability to be invisible from the start, right-click the "Show" folder and choose "Add Requirement Node". Set the following:
Type: Count Upgrade
Alias: <the upgrade you created previously>
State: Completed
And hit OK. Now go back to your unit and into the command card. Add the ability to the command card and for the "Requirement" field choose the Requirement you created. When you start up the game the ability should be gone. And whenever you want to give the ability to the unit just call " Tech Tree - Add 1 to <upgrade name> upgrade for player (Owner of (Triggering unit))" from a trigger.
A side note. Unless I miss my guess it sounds like you have a lot of abilities that will be constantly hiding and showing. Might I recommend that you make a couple ability arrays for like abilities (divided up however you need it) and set them up when the map initializes. From there you can use for loops and switch statements to do what you want rather than a whole lot of if/then/elseif statements.
If you want each unit to gain access to the ability at a different time then yes. But if you want all units who have the ability to learn it at the same time then an upgrade is the way to go.
Long answer:
If you want multiple abilities at different levels across multiple units then go with the 'hide at map init' approach. Because using Upgrades/Requirements will make all units of that type for that player have the ability when you trigger the upgrade. If some of these abilities are different levels of the same ability then make some arrays so you can call "Hide <abilityA>[x]" and "Show <abilityA>[x+1]". If not then get ready for some slogging.
It doesn't seem to be working; under upgrades i made a copy of Protoss Air Upgrade and named it "Hide Ability" and changed the Affected Unit Array into "Changeling". Then i made a new Requirement and named it Ability Hide, i right clicked the show folder and copied your settings:
Then i added my new requirement under the tab "Requirements" under "Command Type" in the units section under ability.
And yes i want each unit to gain access to the ability at different times.
In the Requirement where you set the Type/Alias/State also make sure "Tech Tree Cheat" is checked. Not sure if that will fix it or not, but it's checked for the ability I made. Sorry I missed that.
But if you want them to gain access to the ability at different times then the Upgrade/Requirement approach won't work. That only works if you have 1 unit or if u want all units to gain access to the ability at the same time. You'll have to hide the ability with triggers at map init or each time the unit is created, then show it when you want that particular unit to have access to it. If the units start off already created when the map loads then you could do something like:
Otherwise just have a trigger that fires each time a unit of the given unit type is created and call Hide on the Triggering Unit. Then have another one that triggers based off whichever event you want and calls Show for the Triggering Unit.
I'm trying to make an ability hide default and then get activated by a trigger later in the game but i can't figure out how to hide the ability by default.
I do not have access to the Data Editor right now, but I do believe you need to go to (Commands +). Then there should be a drop down box down box titled "State" or "Availability" I do not remember which. Select from that "Available". Maybe someone with access to the editor would be better to answer this right now =P
Use the show/hide ability trigger. Hide the ability when the unit spawns.
Yes I know this is the data section, but personally I can't find any other way.
simply remove it from the command card. done
edit: if you want to show it again later, there are show/hide triggers. as said above
I removed it from the command card and tried to use a show trigger but its not working for some reason. I could use the hide/show trigger for each ability but because of how my game works it will be extremely long and tedious even if i copy and paste the commands. Is there any other way?
@Chairmang: Go
There are two ways you can accomplish this that I know of:
The less complicated way is to have a trigger that runs on map initialization and call "Unit - Hide the <ability name> ability for <specific unit>". Note that this only hides the ability for that specific unit. Any newly created units of that unit type will not have the ability hidden. Not sure about reviving units, you'll have to test that. As a side note, this will not work if you are just using a button on the command card with no ability attached to it as the trigger requires an ability.
The harder way is to create a new upgrade for that ability. The upgrade doesn't need to do anything, just exist. Under "Affected Unit Array" add in the unit that will be using the ability. Now make a new Requirement and double click "Requirement - Node Link". There are two folders, "Use" and "Show". Since you want the ability to be invisible from the start, right-click the "Show" folder and choose "Add Requirement Node". Set the following:
Type: Count Upgrade
Alias: <the upgrade you created previously>
State: Completed
And hit OK. Now go back to your unit and into the command card. Add the ability to the command card and for the "Requirement" field choose the Requirement you created. When you start up the game the ability should be gone. And whenever you want to give the ability to the unit just call " Tech Tree - Add 1 to <upgrade name> upgrade for player (Owner of (Triggering unit))" from a trigger.
A side note. Unless I miss my guess it sounds like you have a lot of abilities that will be constantly hiding and showing. Might I recommend that you make a couple ability arrays for like abilities (divided up however you need it) and set them up when the map initializes. From there you can use for loops and switch statements to do what you want rather than a whole lot of if/then/elseif statements.
what if i have multiple units using the same ability? Will i have to do this multiple times for unit?
@Chairmang: Go
Short answer:
If you want each unit to gain access to the ability at a different time then yes. But if you want all units who have the ability to learn it at the same time then an upgrade is the way to go.
Long answer:
If you want multiple abilities at different levels across multiple units then go with the 'hide at map init' approach. Because using Upgrades/Requirements will make all units of that type for that player have the ability when you trigger the upgrade. If some of these abilities are different levels of the same ability then make some arrays so you can call "Hide <abilityA>[x]" and "Show <abilityA>[x+1]". If not then get ready for some slogging.
It doesn't seem to be working; under upgrades i made a copy of Protoss Air Upgrade and named it "Hide Ability" and changed the Affected Unit Array into "Changeling". Then i made a new Requirement and named it Ability Hide, i right clicked the show folder and copied your settings:
Type: Count Upgrade Alias: Hide Ability State: Completed
Then i added my new requirement under the tab "Requirements" under "Command Type" in the units section under ability. And yes i want each unit to gain access to the ability at different times.
In the Requirement where you set the Type/Alias/State also make sure "Tech Tree Cheat" is checked. Not sure if that will fix it or not, but it's checked for the ability I made. Sorry I missed that.
But if you want them to gain access to the ability at different times then the Upgrade/Requirement approach won't work. That only works if you have 1 unit or if u want all units to gain access to the ability at the same time. You'll have to hide the ability with triggers at map init or each time the unit is created, then show it when you want that particular unit to have access to it. If the units start off already created when the map loads then you could do something like:
Otherwise just have a trigger that fires each time a unit of the given unit type is created and call Hide on the Triggering Unit. Then have another one that triggers based off whichever event you want and calls Show for the Triggering Unit.
Okay thank you for the help