Hello, I've searched the forums without an answer to this, so hopefully I've not missed anything;
I'm trying to activate an ability using a Dialog Item Button, that once clicked would emulate the same as clicking the ability button if it was on a units command card.
For example, I want to use the ability Scanner Sweep when I click this Dialog Button.
The reason I'm doing it through Triggers is because I'm setting up a spells menu that would be part of the UI.
I've looked at Create Effect at Point from Player but this is tied to a specific point, rather than where the player clicks.
You can not use abilities that require a target outside of the command card. You can make it by doing something like, once you click the button, you set "targeting" to true, then another trigger that checks for "Mouse is pressed" and if "targeting is true" than issue the ability at Mouse_x Mouse_y. However, you still went get the Area ring, or the targeting curser
I do Hope this is fixed soon.
Rollback Post to RevisionRollBack
Random Information
Tutorials - Map Development - Galaxy wiki
|Issues? PM me|
Does anyone know if this has been fixed, or what exactly Molsterr meant by set "targeting" to true? Would I take an ability like fungal growth (from the infestor) and remove targeting from one of the behaviors and then set a trigger to add it back? Then use issue order to unit function, with target? I'm pretty confused but I'm going to try and keep working through it pending your response.
Molesterr is suggesting complete emulation of the targeting mechanic with latency inducing triggers (mouse click events) and variables (Boolean of whether or not your dialog ability has been pressed)
The point is moot since you can now hook up command buttons as dialog items.
In a fuller explanation I'm just trying to move 1 of each 3 different heroes command card abilities to the main screen UI (as well as display the cooldowns). I've got the cooldown portion sort of working (breaks when I kill the hero and create a new one of the same original type).
Any help on the command card button linking to a new UI dialog item would be great! Thanks!
This should be in triggers not here it could have been answered by now even if the topic is 4 years old.
This is totally possible with the only possibility being very slight delays in response.
Basically, you use a dialog item used event. the action would be to order unit to use ability.
for targets, same concept but u will need to relay to the order command the target, whether that be a unit or a point. for that u will need to make a trigger system to choke and receive mouse input. its not too difficult but should require its own tutorial. once the xy or unit is pulled from the system and maybe some range checks and such it is given to the order action and executed.
I'm just trying to move 1 of each 3 different heroes command card abilities to the main screen UI (as well as display the cooldowns).
Please expand on this. You want the ability buttons of three different heroes displayed on the screen at once? And some of the abilities are targeted?
I'd recommend inserting custom script when hooking up dialog items so you can define the variable one line (I've fuzzy results using DialogControlLastCreated()). Sample Code:
You can then treat the CommandButton05 as a normal dialog item (move it wherever you'd like, etc). You can find the layout path for any given UI frame in the UI Layout Module. Use Ctrl + Alt + F12 to navigate the UI in the UI debugger in game. Note that you must use a specific command button. 05 refers to the first button (column 1) of the 2nd row on the command card (the count begins at CommandButton00). This will act as whatever ability is in that slot for the selected unit.
Sorry for reviving this thread in the incorrect forum, perhaps it's to late to start a new one instead?
Yah I was able to setup triggers to where a unit (my hero with abilities) would (on dialog button click) use an ability targeting a point closest to himself in an enemy players army. However I can't seem to figure out how to set it up so clicking the dialog button just initiates the ability (same as if I had clicked psi storm in a command card), then clicking a 2nd time on the map would use the ability at that location.
@greythepirate:
"You want the ability buttons of three different heroes displayed on the screen at once? And some of the abilities are targeted?"
Yes this is correct. I want to take 1 ability from each hero (there are 3) and display those buttons on the screen. Essentially I want the same functionality as when abilities are used from the command card, except the abilities are displayed on the main UI.
This functionality only really needs to include:
-similar or editable picture
-visual cooldown indicator (a sweeping line/greyed out like normal or could just be a number display)
-abilities that require a target would allow the player to click a 2nd time to target a location (after clicking the dialog button displayed on the main UI)
I will try both of your suggestions in the meantime and see if I can get it working.
Hello, I've searched the forums without an answer to this, so hopefully I've not missed anything;
I'm trying to activate an ability using a Dialog Item Button, that once clicked would emulate the same as clicking the ability button if it was on a units command card.
For example, I want to use the ability Scanner Sweep when I click this Dialog Button. The reason I'm doing it through Triggers is because I'm setting up a spells menu that would be part of the UI.
I've looked at Create Effect at Point from Player but this is tied to a specific point, rather than where the player clicks.
You can not use abilities that require a target outside of the command card. You can make it by doing something like, once you click the button, you set "targeting" to true, then another trigger that checks for "Mouse is pressed" and if "targeting is true" than issue the ability at Mouse_x Mouse_y. However, you still went get the Area ring, or the targeting curser
I do Hope this is fixed soon.
Ah well that's a nuisance! There goes my idea for a Spell bar.
Thanks for the info and hopefully it will be added as a feature.
Does anyone know if this has been fixed, or what exactly Molsterr meant by set "targeting" to true? Would I take an ability like fungal growth (from the infestor) and remove targeting from one of the behaviors and then set a trigger to add it back? Then use issue order to unit function, with target? I'm pretty confused but I'm going to try and keep working through it pending your response.
Thanks in advance! Dennis
Molesterr is suggesting complete emulation of the targeting mechanic with latency inducing triggers (mouse click events) and variables (Boolean of whether or not your dialog ability has been pressed)
The point is moot since you can now hook up command buttons as dialog items.
@PirateArcade | I make games | Ask me things on Discord
@greythepirate: Go
Ah okay, thanks for the info greythepirate!
Would you mind telling me which function can hook up a command button as a dialog item?
Would I first make a dialog item (Display Screen Button), then hook up a command button to it in a separate function?
@Shortrizzle90: Go
In a fuller explanation I'm just trying to move 1 of each 3 different heroes command card abilities to the main screen UI (as well as display the cooldowns). I've got the cooldown portion sort of working (breaks when I kill the hero and create a new one of the same original type).
Any help on the command card button linking to a new UI dialog item would be great! Thanks!
I am also interested in more detailed information on how to do this, please.
This should be in triggers not here it could have been answered by now even if the topic is 4 years old.
This is totally possible with the only possibility being very slight delays in response.
Basically, you use a dialog item used event. the action would be to order unit to use ability.
for targets, same concept but u will need to relay to the order command the target, whether that be a unit or a point. for that u will need to make a trigger system to choke and receive mouse input. its not too difficult but should require its own tutorial. once the xy or unit is pulled from the system and maybe some range checks and such it is given to the order action and executed.
@Shortrizzle90: Go
Please expand on this. You want the ability buttons of three different heroes displayed on the screen at once? And some of the abilities are targeted?
I'd recommend inserting custom script when hooking up dialog items so you can define the variable one line (I've fuzzy results using DialogControlLastCreated()). Sample Code:
You can then treat the CommandButton05 as a normal dialog item (move it wherever you'd like, etc). You can find the layout path for any given UI frame in the UI Layout Module. Use Ctrl + Alt + F12 to navigate the UI in the UI debugger in game. Note that you must use a specific command button. 05 refers to the first button (column 1) of the 2nd row on the command card (the count begins at CommandButton00). This will act as whatever ability is in that slot for the selected unit.
@PirateArcade | I make games | Ask me things on Discord
@SoulTaker:
Sorry for reviving this thread in the incorrect forum, perhaps it's to late to start a new one instead?
Yah I was able to setup triggers to where a unit (my hero with abilities) would (on dialog button click) use an ability targeting a point closest to himself in an enemy players army. However I can't seem to figure out how to set it up so clicking the dialog button just initiates the ability (same as if I had clicked psi storm in a command card), then clicking a 2nd time on the map would use the ability at that location.
@greythepirate:
"You want the ability buttons of three different heroes displayed on the screen at once? And some of the abilities are targeted?"
Yes this is correct. I want to take 1 ability from each hero (there are 3) and display those buttons on the screen. Essentially I want the same functionality as when abilities are used from the command card, except the abilities are displayed on the main UI.
This functionality only really needs to include: -similar or editable picture -visual cooldown indicator (a sweeping line/greyed out like normal or could just be a number display) -abilities that require a target would allow the player to click a 2nd time to target a location (after clicking the dialog button displayed on the main UI)
I will try both of your suggestions in the meantime and see if I can get it working.
Thanks a ton!
@greythepirate: Go
I've never done any custom script stuff and am having trouble finding a tutorial on it. Any suggestions?