• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Creating a Prompt Window for players that miss-click alot

Level 5
Joined
Jun 24, 2024
Messages
59
Hey! Me again,

i want to create a prompt window where players have to confirm, that they want to sell a Unit.
This Window should ask exactly that, "Sell this tower?" and there then should be a yes and no button to click.

I've tried around with Dialog Triggers but to no avail.

Alternatively an ability which toggles the sell button (active/inactive(darkened but still visible) would be a idea, but i'm sure not many would use that.

I didn't find any tutorials here yet, but english not being my nativ language i'm sure i didn't use the right keywords :)

Best regards
SMOrc
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,869

Unit casts Sell ability -> Set Variable Tower_To_Sell[(Player number of (Triggering player)) = (Triggering unit) -> Show SellDialog to (Triggering player)

Player clicks a Dialog button -> Clicked dialog button Equal to YES -> Kill Tower_To_Sell[(Player number of (Triggering player)) and refund Gold/Lumber

  • Sell Dialog Setup
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Dialog - Change the title of Sell_Dialog to Sell Tower?
      • Dialog - Create a dialog button for Sell_Dialog labelled Yes
      • Set Variable Sell_Button = (Last created dialog Button)
      • Dialog - Create a dialog button for Sell_Dialog labelled No
  • Sell Tower Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sell
    • Actions
      • Set Variable Sell_Tower[(Player number of (Triggering player))] = (Triggering unit)
      • Dialog - Show Sell_Dialog for (Triggering player)
  • Sell Tower Finish
    • Events
      • Dialog - A dialog button is clicked for Sell_Dialog
    • Conditions
      • (Clicked dialog button) Equal to Sell_Button
    • Actions
      • // refund gold and lumber
      • Unit - Kill Sell_Tower[(Player number of (Triggering player))]
Variables:
Sell_Dialog = Dialog
Sell_Button = Dialog Button
Sell_Tower = Unit ARRAY
 
Last edited:
Top