Dialog button, let player aim?

Editor Discussion
So I have a dialog button that is going to cast an ability which needs to be aimed, but I want the player to choose the location. From what I have tried, there is no way to do this with "Issue order", so I'm wondering, how do I do it?

Edit: It's just just abilities, it's also structures.
You could have a separate trigger that is "Initially Off" and when that button is clicked it Turns that Trigger on and Make it Destroy Cast Dialog and then Make Cast Dialog. Have that Dialog Background hidden and set title as "Click At Target Location". (The Cast Dialog is More for looks and to let them know they need to select a Target Point)

And that trigger is called based on a Left-Click.

Player Clicks Left Mouse Button

Active Count of Current Trigger = 1 (Makes sure your not casting this spell like 20 times!)

Point Target Point From X, Y
X= (Mouse X position clicked in the world)
Y= (Mouse Y position clicked in the world)


Create Effect (Ability you want) at Point Target Point.

Destroy Cast Dialog.

Turn Current Trigger off. (Unless you want this to be able to be rapid fire then you can leave it on until a specific count or whatever.)

(If it has a cooldown it can turn off the Button trigger then wait for the Cooldown length then turn it back on as well.)

(If you want it to be within a certain range of a unit then Create a Condition that takes the X and Y point of the Click and checks if it's within
Convert Circle to region Point to (Caster Unit) Radius (1/2 Range of attack)

Then Return True
Else Return False)
Sadly that doesn't work, since I also want to include placements of buildings.
I think you should change that button into command button of custom command panel. Bind that panel to some (invisible) unit with abilities you need. Just as it is done with Spear of Adun.
That's what I have been attempting to do, I have create a hidden unit with the commands I want, and are now trying to create dialog buttons to access them. I tried to create a command panel before, but that just mirror the normal command panel. Which is not what I want.

The closets I could find was dialog button, can't find any "command button.

I have to replay the protoss campaign, I don't remember that. Since then I could find the level, and look in their triggers (or data editor) and see how they did it.
You were right, when you created command panel. Next you need to hook up that panel in triggers to variable of Dialog type and use "Set Dialog Item Unit Group" trigger to link this Command Panel dialog item to your hidden unit (use convert unit to unit group function).
I just tested it, and it's prefect. Thank you so much.

Join the Conversation

Return to Forum