• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Advanced Spawning Trigger

Status
Not open for further replies.
I have a map that is 480 x 480 in size and I need to make zombie units spawn nearby the players units so that they can actually find them. Non mobile regions would be impractible.
So this is basically what I want to try and do.
Make enemy zombie units spawn randomly just outside a range of about 2800 from any unit that is the enemy of the zombies, but at the same time make them not spawn very far away. (Maybe make them spawn outside of a 2800 range but within a 3000 range at the same time?) Here is a chart to help clarify what I'm trying to do.
zombiesspawnareadz7.jpg

Notice: The various coloured dots are players units (Red, Blue, Teal, etc)
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Uses Point variable tempPoint and Point variable tempPoint2.

  • ZombieSpawn
    • Events
      • Time - Every <Zombie spawn interval> seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick Every Unit in (Units of type Survivor) Matching (Matching Unit is Alive Equal to True)) and do Actions
        • Loop - Actions
          • Set tempPoint = (Position of (Picked Unit))
          • Set tempPoint2 = (tempPoint Offset by (Random Real between 2800.00 and 3000.00) towards (Random Angle) Degrees)
          • Unit - Create 1 Zombie for (Neutral Hostile) at tempPoint2 facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_tempPoint)
          • Custom script: call RemoveLocation(udg_tempPoint2)
 
Uses Point variable tempPoint and Point variable tempPoint2.

  • ZombieSpawn
    • Events
      • Time - Every <Zombie spawn interval> seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick Every Unit in (Units of type Survivor) Matching (Matching Unit is Alive Equal to True)) and do Actions
        • Loop - Actions
          • Set tempPoint = (Position of (Picked Unit))
          • Set tempPoint2 = (tempPoint Offset by (Random Real between 2800.00 and 3000.00) towards (Random Angle) Degrees)
          • Unit - Create 1 Zombie for (Neutral Hostile) at tempPoint2 facing (Random angle) degrees
          • Custom script: call RemoveLocation(udg_tempPoint)
          • Custom script: call RemoveLocation(udg_tempPoint2)

I haven't tested it yet but I think that, this would only work perfectly for Purple's unit who's range doesn't overlap, for the others it might spawn them in each others range circles. I think the trigger needs to have something that checks to see if the spawning point is in another allied units range. If it does find the spawn point in another units range it should then check other possible spawn points around the unit (and if it finds none it should make up for it by spawning an extra zombie in one of the other units ranges that has spots that don't overlap)
 
Last edited:
Status
Not open for further replies.
Top