Staredit Network > Forums > SC2 Assistance > Topic: Dynamic Region Attaching
Dynamic Region Attaching
Feb 22 2011, 1:55 am
By: playpong  

Feb 22 2011, 1:55 am playpong Post #1



Hi all, I have a question to pose. I'm making a map that's fairly similar to Risk, and I'm to the part of determining which territories each player controls, and I would like to spawn a specific number of units at each territory under the ownership of whoever owns the territory.

My original idea, was to attach regions to the Auto-Turret (the unit that defends each territory by default) and then I can determine who owns each territory by (Owner Of (Unit Attached to Region))... But I'm trying to figure out the best way to dynamically attach specific regions to specific Auto-Turrets when I have their death/spawn triggers set up dynamically as well.

Here's what I have:

There are 12 Auto-Turrets placed on the map in the editor, and their in a Unit Group called groupAutoTurret. I'm assigning custom values to them to distinguish their starting points. Since they can't move from those points, it pretty much assigns that specific Auto-Turret's spawning point.


This trigger determines if the player is a human, and if so, then it sets them up with their starting units. Each player has a specific starting point, and it's 5 players max, so I just wrote one for each starting position territory.


And then the last one I have handles the death of any Auto-Turret. If so, then it creates a new Auto-Turret for the killing player and then reassigns it's spawning point to it.



So again, I was thinking of just making a trigger that creates units for (Owner of (Unit Attached to Region)) whenever a timer expires... and then work in a Switch statement to determine Unit - Custom Value [0,1] to determine which territory it's spawning units for, to dictate which units to spawn...

But then that seems too complicated for what I'm trying to do -- I digress.. Any Ideas? Thanks for the help!



None.

Feb 25 2011, 11:08 pm Ahli Post #2

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

You have a list of auto turrets representing every land.
-> Save all turrets in a "countries" unit group @ map initialization and do other starting stuff like creating starting armies.

So every land controlling is determined by the control of the auto turret?
-> Spawn army for the owner of the auto turret except of the neutral country's auto turret after every timer expiration.
So you have to iterate through the unit group and create units (for each unit in unit group - create # X for p# in Random point of Cycle around auto turret).

Killing an auto turret is the action of capturing the territory?
-> If the turret gets killed, create a new turret belonging to the attacking force (the one who killed that turret and the turret's position is the position of the dying one (position of triggering unit)). Don't forget to add it to the "countries" unit group and delete the destroyed turret.

So why do you need regions again?
I somehow missed it I think. :)




Feb 28 2011, 3:11 pm playpong Post #3



Thanks, that did the trick! I just created the 12 towers initially, and gave them custom values representing their starting locations.. and then whenever a turret dies, i can use triggering units custom values to determine where to spawn the new turret, and where to award guys at, and who to give the new turret to (killing player).

Now if only I could make it more efficient! hehe



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:59 am]
zsnakezz -- >:)
[04:59 am]
zsnakezz -- :)
[04:58 am]
zsnakezz -- somebody gets it
[04:58 am]
zsnakezz -- and its not all just numbers in my file screen
[04:57 am]
zsnakezz -- thank you for your comment though, good to know some people out there tried my map out
[04:57 am]
zsnakezz -- just kidding
[04:57 am]
zsnakezz -- ultra you have any thought or notes on undead invasion?
[2024-5-31. : 2:36 pm]
Wing Zero -- Bop em
[2024-5-31. : 2:36 pm]
Wing Zero -- Mods
[2024-5-29. : 9:40 pm]
Ultraviolet -- :wob:
Please log in to shout.


Members Online: Roy, Oh_Man