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

Help with Triggers

Status
Not open for further replies.
Level 2
Joined
Nov 4, 2011
Messages
28
How to make a trigger like Random levels but not repeatable? Like in Area of Ice Escape, when a players enter the finishing region, it will move to a random levels but not repeatable.

...: erm, can i have a test map too?? Anyway thanks for the help :)
 
You'd need something like a stack structure for this.

It works like this:

First, we have an array and an integer.

The integer -> number of levels
The array -> the starting regions of all the levels from 1-number of levels

Whenever you want to move to a random level, do this:

  • Set RandomInt = (Random integer between 1 and Number of levels)
  • // Move the units to the region RegionArray[RandomInt]
  • Set RegionArray[RandomInt] = RegionArray[NumberOfLevels]
  • Set NumberOfLevels = NumberOfLevels - 1
  • If NumberOfLevels == 0 Then
    • your done the game.
  • End If
This will make it impossible for levels to repeat.
 
Level 2
Joined
Nov 4, 2011
Messages
28
Hmm, i don't quite understand the triggers like that. Can you attach a testmap? anyone? thanks in advance.
 
Last edited:
Status
Not open for further replies.
Top