[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