1) I have a custom dialog in which heroes can buy items, upgrades, abilities and such. If a player clicks on a button, the credits are removed and the item/upgrade/ability is added to the hero. One of those buyable things concerns Vehicles Mastery.
2) Vehicles are just neutral units with Medivac's load/unload ability. If a hero has Vehicles Mastery Level 1, it can be loaded into the vehicle... and when that happens, the vehicle change ownership to hero's player. When the hero is unloaded from the vehicle, the vehicle become neutral again so that it can be controled by other heroes/players.
3) Every vehicle has a special ability (with a button in Commands Card) that can be used only if the the currently transported hero has Vehicles Mastery Level 2.
The problem is that I need to do a lot of checks around this system... and I can't find the right entity on which Vehicles Mastery should be based.
1) Dialog tooltips must be created dynamically... so, for example:
IF -HERO- DOESN'T HAVE ANY LEVEL OF -VEHICLES MASTERY-
Button Tooltip => "Level 1 - You can use vehicles."
ELSE IF -HERO- HAS -VEHICLES MASTERY LEVEL 1-
Button Tooltip => "Level 2 - You can use vehicles' abilities."
ETC...
2) Before the cardo loaded event occurs I need to do a little check:
IF -HERO- DOESN'T HAVE ANY LEVEL OF -VEHICLES MASTERY-
Block Loading
ELSE
Load Hero
Vehicle's Owner = Hero's Owner
3) The Vehicles Mastery must be also used as requirement, so that if a hero doesn't have Vehicles Mastery Level 2 command buttons in Commands Card are shown but grayed out (with red requirement string).
So... what should Vehicles Mastery be? An ability? A behavior? An upgrade? A simple global variable?
- Abilities can't be added through triggers... so creating Vehicles Mastery as ability will give me problems in custom dialogs (I won't be able to add it to a hero when the dialog button is clicked.
- Behaviors and upgrades can be set through triggers, but can't be checked...
- I know that requirements support abilities, behaviors and also upgrades... but I can't check for the cargo property, so 3) will be a big, big problem.
You can enable different levels of upgrades with triggers. Have all three levels of mastery already assigned to the hero in the data editor as tech upgrades (make sure that there is a requirement to prevent them being turned on prematurely) and enable them for the owning player when he clicks on the dialog box. You can also use triggers to check for the presence of a particular upgrade for when you load the vehicle. Hope that helps :)
- Behaviors and upgrades can be set through triggers, but can't be checked...
Yes, you can check behaviors and upgrades with triggers. Unit Has Behavior, and I don't remember the name of the other, but exists. I'll probably use behavior for this.
Problem I see, is how do you'll load your hero on a unit isn't yours? You can't do that. Probably will be easier to make the cargo unit unable to move, or unable to command, and remove that propierties when you want (but is always property of the player).
The Dialog changing tooltip can be tricky too. If is a multiplayer game you'll need to create multiple dialogs and show the correct one to each player. Probably is the best way for single player too, but you can actually change the dialog in single player.
For what concerns the dialog, I just made a simple function CreateShopDialog(int Player), so that I can check player properties during elements creations and I only show it to PlayerGroupSingle(Player)... and I have a simple array like ShopButtons[Player][Button] to check for clicks.
Anyway... how can I check "if player/unit has Behavior" or "if player/unit has Upgrade"? I don't find anything looking similar in the triggers editor :(
1) I have a custom dialog in which heroes can buy items, upgrades, abilities and such. If a player clicks on a button, the credits are removed and the item/upgrade/ability is added to the hero. One of those buyable things concerns Vehicles Mastery.
2) Vehicles are just neutral units with Medivac's load/unload ability. If a hero has Vehicles Mastery Level 1, it can be loaded into the vehicle... and when that happens, the vehicle change ownership to hero's player. When the hero is unloaded from the vehicle, the vehicle become neutral again so that it can be controled by other heroes/players.
3) Every vehicle has a special ability (with a button in Commands Card) that can be used only if the the currently transported hero has Vehicles Mastery Level 2.
The problem is that I need to do a lot of checks around this system... and I can't find the right entity on which Vehicles Mastery should be based.
1) Dialog tooltips must be created dynamically... so, for example:
IF -HERO- DOESN'T HAVE ANY LEVEL OF -VEHICLES MASTERY-
Button Tooltip => "Level 1 - You can use vehicles."
ELSE IF -HERO- HAS -VEHICLES MASTERY LEVEL 1-
Button Tooltip => "Level 2 - You can use vehicles' abilities."
ETC...
2) Before the cardo loaded event occurs I need to do a little check:
IF -HERO- DOESN'T HAVE ANY LEVEL OF -VEHICLES MASTERY-
Block Loading
ELSE
Load Hero
Vehicle's Owner = Hero's Owner
3) The Vehicles Mastery must be also used as requirement, so that if a hero doesn't have Vehicles Mastery Level 2 command buttons in Commands Card are shown but grayed out (with red requirement string).
So... what should Vehicles Mastery be? An ability? A behavior? An upgrade? A simple global variable?
- Abilities can't be added through triggers... so creating Vehicles Mastery as ability will give me problems in custom dialogs (I won't be able to add it to a hero when the dialog button is clicked.
- Behaviors and upgrades can be set through triggers, but can't be checked...
- I know that requirements support abilities, behaviors and also upgrades... but I can't check for the cargo property, so 3) will be a big, big problem.
Can someone help me please?
You can enable different levels of upgrades with triggers. Have all three levels of mastery already assigned to the hero in the data editor as tech upgrades (make sure that there is a requirement to prevent them being turned on prematurely) and enable them for the owning player when he clicks on the dialog box. You can also use triggers to check for the presence of a particular upgrade for when you load the vehicle. Hope that helps :)
@DivinoZarathos: Go
- Behaviors and upgrades can be set through triggers, but can't be checked...
Yes, you can check behaviors and upgrades with triggers. Unit Has Behavior, and I don't remember the name of the other, but exists. I'll probably use behavior for this.
Problem I see, is how do you'll load your hero on a unit isn't yours? You can't do that. Probably will be easier to make the cargo unit unable to move, or unable to command, and remove that propierties when you want (but is always property of the player).
The Dialog changing tooltip can be tricky too. If is a multiplayer game you'll need to create multiple dialogs and show the correct one to each player. Probably is the best way for single player too, but you can actually change the dialog in single player.
For what concerns the dialog, I just made a simple function CreateShopDialog(int Player), so that I can check player properties during elements creations and I only show it to PlayerGroupSingle(Player)... and I have a simple array like ShopButtons[Player][Button] to check for clicks.
Anyway... how can I check "if player/unit has Behavior" or "if player/unit has Upgrade"? I don't find anything looking similar in the triggers editor :(
@DivinoZarathos: Go
To check for abilities: http://wiki.sc2mapster.com/galaxy/triggers/ability-count-for-player/ (Returns 0 if false, effectively)
To check for upgrades: http://wiki.sc2mapster.com/galaxy/triggers/upgrade-count-for-player/ (Returns 0 if false, effectively)
To check for behaviours: http://wiki.sc2mapster.com/galaxy/triggers/unit-has-behavior/ (Boolean, so returns 'true' if true)