Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Another question...
Another question...
Nov 17 2008, 6:24 pm
By: SaidinIncarnate  

Nov 17 2008, 6:24 pm SaidinIncarnate Post #1



Hi, back again. Just wondering how I would A: Detect if a player is not in or has left the game, and B: How to give units that would normally be given to that player via a trigger, to random people. By that I mean, the trigger goes something like this in the normal map.
Trigger("Force 1"){
Conditions:
Deaths("Force 1", "Alan Turret", Exactly, 2);

Actions:
Give Units to Player("Player 8", "Player 1", "Protoss Archon", All, "Level2 P1");
Give Units to Player("Player 8", "Player 2", "Protoss Archon", All, "Level2 P2");
Give Units to Player("Player 8", "Player 3", "Protoss Archon", All, "Level2 P3");
Give Units to Player("Player 8", "Player 4", "Protoss Archon", All, "Level 2 p4");
Give Units to Player("Player 8", "Player 5", "Protoss Archon", All, "Level2 p5");
Center View("Level2 P2");
In this case, the deaths of alan turret is set once level one is done, (2 for level 2 3 for level 3 and so on.)
How would I figure out if one of these players isnt here, and randomize who gets the unit? I thought randomizing might work if I gave his units to force 1, but as I cannot figure out how to detect his leaving/not being here, that wont work.
EDIT: Actually, detecting whether or not his comsat building is there would detect whether game STARTED with the player there. I just need to know how to figure out if he left.



None.

Nov 17 2008, 6:54 pm Ahli Post #2

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

If a player leaves, his buildings like the comsat station will be given to neutral/P12.




Nov 17 2008, 7:07 pm Pigy_G Post #3



If the player brings 0 units to location anywhere then set a switch that for the rest of the game will mean he's left. For that other part with the archons just have randomized switchs 3 switchs has 8 results, If you randomize the three switchs you will get one of the 8 results to give to a player, 2 switchs has 4 results, ect.



None.

Nov 17 2008, 8:16 pm NudeRaider Post #4

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

First of all I think your trigger has a mistake - assuming Force 1 is the player force. When you detect deaths of a whole force then starcraft will add up the deaths for each player. So if 5 players all have exactly 2 deaths you had to check for 10 deaths. As this obviously depends on number of players in the game you would not want that. Instead have Player 8 count the deaths.

To your problem:
Do you really need it randomized? Because giving the units to the player with the lowest player number would be much easier. But here's the complete randomization system plus the respective giving triggers.
Feel free to ask if you don't fully understand a part. But for now I let the triggers speak for themselves: ;)

Trigger 1a: Giving the regular units
Player 1
Conditions:

Player 8 has suffered Exactly 2 deaths of "Alan Turret"
Actions:
Give All units of Player 8 at "Level2 P1" to Current Player

Trigger 1b: Giving the regular units
Player 2
Conditions:

Player 8 has suffered Exactly 2 deaths of "Alan Turret"
Actions:
Give All units of Player 8 at "Level2 P2" to Current Player

... etc. until Trigger 1e for all 5 Players.
This ensures that only present players grab the units and they are not given to ghost players. (You can give units to players not present if you use their specific player number. But absent players can not execute triggers.)

Then the system that distributes the units that no one grabbed:

Trigger 2: Marking the units for distribution
Player 8
Conditions:

Player 8 has suffered Exactly 2 deaths of "Alan Turret"
Actions:
Give All units of Player 8 at "Level2 P1" to Neutral (P12)
Give All units of Player 8 at "Level2 P2" to Neutral (P12)
Give All units of Player 8 at "Level2 P3" to Neutral (P12)
Give All units of Player 8 at "Level2 P4" to Neutral (P12)
Give All units of Player 8 at "Level2 P5" to Neutral (P12)

Note that Player 8's triggers are checked last so most of the actions will not give units as they have already been taken by a player. Trigger order in the editor does not matter here.

Trigger 3a: Randomization init
Player 8
Conditions:

Always
Actions:
Set deaths to 1 of 'Rand' for Player 1
Set deaths to 2 of 'Rand' for Player 2
Set deaths to 3 of 'Rand' for Player 3
Set deaths to 4 of 'Rand' for Player 4
Set deaths to 5 of 'Rand' for Player 5

Only runs once at game start. Players have their individual counts always 1 apart from each other.

Trigger 3b: Randomization counter
Force 1
Conditions:

Always
Actions:
Subtract 1 death of 'Rand' for Current Player
Preserve

Trigger 3c: Randomization reset
Force 1
Conditions:

Current Player has suffered at most 0 deaths of 'Rand'
Actions:
Set deaths to 4 death of 'Rand' for Current Player
Preserve

Last 2 triggers loops the death value between 0-4

Trigger 4a: Distributing units that should have gone to P1
Force 1
Conditions:

Current Player has suffered exactly 0 deaths of 'Rand'
Actions:
Give all units of Neutral at Level2 P1 to Current Player

Trigger 4b: Distributing units that should have gone to P2
Force 1
Conditions:

Current Player has suffered exactly 1 deaths of 'Rand'
Actions:
Give all units of Neutral at Level2 P2 to Current Player

... etc until 4e to care for each of the 5 possible missing players.

Note that some triggers need a preserve, while others do not.

Post has been edited 1 time(s), last time on Nov 17 2008, 8:30 pm by NudeRaider.




Nov 17 2008, 10:34 pm SaidinIncarnate Post #5



Ok, this site has been amazingly helpful for the map I'm working on. Sorry about the noob questions but as I'm attempting to make an impossible as my first map, it's a lot more difficult than I'd thought. More than even the randomization, your telling me about my mistake on death count fixes the bug with my levels being fucked up! Thanks so much, will give you and rockz credit in my map.



None.

Nov 18 2008, 1:10 am rockz Post #6

ᴄʜᴇᴇsᴇ ɪᴛ!

I'm a no credit mapper. Anything I say is open source/stealable/claimable. Just mention SEN instead.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Nov 18 2008, 4:05 am NudeRaider Post #7

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from rockz
I'm a no credit mapper. Anything I say is open source/stealable/claimable. Just mention SEN instead.
seconded

I'm glad we could be of help. That's enough.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:32 pm]
Zoan -- I got $2000 bonus. I would like 2000 minerals, please
[2026-4-16. : 4:15 am]
DarkenedFantasies -- you eat lots of beans
[2026-4-16. : 3:46 am]
IskatuMesk -- how do i get gas
[2026-4-15. : 11:43 pm]
Moose -- you don't
[2026-4-15. : 10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
Please log in to shout.


Members Online: Prankenstein