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

Q About Unit Maximum and a Trigger

Status
Not open for further replies.
Level 13
Joined
May 11, 2008
Messages
1,198
so when you make a map and the limit for neutral units/buildings is 512...and you add more with triggers...
that's waht i'm doing.

frankly, i'd like to add more units in the beginning though.

anyway.

i was wondering if making over 512 units or even around that number for the neutral players is going to make the game laggy.

plus i was also wondering what's the proper way to do the trigger.

set a timer up and when the timer is up do placing the new unit?
say timer is repeating and it's 5 seconds.

or...should you just have a timer run itself when it's done, and just before the run action you have wait 5 seconds.

which method is less laggy?

anyway yeah i just thought it would be fun if there was a mega creeping map so i decided to make one awhile back, and i thought i should make a brand new version of it. first one i called lord of the hill a forest of fury. now this one has a bunch of interesting conquerable creep camps which are strong. it should be fun i think.
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
Here is one simple system:

  • -------- Put this into initialization trigger --------
  • -------- Register all your creep regions in an array --------
  • -------- Like this example --------
  • -------- Note: This system is very simple, but doesn't take custom unit value --------
  • -------- Note: and uses only 3 variables --------
  • Set Region[1] = Region 000 <gen>
  • Set Region[2] = Region 001 <gen>
  • Set Region[3] = Region 002 <gen>
  • -------- Now, let's go to spawn trigger --------
  • Spawn
    • Events
      • Time - Elapsed game time is 0.00 seconds
      • Time - Every 120.00 seconds of game time
    • Conditions
    • Actions
      • -------- We will first check if there are no creeps in creep regions --------
      • -------- Make shure that last value in loop matches number of your regions --------
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Set TempGroup = (Units in Region[(Integer A)] owned by Neutral Hostile)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in TempGroup) Equal to 0
            • Then - Actions
              • -------- Ok, there are no units, lets spawn some creeps --------
              • Set TempPoint = (Center of Region[(Integer A)])
              • Unit - Create 1 Footman for Neutral Hostile at TempPoint facing Default building facing degrees
              • Unit - Create 1 Knight for Neutral Hostile at TempPoint facing Default building facing degrees
              • Unit - Create 1 Rifleman for Neutral Hostile at TempPoint facing Default building facing degrees
              • -------- Taking care of leaks --------
              • Custom script: call RemoveLocation(udg_TempPoint)
            • Else - Actions
          • Custom script: call DestroyGroup(udg_TempGroup)
 
Level 13
Joined
May 11, 2008
Messages
1,198
that seems useful child of bodom. i think i didn't know exactly how to do something like that...but that wasn't what i was looking for at the time...but thanks.

yeah this is more of a creep spawning system it seems. anyway everytime i try to use interger a for myself i don't understand how it works and my triggers always get screwed up. so i guess the more integer a triggers that ppl make that i use the better...

what i was looking for is more like a creep generating system.

got a question for you...how do you do this spawn system with items?

512 is A LOT of neutral units,
So you want to make more? Can't you just use create unit trigger for player at region.

well yes i was doing this but just for the creep generating part. which i'm trying to figure out if it's lagging or if it's just the getting over 512 part that is lagging or both are lagging or what.
 
Status
Not open for further replies.
Top