Random Region for Findable Unit Spawn

Bigrocks

New Member
Reaction score
0
I am trying to make it so that a specific hero will spawn for any player that sends a hero type unit they already own into a certain region first. But I actually have 7 regions and I want to make it random as to which one he will actually spawn at and I want them all on a random timer for when he could first be available at. Any assistance would be greatly appreciated.
 

Monsterous

In the Shadows, Lurking.
Reaction score
99
Make a region array, and put the regions into that array. Make a timer with a random real inside. (Turn it into a global variable so the second trigger will recognise it. Dont use "last created timer".) Then in the second trigger, when the timer elapses, select a region at random from your array and then create your hero.

Example:

Global Variable [Region]: RegionArray[size 7]
Global Variable [Timer]: RandomTimer
Global Variable [Unit] : HeroEnteringRegion

TRIGGER ONE (The Setup!)
Event: When <HERO> enters [REGION 1]
When <HERO> enteres [REGION 2] (List them all as seperate events. The events wont recognise the variable.)​
Actions: RegionArray[1] = <YOUR REGION>
Region Array [2] = <YOUR REGION> (Continue this for the other regions.)
Start Timer as One Shot Timer that expires in (Random real between X and Y) seconds.
RandomTimer = Last Created Timer
HeroEnteringRegion = Triggering Unit​


TRIGGER TWO (The Action!)
Event: RandomTimer expires
Action: Create one [HeroEnteringRegion] at RegionArray[Random Integer between 0 and 7] (etc...)​
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top