• 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.

[Trigger] Creating In-Game Stage Selection?

Status
Not open for further replies.
Level 1
Joined
Apr 2, 2007
Messages
4
Hey guys, I'm a newb on the forum, recently messing around with WE. I hope I can return the favor by contributing to the insane amount of info here in the future. Anyway, my current problem goes like this...

I want to set up a voting system for my map, so that a dummy spell is cast by a beacon called Level Selector. Each stage has been given a dummy ability When an ability is used (a vote is made) the Level Selector destroys itself, adding +1 to a real, non-array variable specifically for that stage. The game is set to wait until the timer expires, then it is supposed to cross-check the variables to see which 1 has a larger real value, by using another trigger. The winning vote should set a final variable to a real value x, corresponding to a stage (each stage has a word value and a real value, so I can use the real value in triggers but identify it easily by word). Lastly, each stage has one unique trigger, with the Event: "(my final variable) becomes equal to (x)". The Action triggers have worked under separate events/conditions, but now nothing seems to happen.

This might be very complex for a simple objective, but I am still new to the way WE works and this is the best I've come up with so far. If I could get some input it would be greatly appreciated.

  • Stage Selection Init
    • Events
      • Time - TimerCharSelect expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy (Last created timer window)
      • Countdown Timer - Start TimerLevelSelect as a One-shot timer that will expire in 15.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Game Start In
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Stage Selector for (Picked player) at (Random point in Level Selectors <gen>) facing Default building facing degrees
          • Selection - Select (Last created unit) for (Picked player)
  • Stage Vote
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to SAS
        • Then - Actions
          • Set SelectSAS = (SelectSAS + 1.00)
          • Unit - Remove (Triggering unit) from the game
        • Else - Actions
          • Set SelectSAS = SelectSAS
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to SA
        • Then - Actions
          • Set SelectSA = (SelectSA + 1.00)
          • Unit - Remove (Triggering unit) from the game
        • Else - Actions
          • Set SelectSA = SelectSA
  • Stage Vote Tally
    • Events
      • Time - TimerLevelSelect expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy (Last created timer window)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SelectSAS Greater than SelectSA
        • Then - Actions
          • Set SelectedStageFinal = 1.00
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SelectSA Greater than SelectSAS
        • Then - Actions
          • Set SelectedStageFinal = 2.00
        • Else - Actions
          • Do nothing
Then a sample 'successful' vote:

  • SAS Confirmed
    • Events
      • Game - SelectedStageFinal becomes Equal to 1.00
    • Conditions
    • Actions

I left the Actions of the last trigger off because they are irrelevant. They have worked when I was testing a different method for stage selection. There are no conditions.

My alternative is a stage selection by the host (non-vote, Red decides) similar to the games Elimination Tournament and MaD Dodgeball Arena.

-Phrag
 
Last edited:
Level 8
Joined
Jul 23, 2005
Messages
329
  • Stage Vote
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to SAS
        • Then - Actions
          • Set SelectSAS = (SelectSAS + 1.00)
          • Unit - Remove (Triggering unit) from the game
        • Else - Actions
          • Set SelectSAS = SelectSAS
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to SA
        • Then - Actions
          • Set SelectSA = (SelectSA + 1.00)
          • Unit - Remove (Triggering unit) from the game
        • Else - Actions
          • Set SelectSA = SelectSA

I'm not sure, but I don't believe you need the lines that say:
  • Set SelectSAS = SelectSAS
or
  • Set Select SA = Select SA
You might have done this on purpose for code readability, but its just a small optimization. The rest of the triggers look good though, keep it up!

EDIT: Oh and by the way, your first trigger leaks a point.

  • Stage Selection Init
    • Events
      • Time - TimerCharSelect expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy (Last created timer window)
      • Countdown Timer - Start TimerLevelSelect as a One-shot timer that will expire in 15.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Game Start In
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Stage Selector for (Picked player) at (Random point in Level Selectors <gen>) facing Default building facing degrees
          • Selection - Select (Last created unit) for (Picked player)
The last bit should be something like (With TempPoint being a point variable)
  • Stage Selection Init
    • Events
      • Time - TimerCharSelect expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy (Last created timer window)
      • Countdown Timer - Start TimerLevelSelect as a One-shot timer that will expire in 15.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Game Start In
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • [b]Set TempPoint = Random Point in Level Selectors <gen> [/b]
          • Unit - Create 1 Stage Selector for (Picked player) at (Random point in Level Selectors <gen>) facing Default building facing degrees
          • Selection - Select (Last created unit) for (Picked player)
          • [b]Custom Script - call RemoveLocation( udg_TempPoint ) [/b]
 
Last edited:
Status
Not open for further replies.
Top