Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: SCM Draft: Trigger Variables?
SCM Draft: Trigger Variables?
Mar 14 2018, 7:36 pm
By: Blackk9
Pages: < 1 2 3
 

Mar 19 2018, 3:17 am Blackk9 Post #41



Quote from jjf28
If there's something like a banner beacon that always exists for the player then "command at least 1 x/command exactly 0 x" is an easy solution.

If you're a bit stingier on units you could do something like "set deaths of isInGame for p1 to 0", "set deaths of isInGame for p2 to 0", ... "set deaths of isInGame for p8 to 0", followed by a "set deaths of isInGame for all players to 1", any player that doesn't have the value is out of the game.

If you're tracking the caboose player (that is, the last player remaining in the game of p1-p8) or the last slot is a computer you could have one trigger owned by all players that sets to 1 for current player and the caboose check for deaths at 0/1 then set deaths for all players back to 0.

Alright, everyone's supposed to spawn a Civilian ("Selector") at the beginning of the game, so I guess as long as they control at least 1 "Selector" then the buildings stay. Otherwise those buildings are removed.

However, the Caboose player variable holder would probably work best.



None.

Mar 19 2018, 4:09 am Lanthanide Post #42



Assuming the player is always expected to have at least one unit, then you can just easily do "player 1 commands exactly 0 [any unit]", owned by a CPU player. Everything owned by a human player is transferred to P12 when they leave the game, so if they have no units, they must have left (or were never in the game to start with - which may or may not be something you want to track).



None.

Mar 19 2018, 4:55 am Blackk9 Post #43



Quote from Lanthanide
Assuming the player is always expected to have at least one unit, then you can just easily do "player 1 commands exactly 0 [any unit]", owned by a CPU player. Everything owned by a human player is transferred to P12 when they leave the game, so if they have no units, they must have left (or were never in the game to start with - which may or may not be something you want to track).

That last part is exactly what I want to track. Whether or not they're in the game.

See, there are 6 specific areas that have buildings for all 3 races, with maxed out Supply / Psi / Control for all of them. Obviously, this poses problems for the maximum number of units allowed on the map at once. So, in order to counteract this. I want to remove buildings from those specific places where the player normally would be, provided he were actually in game.

In addition, I'd also like to track if the enemy is still there. If there is none, then the opposite side wins.



None.

Mar 19 2018, 7:38 am Lanthanide Post #44



Just use "player 12 bring [any unit] to building location", and remove all the buildings there.

If the player never starts, the buildings won't appear in game anyway. If they leave early, the buildings get given to P12, so you can just detect that P12 now owns something there, and then remove all of the buildings.



None.

Mar 19 2018, 5:34 pm NudeRaider Post #45

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

There used to be a trick where you preplaced certain buildings / units for extended Players (13+) which would cause a buffer overflow which modified the supply values. Those units could be removed after map start so you can set arbitrary supply - even higher than the 200 limit, without occupying a unit slot. Farty made a nice calculator for it:
http://farty1billion.dyndns.org/SupplyMod.php

I just don't think this got updated for SC:Remastered.




Mar 19 2018, 6:05 pm Blackk9 Post #46



Quote from Lanthanide
Just use "player 12 bring [any unit] to building location", and remove all the buildings there.

If the player never starts, the buildings won't appear in game anyway. If they leave early, the buildings get given to P12, so you can just detect that P12 now owns something there, and then remove all of the buildings.

So... this?

Player 1 Building Removal
Players

  • Player 1
  • Conditions

  • Current player commands at most 0 [any unit].
  • Actions

  • Comment:Player 1 Building Removal
  • Preserve Trigger.
  • Remove all [any unit] for Player 12 at P1 Buildings.
  • Kill all [any unit] for Player 12 (to remove all units currently on the field, to prevent lane clogging).




  • None.

    Mar 19 2018, 6:16 pm NudeRaider Post #47

    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

    Absent players cant execute triggers, so have it owned by cpu player (if there is non, All Players will work too) and check for units of P1.

    Otherwise, should work.




    Mar 19 2018, 7:59 pm Blackk9 Post #48



    Quote from NudeRaider
    Absent players cant execute triggers, so have it owned by cpu player (if there is non, All Players will work too) and check for units of P1.

    Otherwise, should work.

    OOOOOH wow, that. Thanks yeah. It was looking at it backwards.

    Player x Building Removal
    Players

  • Player 4
  • Conditions

  • Current Player brings at least 1 [any unit] to Player 1 Buildings.
  • Player 1 brings at most 0 [any unit] to Player 1 Buildings.
  • Actions

  • Comment:Player x Building Removal.
  • Remove all [any unit] for Current Player at Player 1 Buildings.


  • And of course

    Neutral Kill
    Players

  • All Players
  • Conditions

  • Player 12 (Neutral) controls at least 1 [any unit].
  • Actions

  • Comment:Neutral Kill
  • Preserve Trigger.
  • Kill all [any unit] for Player 12.




  • None.

    Mar 19 2018, 8:20 pm Lanthanide Post #49



    Quote from NudeRaider
    There used to be a trick where you preplaced certain buildings / units for extended Players (13+) which would cause a buffer overflow which modified the supply values. Those units could be removed after map start so you can set arbitrary supply - even higher than the 200 limit, without occupying a unit slot. Farty made a nice calculator for it:
    http://farty1billion.dyndns.org/SupplyMod.php

    I just don't think this got updated for SC:Remastered.
    Or you could just use EUDs to set supply race and available to whatever you want for all races, and start at 0 even if they already have pre-placed units. Or just make all units cost 0 supply and not worry about it at all.

    Quote from Blackk9
    OOOOOH wow, that. Thanks yeah. It was looking at it backwards.

    Player x Building Removal
    Players

  • Player 4
  • Conditions

  • Current Player brings at least 1 [any unit] to Player 1 Buildings.
  • Player 1 brings at most 0 [any unit] to Player 1 Buildings.
  • Actions

  • Comment:Player x Building Removal.
  • Remove all [any unit] for Current Player at Player 1 Buildings.
  • This trigger doesn't make a lot of sense. It doesn't actually remove any of P1's buildings, and it only executes when P4 (why P4?) brings a unit to P1's building area and P1 doesn't have any units there, and then it just removes P4's unit. What's the point?



    None.

    Mar 19 2018, 10:23 pm NudeRaider Post #50

    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 Lanthanide
    This trigger doesn't make a lot of sense. It doesn't actually remove any of P1's buildings, and it only executes when P4 (why P4?) brings a unit to P1's building area and P1 doesn't have any units there, and then it just removes P4's unit. What's the point?
    I think he has trouble with the "Current Player" concept. So I'll explain.

    Current Player (CP) in triggers always refers to the player that currently runs (slightly different from owns, which I'll explain shortly) the trigger. If you have your trigger owned by P4 CP can only ever be P4. You use CP if you want a group of Players (e.g. Force 1) to do the the same thing, without having to write the trigger 3 times.

    So imagine this trigger:
    3 in 1
    Players

  • Force 1
  • Conditions

  • Current Player brings civ to "buy Marine"
  • Actions

  • Create 1 Marine at "buy Marine" for Current Player


  • What it will do is create 3 copies of the trigger, 1 for each player. And then during a trigger loop, CP is replaced with the Player who is currently running the trigger. The engine then sees this:

    Player 1 runs through their trigger list
    Players

  • P1
  • Conditions

  • P1 brings civ to "buy Marine"
  • Actions

  • Create 1 Marine at "buy Marine" for P1


  • Player 1 is done with their triggers, now it's P2's turn
    Players

  • P2
  • Conditions

  • P2 brings civ to "buy Marine"
  • Actions

  • Create 1 Marine at "buy Marine" for P2


  • now Player 3
    Players

  • P3
  • Conditions

  • P3 brings civ to "buy Marine"
  • Actions

  • Create 1 Marine at "buy Marine" for P3


  • (In reality there's a few checks and stuff involved when working with Forces and Current Player, so it will NOT always be the same as making the trigger with fixed Players 1,2 and 3. But to explain the concept this shall suffice at that point.)

    I want you to notice that the orange trigger owner is always the same that yellow CP is converted to when the trigger is run.


    So... if all you wanna do is remove the leftover buildings and units from Players that have left, you really only need your "Neutral Kill" trigger. Yeah, it's that simple.

    If you wanna do stuff based on which (or just any) player is missing, then you need another trigger, owned by All Players, a force or computer player. Simple example if you want to distribute the units the missing player had on the field to the other players:

    Give Neutral units to alive players
    Players

  • Human Force
  • Conditions

  • P12 brings at least 1 [men] to "Playing field"
  • Actions

  • Give 1 [men] of P12 at "Playing field" to Current Player
  • Preserve


  • Lets imagine P3 left, and had 5 units on the field. P1, P2 are still playing. This is what happens:
    P1 checks their trigger, notices 1 men for P12, runs the trigger, gets the leftmost unit. 4 Neutral units left.
    P2 checks their trigger, notices 1 men for P12, runs the trigger, gets the leftmost unit. 3 Neutral units left.
    --- next trigger loop ---
    P1 checks their trigger, notices 1 men for P12, runs the trigger, gets the leftmost unit. (2 Total) 2 Neutral units left.
    P2 checks their trigger, notices 1 men for P12, runs the trigger, gets the leftmost unit. (2 Total) 1 Neutral units left.
    --- next trigger loop ---
    P1 checks their trigger, notices 1 men for P12, runs the trigger, gets the leftmost unit. (3 Total) 0 Neutral units left.
    P2 checks their trigger, doesn't find any P12 units, skips the trigger.

    P1 gets 3 units, P2 gets 2.

    The Kill Neutral trigger will take care of the buildings.

    Post has been edited 1 time(s), last time on Mar 19 2018, 10:29 pm by NudeRaider.




    Options
    Pages: < 1 2 3
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [10:41 am]
    v9bettel -- Nice
    [01:39 am]
    Ultraviolet -- no u elky skeleton guy, I'll use em better
    [10:50 pm]
    Vrael -- Ultraviolet
    Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
    hey cut it out I'm getting all the minerals
    [10:11 pm]
    Ultraviolet -- :P
    [10:11 pm]
    Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
    [2024-4-17. : 11:50 pm]
    O)FaRTy1billion[MM] -- nice, now i have more than enough
    [2024-4-17. : 11:49 pm]
    O)FaRTy1billion[MM] -- if i don't gamble them away first
    [2024-4-17. : 11:49 pm]
    O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
    [2024-4-17. : 3:26 am]
    O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
    [2024-4-17. : 1:53 am]
    Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
    Please log in to shout.


    Members Online: jun3hong, Callfbyad