1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Solved] Creating units at random spots

Discussion in 'World Editor Help Zone' started by Xzere, May 19, 2020.

Tags:
  1. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    Hello, how do i create 3 units total, one at each of these 4 regions?

    So one spot should be open only

    Thanks in advance.

    upload_2020-5-19_18-50-2.png
     
  2. old_edge5

    old_edge5

    Joined:
    Mar 15, 2018
    Messages:
    31
    Resources:
    0
    Resources:
    0
    Is it supposed to be random where they spawn and do you use the trigger more than once?
     
  3. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    Yeah exactly. No, just once.
     
  4. old_edge5

    old_edge5

    Joined:
    Mar 15, 2018
    Messages:
    31
    Resources:
    0
    Resources:
    0
    Try this :)

    • MakeUnits
      • Events
      • Conditions
      • Actions
        • Set VariableSet SpawnRegions[0] = Region 000 <gen>
        • Set VariableSet SpawnRegions[1] = Region 001 <gen>
        • Set VariableSet SpawnRegions[2] = Region 002 <gen>
        • Set VariableSet SpawnRegions[3] = Region 003 <gen>
        • Set VariableSet SpawnRegionVacant = (Random integer number between 0 and 3)
        • For each (Integer A) from 0 to 3, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • SpawnRegionVacant Not equal to (Integer A)
              • Then - Actions
                • Unit - Create 1 Fußsoldat for Player 1 (Red) at (Center of SpawnRegions[(Integer A)]) facing Default building facing degrees
              • Else - Actions
     
  5. Xzere

    Xzere

    Joined:
    Feb 23, 2020
    Messages:
    152
    Resources:
    0
    Resources:
    0
    This is what i was looking for, thank you sir! :)

    Edit: @old_edge5 , so i want these spawned unit to interact with the event "a unit comes within X range of [The spawned unit]. How do i make that work? I tried using "Move unit instantly to" instead, but that did not seem to work hm

    Edit: I found a way^^
     
    Last edited: May 20, 2020