Staredit Network > Forums > SC2 Custom Maps > Topic: HOW TO! Random Unit
HOW TO! Random Unit
Jun 24 2010, 9:12 pm
By: Devourer  

Jun 24 2010, 9:12 pm Devourer Post #1

Hello

There have been many maps in SC1 with random units, like you get a random unit every five seconds.
Now, here is probably the simpliest way of doing so in sc2! All you need are like 1 trigger and 1 variable.

Step #1:
Go to Terrain and place all units which should be able to be gotten, like place a Marine, Zealot and Zergling.

Step #2:
Go to triggers, make a new global variable, type must be unit group

Step #3:
Add all the units you have preplaced to the unit group and remove/kill all those units from the map afterwards *

Step #4:
Now, easily, the spawning trigger: Conditions and events are totally up to you, and the create action looks like this:
Create 1 (Unit type of (Random Dead unit from UNIT GROUP)) for player X at point P using point facing (No Options)

Isn't it simple? :)
Have fun using it.

*When you prefer not to kill those preplaced units you simply got to change the "DEAD" to "LIVING" parameter in the create action.
HINT: Pick Each unit in location matching condition (alive) -> add picked unit to unit group, kill picked unit. You can use that loop to avoid having one action for each unit to be added into the group. All you got to do is to add a location all over those units. Simple.
Screenshot:


Post has been edited 6 time(s), last time on Jun 25 2010, 10:23 pm by Devourer.



Please report errors in the Staredit.Network forum.

Jun 24 2010, 9:16 pm payne Post #2

:payne:

Woa, thank you very much! Will use for my Imposs map :)



None.

Jun 24 2010, 9:38 pm Swampfox Post #3



+1! (When my karma thing resets...)

Thanks for such a straightforward process! I can see it being very useful in any sort of map being that it is so easy to utilize.



None.

Jun 25 2010, 1:44 pm Ashamed Post #4

Hear me Raor!!

wow that is very simple..
That was a good system to come up with.



None.

Jun 25 2010, 10:22 pm Devourer Post #5

Hello

Oh, also, if you do not want to make 1 action for each unit to be added in the unit group you can make a simple loop:
Pick Each unit in location matching condition (alive) -> add picked unit to unit group, kill picked unit.



Please report errors in the Staredit.Network forum.

Jun 26 2010, 1:39 am payne Post #6

:payne:

Quote from Devourer
Oh, also, if you do not want to make 1 action for each unit to be added in the unit group you can make a simple loop:
Pick Each unit in location matching condition (alive) -> add picked unit to unit group, kill picked unit.
Much better. Rewrite your OP properly please?



None.

Jun 26 2010, 10:30 pm Temp Post #7



If you want to do this with triggers only you could fill up an array of Unit Types with the units you want and pick a random integer from 0 to array size.



None.

Jun 26 2010, 11:27 pm Demented Shaman Post #8



Quote from Temp
If you want to do this with triggers only you could fill up an array of Unit Types with the units you want and pick a random integer from 0 to array size.
I didn't read Devourer's tutorial that closely and I just assumed he was doing what you suggested. I think your method is the preferred way to do it.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[08:35 pm]
Ultraviolet -- :wob:
[11:38 pm]
Symmetry -- :wob:
[2026-6-21. : 4:56 am]
Ultraviolet -- I suppose we'll likely never know, but my guess would be that they already saw it operating successfully and there was no monetary incentive to finish the original work. And the dev cycle in old school Blizzard was so hectic, it's possible it just got forgotten about after the original game got released. Plus there's an element of existing MPQ files that were packaged with the original discs becoming outdated if they updated it. And it's not like they remade the original MPQs, they just made new ones for BW specifically
[2026-6-21. : 4:26 am]
Oh_Man -- so that makes me think maybe the theory they are unfinished is not true and its a deliberate design decision, coz why not finish them wen ur making brood war?
[2026-6-21. : 4:25 am]
Oh_Man -- the thing is thos buildings are from classic. that means they went ahead and made brood war without ever finishing the 'unfinished' buildings
[2026-6-20. : 6:15 pm]
Ultraviolet -- Yeah he's talked about a lot of that stuff in his casts before. It seems plausible. Especially knowing how Blizzard of yesteryear operated.
[2026-6-20. : 3:47 pm]
NudeRaider -- to clarify: couldn't recall the behavior for every single Protoss building but I was aware the disparity exists.
[2026-6-20. : 3:43 pm]
NudeRaider -- Contained nothing new for me. Didn't know all building's behavior, but very much all unit's. Also Terran balance whine - also nothing new :lol:
[2026-6-19. : 9:57 am]
Oh_Man -- makes me wonder if SEN knows anything about the topic
[2026-6-19. : 9:57 am]
Oh_Man -- artosis dropped pretty interesting vid: https://youtu.be/EqZHB8Blra4
Please log in to shout.


Members Online: Vrael