• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Hero Evolution

Status
Not open for further replies.
i am useing a trigger where a hero levels to lvl 30 and it is replaced (can do that bit) but i am trying to use a dialog to pick what you evolve into next here is the trigger i have got so far
  • Events
    • Unit - A unit Gains a level
  • Conditions
    • (Unit-type of (Leveling Hero)) Equal to Kobold
    • (Hero level of (Leveling Hero)) Greater than or equal to 30
  • Actions
    • Dialog - Clear Dialog
    • Dialog - Change the title of Dialog to Pick your evolution
    • Dialog - Create a dialog button for Dialog labelled Kobold Worrior
    • Set DialogeButton[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Dialog labelled Kobold Geomancer
    • Set DialogeButton[2] = (Last created dialog Button)
    • Dialog - Show Dialog for (Owner of (Leveling Hero))
  • Events
    • Dialog - A dialog button is clicked for Dialog
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Clicked dialog button) Equal to DialogeButton[1]
      • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Clicked dialog button) Equal to DialogeButton[1]
      • Then - Actions
        • Unit - Replace (Leveling Hero) with a Kobold Worrior using The old unit's relative life and mana
        • Selection - Select (Last created unit) for (Owner of (Leveling Hero))
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Clicked dialog button) Equal to DialogeButton[2]
      • Then - Actions
        • Unit - Replace (Leveling Hero) with a Kobold Geomancer using The old unit's relative life and mana
        • Selection - Select (Last replaced unit) for (Owner of (Leveling Hero))
      • Else - Actions
but i cant get it to work +rep to whoever can solve my problem first
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
Use Triggering unit instead of Levelling Hero as they are the same thing except Triggering unit is more bug-free.

Store that inside a variable and use that variable in your Dialog trigger.

Example:
You stored it in the variable MyCoolHero.
In the dialog trigger, the replacement would be like this:
  • Unit - Replace MyCoolHero with a Kobold Worrior using The old unit's relative life and mana
Also, your second trigger doesn't need the first if-then-else. The selection should be outside and at the bottom of the if-then-else since it will be done regardless of which hero was chosen.
 
Status
Not open for further replies.
Top