• 🏆 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!

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