Array or not for spawning units at a certain area.

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Hey guys, been a while since I was last here.

So I got this trigger right...

Code:
Buy Creeps
    Events
        Unit - A unit Finishes training a unit
    Conditions
    Actions
        [B]Set lastTrainedUnit = (Unit-type of (Trained unit))[/B]
        If ((Owner of (Triggering unit)) Equal to Player 1 (Red)) then do (Set creepSpawn = Ruins Naga Circle 0015 <gen>) else do (Do nothing)
        If ((Owner of (Trained unit)) Equal to Player 2 (Blue)) then do (Set creepSpawn = Ruins Naga Circle 0059 <gen>) else do (Do nothing)
        Unit - Create 5 lastTrainedUnit for Neutral Hostile at (Position of creepSpawn) facing Default building facing degrees

I was wondering if I should use the bolded variable as an array or using it like that would be fine.
 

Furby

Current occupation: News poster
Reaction score
144
You do not need to create Variable. Use Last Trained Unit.
 

Flare

Stops copies me!
Reaction score
662
There will be up to 10 people using this trigger though.

If there aren't any waits, that shouldn't be a problem and you won't need an array either.

You do not need to create Variable. Use Last Trained Unit.
Purely for efficiency reasons (since 10 function calls vs. 1 function call, especially with GUI actions) even though, since it is a fairly simple trigger, efficiency doesn't really need to be high on your list of priorities (that trigger isn't going to be running very often, is it?)
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
(that trigger isn't going to be running very often, is it?)

It will be run quite often I predict, the aim of the game is to get your hero level up and this trigger will be run in order to do that, so each person would use it quite alot, and there could be 10 people, so at the start of the game could be used about 10-20 times within 30 seconds.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
> about 10-20 times within 30 seconds

Those aren't exactly times to worry about...


You may want to take care of the point leaks though.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top