Staredit Newtork
Community
StarCraft
Games
Site
Favourites
Create Random Unit Within Race

Creator: Polantaris
Time: Mar 6 2008, 10:20 pm

Post #1     Polantaris Mar 6 2008, 10:20 pm

[Avatar]
 offline contact
Hi. I just recently decided to remake a map my brother made a while back that was a lot of fun, but I do not know how to do the following thing: When you step on a beacon with a Terran Civilian, I want to replace that civilian with a random unit from the race whose beacon that you stepped on. For example, if you step on a Terran Beacon, your Civilian becomes a Marine, or it becomes a Battlecruiser. Is there a way to set a random unit to be created in SE?
Top

Post #2     ws-Impeached Mar 6 2008, 10:27 pm

[Avatar]
Beat that horse!
 offline contact
http://www.maplantis.org/index.php?wiki=122

That should tell you all you need to know about random results.
(signature image)
Reverie World Studios Scenario Scripter
Top

Post #3     y10k Mar 6 2008, 10:35 pm

[Avatar]
 offline contact
There are a lot of ways to randomize
1. switches: randomize switch, you can do random 2-4-8-16-32-64... with them and depending on switch states you create the unit.
2. Death counting. Always/Give 1 death , and if DC is 1 create marine, DC is 2 create BC, DC is 3 create vulture or anything, after last unit, reset DC.
3. Circling units somewhere.

Use an other death counter(DC2) for race marker 1: toss, 2: terran, 3: zerg depending on which baecon you move.

switch 1 is set
switch 2 is set
switch 3 is set
DC2 is exactly 1

create a dragoon
remove civilian

switch 1 is set
switch 2 is set
switch 3 is cleared
DC2 is exactly 1

create a scout
remove civilian

switch 1 is set
switch 2 is set
switch 3 is set
DC2 is exactly 2

create a marine
remove civilian
Top

Post #4     Polantaris Mar 6 2008, 10:44 pm

[Avatar]
 offline contact
Ah thank you. I've been reading the "Multi-Switch" option but I am wondering: Where would I set them to randomize the switches? Since in this map the beacons will be being used multiple times by multiple players, I'm going to need to randomly change them on call.

To y10k: There will be 3 beacons, one for each race. When the player steps on it it will randomly create the unit based on which race's beacon they stepped on.
Top

Post #5     who Mar 6 2008, 10:49 pm

[Avatar]
someone09
 offline contact
so it might be like this:

player brings 1 unit to terranbeacon
"terran is clear"
set switch "terran"
randomize switch 1
randomize switch 2
randomize switch 3

then have the results triggers; for example:

"terran" is set
switch 1 is clear
switch 2 is clear
switch 3 is set
create 2 marine
clear "terran"

then preserve of course
Make sure you use some sort of variable as a condition in your results triggers (set by the trigger called when a unit is brought to the beacon), so your preserved triggers don't fire multiple times
(user posted image)
Top

Post #6     Polantaris Mar 7 2008, 1:22 am

[Avatar]
 offline contact
if I make an
Always;

Randomize Switches
Wait
Preserve
will it just keep randomizing the switches?
Top

Post #7     who Mar 7 2008, 1:33 am

[Avatar]
someone09
 offline contact
yes it would, but i suggest removing the wait, because you'll probably get some problems due to it. So just have that trigger running all the time, and set the race switch after the unit gets on the beacon. Have the creation triggers only execute if the race switch is set (then clear it) and it should work.
(user posted image)
Top

Post #8     FooFighters[WP] Mar 7 2008, 1:40 am

[Avatar]
WooHoo! Lets Party!
 offline contact
I think it would be easier to use a counter... ie, Player 12 has #Minerals, create 1 Marine at "Terran." etc... thats how i would do it without as much triggers as those Random Switches

then use hypers to make the thing go up 12 per second, make it go back to 0 at a certain mineral, and minerals would become a thing to have really random results
Top

Post #9     Polantaris Mar 7 2008, 2:03 am

[Avatar]
 offline contact
I added the Wait because I was assuming it would cause performance issues seeing as how its an older game. I just removed it, but for the time being I got the first player to work with all of the Terran units (besides the Dropship, cause its completely useless for what I'm doing).

The map is going to be basically a killing map. Every player has 3 beacons, one for each race, at each of the 8 sides of the map. They bring the civilian they start with to the corresponding beacon, and they get a random (Within use) unit from that race. Useless things like the Overlord, Dropship, and Shuttle will not be used, as they will not work. The objective of the map is to send whatever you get out on a rampage and destroy as many enemies as possible before you die yourself. There will be a counter of kills, and whoever has the most kills after a set amount of time wins. You will have all upgrades and techs (lv 3 in all trees) so there isn't any worries about that, but of course some units will have superiority over others. For example, if you get a scout, it might be a good idea to run after Vultures, or Lurkers or the like as they cannot attack you.
Back in the days when SC first came out, my brother created this map back then, and we no longer have any track of it. It was quite fun, and I feel like remaking it, and am doing as such.

As I said, the Terran part is working for the first player (XD). I'm going to incorperate computers into the map for people who dont do it with human players, I'll probably release it in like 4 forms, multiples of 2s for computers (None, 2, 4, and 6).

Ichigo: The mineral idea won't work because I am probably going to give you the requirement to make your Interceptors and other maintainable items when you get Carriers/Reavers/whatever. I could do it for Gas, but the random switch thing seems to be a better idea on my side.

On the tutorial it said to make a trigger that resets the switches if the right values weren't found. I found it easier just to add that Always, and just let you sit on the Beacons until it morphs you into whatever.

Oh and about the race switch thing: I just have it so that it kills your Civilian when you get a unit, and when you die, you get a new one.
Top

Post #10     NudeRaider Mar 7 2008, 8:59 am

[Avatar]
Write your own destiny, or else someone will write it for you!
 offline contact
The most efficient way to do it is using just 1-4 switches (depending on how many outcomes you need) and randomize them all the time with a separate trigger owned by all players.
There's no need to set a switch for the race of the beacon. In fact that could cause trouble if 2 players step on their beacons the same time. Make triggers like this: (You'll need <number of players> * <number of outcomes> * <number of races> triggers, but I'm showing only 2 examples)

Player 1
Conditions:

Current Player brings at least 1 Civilian to 'T1' (T1 = Terran beacon of Player 1)
Switch 'Random1' is set
Switch 'Random2' is cleared
... (check for more switches when you need more outcomes)
Actions:
Kill 1 Civ for current player at 'T1'
Create 1 Marine for current player at 'T1' (Marine = outcome switch R1 = 1 / R2 = 0)
preserve trigger


Player 2
Conditions:

Current Player brings at least 1 Civilian to 'Z2' (Z2 = Zerg beacon of Player 2)
Switch 'Random1' is set
Switch 'Random2' is set
... (check for more switches when you need more outcomes)
Actions:
Kill 1 Civ for current player at 'Z2'
Create 1 Hydralisk for current player at 'Z2' (Hydralisk = outcome switch R1 = 1 / R2 = 1)
preserve trigger
(signature image)
http://sonsofwar.pyrom.net/index.html___0% (user posted image) 100%
Top

Post #11     Polantaris Mar 7 2008, 7:26 pm

[Avatar]
 offline contact
It's not that much of a problem if 2 people activate the same exact beacon at the same time, they will just probably get the same unit. When I was doing the first 4 players, I didnt set the switch activations in the same way, because it doesn't really matter. What does matter is that every unit for every race (within reason) is possible of being spawned. Everything except the useless units are being randomized into it, and the extra switch outputs don't do anything, so your Civilian sometimes just sits around alittle longer, which doesn't matter because he's invincible.
What I mean is that (I have 4 switches)
When all 4 switches are cleared:
If you are stepping on a Terran Beacon at this time, you turn into a Marine
If you are stepping on a Zerg Beacon at this time, you turn into a Zergling
If you are stepping on a Protoss Becaon at this time, you turn into a Zealot
I have all the switches randomizing at all times, so there's almost no chance that that will happen, but if it does, oh well. Like I said though, some of the players have the outcomes alittle different because I was doing them differently so it's possible that all cleared for Zerg gets you a Mutalisk instead of a Zergling if you are player 3.
Top

Post #12     who Mar 7 2008, 7:45 pm

[Avatar]
someone09
 offline contact
RP-ichigo's method will also work with a death counter, if minerals are being used.
(user posted image)
Top

Post #13     NudeRaider Mar 7 2008, 9:32 pm

[Avatar]
Write your own destiny, or else someone will write it for you!
 offline contact
Quote from PolantarisIt's not that much of a problem if 2 people activate the same exact beacon at the same time, they will just probably get the same unit.

Yes, Player 1 steps on the Terran beacon and gets a marine, Player 2 steps on the Zerg beacon and gets a Marine too. -.-

Quote from PolantarisWhen I was doing the first 4 players, I didnt set the switch activations in the same way, because it doesn't really matter. What does matter is that every unit for every race (within reason) is possible of being spawned. Everything except the useless units are being randomized into it, and the extra switch outputs don't do anything, so your Civilian sometimes just sits around alittle longer, which doesn't matter because he's invincible.
What I mean is that (I have 4 switches)
When all 4 switches are cleared:
If you are stepping on a Terran Beacon at this time, you turn into a Marine
If you are stepping on a Zerg Beacon at this time, you turn into a Zergling
If you are stepping on a Protoss Becaon at this time, you turn into a Zealot
I have all the switches randomizing at all times, so there's almost no chance that that will happen, but if it does, oh well. Like I said though, some of the players have the outcomes alittle different because I was doing them differently so it's possible that all cleared for Zerg gets you a Mutalisk instead of a Zergling if you are player 3.

Really there's no need to go through all that fuzz. Just randomize always and you always have different results. Also there's no need to fear about cpu usage its absolutely negligible (except if you intend to do 1 trillion randomizations per second :P ).

There are many other correct solutions (posted above), but I posted the most simple and efficient one because I had the feeling there was some confusion about how to do it best.

Quote from someone09RP-ichigo's method will also work with a death counter, if minerals are being used.

No, his method won't work either way because he is using P12. P9+ can't have their DCs or Resources modified.
This post was edited 1 time, last edit by NudeRaider: Mar 7 2008, 9:44 pm.
(signature image)
http://sonsofwar.pyrom.net/index.html___0% (user posted image) 100%
Top

Post #14     Polantaris Mar 7 2008, 10:08 pm

[Avatar]
 offline contact
Quote from NudeRaider
Quote from PolantarisIt's not that much of a problem if 2 people activate the same exact beacon at the same time, they will just probably get the same unit.

Yes, Player 1 steps on the Terran beacon and gets a marine, Player 2 steps on the Zerg beacon and gets a Marine too. -.-


Actually, no.
Each Beacon is handled by a different Location, and all use the same switches
All the beacons use a Bring command as well as the switch checks, 4 cleared on the terran beacon gives a different result than 4 cleared on the zerg beacon, and something else than 4 cleared on the protoss beacon.
Top

Post #15     NudeRaider Mar 7 2008, 10:23 pm

[Avatar]
Write your own destiny, or else someone will write it for you!
 offline contact
Quote from Polantaris
Quote from NudeRaider
Quote from PolantarisIt's not that much of a problem if 2 people activate the same exact beacon at the same time, they will just probably get the same unit.

Yes, Player 1 steps on the Terran beacon and gets a marine, Player 2 steps on the Zerg beacon and gets a Marine too. -.-

Actually, no.
[...]

I know. Ofc you can (and should) use only 1 set of switches for the randomization.
I was referring to an extra switch for the RACE (which was someone09's proposal).
Quote from NudeRaiderThere's no need to set a switch for the race of the beacon. In fact that could cause trouble if 2 players step on their beacons the same time.

Well however, we both agree on NOT using a race switch and rather use the location for the condition, so there's no need to discuss this further. ;)
(signature image)
http://sonsofwar.pyrom.net/index.html___0% (user posted image) 100%
Top

Post #16     Polantaris Mar 7 2008, 10:24 pm

[Avatar]
 offline contact
Ah okay, I mis read. My bad =)
Top
0 members in this topic: None
+ 0 guest(s)


[02:48 am]
[Echo]:] -- i was gonna ask dark marine to pop in :(
[02:45 am]
Obama.l)ark_ssj9kevin -- wtf fail you cant have the same person for that
[02:45 am]
Obama.l)ark_ssj9kevin -- thats right meowth? wtf?
[02:45 am]
NerdyTerdy -- Meowth Dat’s right!
[02:45 am]
NerdyTerdy -- Surrender now or prepare to fight!
[02:42 am]
[Echo]:] -- Team Rocket, blast off at the speed of light!
[02:42 am]
NerdyTerdy -- James!
You must log in to shout.

©2003-2008 Staredit Network.
Starcraft & Starcraft II are trademarks of Blizzard Entertainment.
Site Index   |   Terms of Service   |   Privacy Policy   |   Contributions