• 🏆 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] need help with this..

Status
Not open for further replies.
Level 4
Joined
May 31, 2009
Messages
109
i need someone who can tech me how to fix this duel trigger

  • Timer
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Create a timer window for (Last started timer) with title Duel Starts
      • Countdown Timer - Start (Last started timer) as a Repeating timer that will expire in 240.00 seconds
  • Duel On
    • Events
      • Time - Every 240.00 seconds of game time
    • Conditions
    • Actions
      • Set Duel_Group = (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Random point in Duel Area <gen>)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Unit - Set life of (Picked unit) to 100.00%
              • Unit - Set life of (Picked unit) to 100.00%
              • Unit - Set life of (Picked unit) to 100.00%
              • Unit - Move (Picked unit) instantly to TempPoint
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Game - Display to (All players) the text: Duel Time!!!
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to False
                • Then - Actions
                  • Hero - Instantly revive (Picked unit) at TempPoint, Hide revival graphics
                  • Custom script: call RemoveLocation(udg_TempPoint)
                • Else - Actions
      • Trigger - Turn on Duel Off <gen>
  • Duel Off
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Duel Area <gen> contains (Triggering unit)) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from Duel_Group
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Duel_Group) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in Duel_Group and do (Actions)
            • Loop - Actions
              • Game - Display to (All players) the text: ((Proper name of (Picked unit)) + has won the duel!)
              • Custom script: call DestroyGroup(udg_Duel_Group)
              • Unit - Move (Picked unit) instantly to (Center of (Playable map area))
              • Trigger - Turn off (This trigger)
        • Else - Actions
pls help me....
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
The first trigger:

What the .... ?
You use "last started timer" to start a timer, while there is no "last started timer" at all...
Create a timer variable and use that instead, switch the actions by the way...

Just click on the variable-icon inside the trigger editor, click on "New Variable" (Ctrl+ N), then pick the name ("Timer" or something), set the type to "timer" and click "ok" (no array needed).

I know this is a nooby-explanation, but you wanted someone to teach you, so I will start with the basics :D

it should look like:

  • Timer
  • Events
    • Time - Elapsed game time is 0.00 seconds
  • Conditions
  • Actions
    • Countdown Timer - Start Timer as a Repeating timer that will expire in 240.00 seconds
    • Countdown Timer - Create a timer window for (Last started timer) with title Duel Starts
With the variable "Timer"


Now why did I switch the 2 actions?
Well, the answer is: you need to create a timer first before you can assign a window to it, you can use "Last started timer" for the action, because we have started the timer in the previous action.

About the second trigger:

So you've created a timer, but you still use "every 240 sec", why create the timer then? ;)
Well, I know why actually... you didn't set the timer as a variable, so you couldn't use "timer expires" (that's my guess, at least).


So you need to use this event:
  • Time - Timer expires
Which is possible now, since you have created a timer-variable in the first trigger (congratulations! :D).


Off to the next problem:
Use this action to set up the unit group:
  • Unit Group - Pick every unit in Duel_Group and do (Actions)
Otherwise you've created the variable for nothing, that would be a waste...

Now, you've used the action "Unit - Set life of (Picked unit) to 100.00%" 3 times, while it's good if you use it only once... (delete the other 2).


In the third trigger, you only need to remove the leak "(Center of (Playable map area))".

Now you should have an efficient, working duel-trigger ;)
 
Level 5
Joined
Apr 21, 2006
Messages
82
i'd set the Heroes into a Variable for example called "Hero" and put an array on them with player number. Then with random integer take to "Hero[]" variable units into the duel.
choose 'em like this with variable

  • Actions
    • Set Hero[(Player Number of Owner of (sold unit))] = (Sold unit)
    • -------- Or whatever the method is you use to choose your hero --------

Then where the duel starts and you want to choose hero you can put this in there:

  • Actions
    • For each loop Integer A 1 to 2 do actions
      • -------- Now we set an random integer to choose the player who's hero will go into the duel --------
      • Set RandomNumer = (Random number between 1 and 12)
      • Unit - Set life of Hero[RandomNumber] to 100%
      • Unit - Set mana of Hero[RandomNumber] to 100%
      • Unit - Move Hero[RandomNumber] instantly to TempPoint
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Hero[RandomNumber]) is alive) Equal to False
        • Then - Actions
          • Hero - Instantly revive Hero[RandomNumber] at TempPoint, Hide revival graphics
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Game - Display to (All players) the text: Duel Time!!!

that should do it
 
Status
Not open for further replies.
Top