Staredit Network

Staredit Network -> UMS Assistance -> Distributing units to people
Report, edit, etc...Posted by Noober on 2006-03-04 at 19:18:38
Ok, I have this d that supports 7 people, each with their own land to defend (like path d). Each level, I have 21 enemies to be created in a place, then distributed to the player's enemy spawn place. So, each player gets 3 enemies to kill. However, if a player is not there, or has died, the enemies shouldn't be moved to that player's place. I already have a complicated system that does this, consisting of lots of switches and stuff. How would I do a more effecient system?

Yea, I know you can just create them at each player's location, but I'm too lazy to change all of them each level.

If there's a really simple way to do this, then I'm a noob XD.

ADDITION:
Oh, I forgot, you can't use waits, because of hyper triggers. If you could, it would be easy...
Report, edit, etc...Posted by dumbducky on 2006-03-04 at 19:20:15
You could create a trigger for each palyer saying if p1 is dead kill all men for p8 at P1 spawn.
Report, edit, etc...Posted by Noober on 2006-03-04 at 19:31:52
Yea, but that would mean moving them to p1 location always, or creating them there.

Hmm... I could try that. It's better that my current thing.
Report, edit, etc...Posted by PCFredZ on 2006-03-04 at 19:48:39
Just create the enemy units separately.

Instead of "Create 21 units at location for computer player", change the action to "Create 3 units at location for current player", then give to the computer players. Tada, number of units are created only for the players present.
Report, edit, etc...Posted by Subrosian on 2006-03-04 at 20:02:09
QUOTE(PCFredZ @ Mar 4 2006, 06:48 PM)
Just create the enemy units separately.

Instead of "Create 21 units at location for computer player", change the action to "Create 3 units at location for current player", then give to the computer players. Tada, number of units are created only for the players present.
[right][snapback]439273[/snapback][/right]

Better yet, make a trigger that creates 3 units for the computer player and distribute the trigger to all of the human players.
Report, edit, etc...Posted by Noober on 2006-03-04 at 20:15:35
Both of those require creating at each different location...

But oh well, I figured it out. Now I'm only using 7 switches... lol
Here's how:

If there is no p1, p1 switch is automatically cleared.
If p1 loses or leaves, p1 switch is cleared.

Create 21 units at spawn.
Distribute 3 to each place.

If p1 switch is cleared, remove all units at p1 spawn.

w00t.gif
Still kinda complicated, though. The reason I don't like creating 3 at each location seperately is every new level, you have to change the unit being created 7 times, and when you have a lot of levels, that gets annoying. With my way, you just change it once every level.
Report, edit, etc...Posted by Subrosian on 2006-03-04 at 21:04:25
QUOTE(Noober @ Mar 4 2006, 07:15 PM)
Both of those require creating at each different location...

But oh well, I figured it out. Now I'm only using 7 switches... lol
Here's how:

If there is no p1, p1 switch is automatically cleared.
If p1 loses or leaves, p1 switch is cleared.

Create 21 units at spawn.
Distribute 3 to each place.

If p1 switch is cleared, remove all units at p1 spawn.

w00t.gif
Still kinda complicated, though. The reason I don't like creating 3 at each location  seperately is every new level, you have to change the unit being created 7 times, and when you have a lot of levels, that gets annoying. With my way, you just change it once every level.
[right][snapback]439300[/snapback][/right]


You can have a location move onto a stationary unit which is in the area where the enemies spawn, so you don't have to recreate the trigger 7 times per unit.
Report, edit, etc...Posted by Demaris on 2006-03-04 at 21:17:01

Have these triggers:


Trigger
Description:
Enemy Spawn
Players:
¤ Player 8 or whatever
Conditions:
¤ Level 1 is met
Actions:
¤ Create 21 enemies at "Enemy spawn"







Trigger
Description:
Player Detect
Players:
¤ Player 1
Conditions:
¤ always
Actions:
¤ Set Switch "Player 1 is here"


Have one of these for each player. Owned by the player it is referring to and have a seperate switch for each one.


Then have one of these for each player as well:

Trigger
Description:
Distribution
Players:
¤ Player 1
Conditions:
¤ "Player 1 is here" is set.
Actions:
¤ Move one any unit from "enemy spawn" to "player 1 spawn"
¤ Preserve Trigger



Enemy Spawn - A seperate area where enemy units spawn.
Player 1 Spawn - The beginning zone of Player 1's area


Make sure the last triggers I stated are in order, or bad things will happen.
p1
p2
p3
p4
p5
p6
p7

Otherwise, this should do what you want it to.


ADDITION:

With my method, you only need these triggers for all of your levels tongue.gif
Report, edit, etc...Posted by Noober on 2006-03-05 at 00:25:20
Yea, that's basically what I have now.

Sub, that's a good idea, but then I'll have to have a unit at each player's spawn, which looks weird. Also, all units there are ordered to move, anyway.
Report, edit, etc...Posted by Kumano on 2006-03-05 at 08:50:46
You could just move them to the different players spawn areas, and then just remove them if the player isn't there. You don't need switches to tell if they are there, you could just have it as 'Player X commands exactly 0 any unit' in the trigger to remove them.
Report, edit, etc...Posted by Noober on 2006-03-05 at 10:49:00
Oh yeah... why didn't I think of that. Thanks, I'll try that later.
Report, edit, etc...Posted by joker2kill on 2006-03-05 at 22:19:51
QUOTE(PCFredZ @ Mar 4 2006, 04:48 PM)
Just create the enemy units separately.

Instead of "Create 21 units at location for computer player", change the action to "Create 3 units at location for current player", then give to the computer players. Tada, number of units are created only for the players present.
[right][snapback]439273[/snapback][/right]

Best decision

QUOTE(Kumano @ Mar 5 2006, 05:50 AM)
You could just move them to the different players spawn areas, and then just remove them if the player isn't there. You don't need switches to tell if they are there, you could just have it as 'Player X commands exactly 0 any unit' in the trigger to remove them.
[right][snapback]439667[/snapback][/right]

2nd best decision
Report, edit, etc...Posted by (U)Bolt_Head on 2006-03-06 at 01:08:35
Put a location over each players spawn location. Then make an additional one that will be moved around. You can call it something cool like "moble spawn"

Then use these triggers.

Trigger
Players:
¤ Player 1
Conditions:
¤ Always
Actions:
¤ Center location 'moble spawn' on 'independant CC' for 'all players' at 'P1 Spawn'
¤ Preserve Trigger

Center the location on a unit that doesn't exist. The location will basicly be centered on the other one. Repeate this trigger for each of the players using each of the players spawn location. make one for each of the players before making the next trigger

Trigger
Players:
¤ Human Force
Conditions:
¤ Switch or whatever conditions for level to start
Actions:
¤ Create 3 marines at 'moble spawn' for computer player.


Because of the trigger order these triggers will always spawn directly after the location is moved to their spawn area. Also since they own the trigger then the units won't spawn if they arn't there because there not there to run the trigger.

PS. Judgeing on how other people responded I assumed you wanted to spawn only 3 units for each player not 21 total divided between all the players.
Report, edit, etc...Posted by Noober on 2006-03-06 at 15:17:44
Yeah, that would work too. I'd do that, but it's already working fine now. Thanks all that helped...

How do I lock this? lol
Next Page (1)