Shiva of Scum.net has written a tutorial on how unit creation works in StarEdit. I originally saw this posted at SC Org but couldn't find it anywhere at Scum.Net. Soooooo, i decided i'd just post it here for now :) Hope it helps everyone having probs in this area.
A while back I made a post saying that the map editor for SC had a bug when creating units at a location. Well I'm gald to say that I was wrong. It was actually I could not do math (at least determine the variable which effected the unit generation).
Here is why when you create a unit different ammounts can occur, you have the choice of creating them by current player, player#, and Force #. Well these are different modifyers depending on how may allies you have. Here is what I mean: If you are the blue player(player2) allied with the teal player(player 3). And you are both in (Force 1). The modifyers for the player denominations are as follows:
Player2 = 1 blue unit or (1B)
Player3 = 1 teal unit or (1T)
current player = 2 blue units or (2B) = number of allies you have but all yor color.
force 1 = 1 blue + 1 teal unit or (1B + 1T)now if you did what I did and tried to make a trigger for 3 units (create unit at location)X(3): You would have
PLAYER
< player denomination > player#, current player, or force#CONDITION
When < player denomination > brings 1 or more units to location XACTION
Create unit < unit name > for < player denomination > at location y with properties
Create unit < unit name > for < player denomination > at location y with properties
Create unit < unit name > for < player denomination > at location y with propertiesNow the thing is that the modifyers that count for determining how many players get created is in the PLAYER TAB and the ACTION TAB when you create the trigger( the CONDITION tab just has to have the player denomination corresponding to your trigger that is declared in the ACTION adn PLAYER tabs). So, if you have 2 allies (active on the screen) and you check for force 1 when whoever comes to location X create unit(s times) for force 1 you will actually end up with 6 blue units and 6 teal units. Here is why: (considering you do 3 unit creations at one spot) PLAYER(force 1)= 1B+1T more sp
times I want the unit created = 3
ACTION create for force1 = 1B=1T
so you will get
(3)(2)(1b+1T) = 6 blue units adn 6 teal units
where 3 is the numer of times I created the unit and 2 how many ACTIVE
allies I have.If you want a small army add a another ally to the active map. You will end up with 27 units in the script. And with 4 allies, two words, WHOA NELLIE! :)
Now you can get away with doing this with units but if you try to use buildings you will get error messages. You need to do this:
PLAYER for specific player (NOT A FORCE)
CONDITION (dosen't matter who as long as your player or force they are in is mentioned here)
ACTION create unit/building for your player.Well I hope this helps people with their unit creation question. I know I slammed my head against a wall for about 4 days on this one. And I never thought I would get the chance to use Mendel squaresto figure something out ever again :)
Shiva