• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[General] Set kills using dialog button

Status
Not open for further replies.
Level 4
Joined
Dec 16, 2013
Messages
84
Hello
how to set kill using dialog button?

Event
When player clicked the dialog button X

Condition
Dialog button equal to X

Action
What is the action?

thanks
 
Level 4
Joined
Dec 16, 2013
Messages
84
set kills?
You could do it via a dialog but you must click a button when it shows.

i know that, i just don't know how to trigger it
like when kills reach 60, the player win

i can do the dialog things, just have no idea to trigger the kills
 
Possible action for your dialog trigger:
  • Set MAX_KILLS = 20

KillCount Trigger:
  • Events
    • Unit - A unit Dies
  • Conditions
  • Actions
    • Set Int = PlayerNumberOf(OwnerOf(KillingUnit))
    • Set KillCounter[Int] = KillCounter[Int] + 1
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • KillCounter[int] >= MAX_KILLS
    • Then - Actions
      • Game - Player[Int] wins
    • Else - Actions
 
Level 4
Joined
Dec 16, 2013
Messages
84
Possible action for your dialog trigger:
  • Set MAX_KILLS = 20

KillCount Trigger:
  • Events
    • Unit - A unit Dies
  • Conditions
  • Actions
    • Set Int = PlayerNumberOf(OwnerOf(KillingUnit))
    • Set KillCounter[Int] = KillCounter[Int] + 1
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • KillCounter[int] >= MAX_KILLS
    • Then - Actions
      • Game - Player[Int] wins
    • Else - Actions

It does not work
  • k10
    • Events
      • Dialog - A dialog button is clicked for Mydialog
    • Conditions
      • (Clicked dialog button) Equal to DialogButton[1]
    • Actions
      • Set MaxKills = 3
  • Max kills
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Int = (Player number of (Owner of (Killing unit)))
      • Set KillsCounter[Int] = KillsCounter[(Int + 1)]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KillsCounter[Int] Greater than or equal to MaxKills
        • Then - Actions
          • Game - Victory Player 1 (Red) (Show dialogs, Show scores)
        • Else - Actions
what is wrong?
 
Level 4
Joined
Dec 16, 2013
Messages
84
KillsCounter[(Int + 1)] should be like what IcemanBo suggested:

KillsCounter[Int] + 1

So the arithmetic should be for the value of KillsCounter and not the array.

HAHA it's working, i didnt notice that
 
Status
Not open for further replies.
Top