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 16 2018, 2:10 am Lanthanide Post #21



So one trick with Victory conditions, is that in the cycle where Victory is run, all other players that do not also run Victory in that same cycle, will automatically receive Defeat.

I take it your CPU players are P4 and P8, and because they aren't loading in the game, all the human players are getting defeat?

So things to check
1. Start locations are placed
2. In the map properties, each CPU player is marked as CPU, and has a race chosen. User select won't work.



None.

Mar 16 2018, 2:45 am Blackk9 Post #22



Okay, I don't know what went wrong. Now the entire map just stopped working. Any time I try to load in, the game just spawns me in like it's a regular melee.



None.

Mar 16 2018, 3:15 am Pr0nogo Post #23



If your game mode is set to anything other than UMS it'll behave as a melee map. If your player race is set to user select the melee bases will spawn regardless of game mode.




Mar 16 2018, 4:18 am Dungeon-Master Post #24



So 4 and 8 are your computer players? Are you 100% posituve that they're in the correct force with the correct conditions/actions? Have you removed the default melee victory/defeat triggers?

I'm just throwing ideas out there. Could be a few things.

Post has been edited 1 time(s), last time on Mar 16 2018, 4:23 am by Dungeon-Master.



None.

Mar 16 2018, 5:05 am Blackk9 Post #25



Quote from Pr0nogo
If your game mode is set to anything other than UMS it'll behave as a melee map. If your player race is set to user select the melee bases will spawn regardless of game mode.

Yeah that's probably it. I had it so players could select their races for preference purposes. But I guess it'll have to be hard set to something. Thanks.



None.

Mar 16 2018, 6:29 am Blackk9 Post #26



I realize that this thread has gone way off topic. But all of you have really helped me out.

One other question. Teleporting units between locations via triggers is very slow. How do I speed this up?

West Force Marine Spawn
Players

  • Player 1
  • Player 2
  • Player 3
  • Conditions

  • Current player brings at least 1 Terran Marine to Unit Spawn
  • Actions

  • Comment:West Force Marine Spawn
  • Move 1 Terran Marine at Unit Spawn to West Spawn.
  • Preserve Trigger.


  • This goes very slow. Should I use binary countoffs for unit spawn as well, or is there a better way to make it go faster?

    Ignore all that. I figured it out. I don't believe I'll need any more help with this. Thank you all so much.


    Post has been edited 2 time(s), last time on Mar 17 2018, 2:51 am by Blackk9.



    None.

    Mar 17 2018, 2:49 am Blackk9 Post #27



    Okay, I lied. I need more help. The triggers for Income and Restoration of Gas aren't working properly.

    Only Player 1 receives resources properly. All other players do not. I tried with using the Map Revealer for everyone, that didn't work.

    I tried setting it to individual units. It still doesn't work. Only Player 1 seems to be getting resources. What is going on? Please help.



    None.

    Mar 17 2018, 4:35 am Pr0nogo Post #28



    Post your map




    Mar 17 2018, 5:32 am Blackk9 Post #29



    Quote from Pr0nogo
    Post your map

    Okay, the triggers are only in place for Players 1 and 5 for Simplicity's sake.

    Attachments:
    TempleWars_v0-4-2a.scm.scx
    Hits: 1 Size: 48.51kb



    None.

    Mar 17 2018, 7:07 am Blackk9 Post #30



    Quote from Chia-Tyrant
    I made you a map doing just what you want if you're still unclear about this.

    The trouble with triggers is that they only let us compare variables to constants. We're strapped for time so we'd like to avoid having to check for every possible value of gas. Fortunately, there's a pretty clever trick that lets us do just that with only a handful of triggers (you can check for 1023 different values with only 10 triggers!)

    You just need to know the following:

    1.Every number can be represented as a sum of powers of two. 3 is 2^1+2^0. 12 is 2^3+2^2. You probably know this as binary.
    2.That sum is always unique. You'll never find other powers of two that add up to the same number.
    3.You can always check for the largest power of two that can fit into your value. For example, if you know your gas will always be below 10,000, you can know if 2^13 (8,192) is in that sum by checking if it's 'at least' 8,192.
    4.If we know that 8,192 is in our sum, we can subtract it so we'll know the value is at most 8,191. We can go back to 3 and check the new greatest power of 2 that could fit into that: 4,096.

    After looping through 3 and 4, we'll know what the full sum is, i.e., we're guaranteed that the original value will now be 0 since we subtracted its powers of two from it. If we add the same amount into a death counter every time we subtract, we'll also know that the death counter now holds whatever that original value was.

    In order to be completely and Perfectly clear. I want this set up to run for All 6 players. Yet every time I try to make it work, it only works for Player one and literally nobody else.

    If you test it in single player it'll work just fine. But Multiplayer? Player 1 is literally the only one that the trigger will run for. I'm lost, and have no idea what to do.



    None.

    Mar 17 2018, 8:22 am Blackk9 Post #31



    Okay So I figured it out! Apparently having it happen when the Timer is at 0 causes errors. Big errors. It was messing with Starcraft's built in Trigger cycle. The minimum amount of time triggers should be given to complete their cycling is 2 seconds.

    But I'm going to give it a longer time frame. Either way, the error was caused by the game trying to calculate too much too quickly.

    Thank you all for all your help!



    None.

    Mar 17 2018, 9:02 am NudeRaider Post #32

    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

    Uhm are you using hyper triggers? (you should)
    If not, you probably had some transmissions or waits running (both force an additional trigger cycle.)
    If yes, you probably ran into wait blocks. Each player can only run 1 wait at the same time, including waits from hypers.




    Mar 17 2018, 9:43 am Lanthanide Post #33



    SC triggers can handle tens of thousands of calculations every second without a sweat. So your explanation is certainly not correct.

    Your problem is that the triggers owned by P5 only fire when the countdown timer is "at most 0 seconds". Player 4 has a trigger that says "when countdown timer is at most 0 seconds, set it to 30". This means the timer will NEVER be at most 0 seconds for P5, so those triggers for P5 will never run, hence why you don't get any income transfer for P5 but it works fine for P1.

    All of P1 triggers are executed before any of P2, and all of P2 before any of P3, etc. So all of P4 triggers are executed before any of P5's are, and since P4 always sets the timer to 30 seconds, P5 will never see the timer equalling 0.

    Countdown timer is a global timer that affects all players. You should move that trigger action to P8 (your other CPU) and then the income transfers for P5-7 will work, as well as P1-3, and any other actions you decide to attach to the countdown timer in the future.



    None.

    Mar 17 2018, 5:26 pm Blackk9 Post #34



    Quote from Lanthanide
    SC triggers can handle tens of thousands of calculations every second without a sweat. So your explanation is certainly not correct.

    Your problem is that the triggers owned by P5 only fire when the countdown timer is "at most 0 seconds". Player 4 has a trigger that says "when countdown timer is at most 0 seconds, set it to 30". This means the timer will NEVER be at most 0 seconds for P5, so those triggers for P5 will never run, hence why you don't get any income transfer for P5 but it works fine for P1.

    All of P1 triggers are executed before any of P2, and all of P2 before any of P3, etc. So all of P4 triggers are executed before any of P5's are, and since P4 always sets the timer to 30 seconds, P5 will never see the timer equalling 0.

    Countdown timer is a global timer that affects all players. You should move that trigger action to P8 (your other CPU) and then the income transfers for P5-7 will work, as well as P1-3, and any other actions you decide to attach to the countdown timer in the future.

    Oh, I see.

    So I should set Player 8 to handle restarting the Timer. Got it.

    Quote from NudeRaider
    Uhm are you using hyper triggers? (you should)
    If not, you probably had some transmissions or waits running (both force an additional trigger cycle.)
    If yes, you probably ran into wait blocks. Each player can only run 1 wait at the same time, including waits from hypers.

    I didn't know about hyper triggers. This will help a lot. Thank you.

    By the way, the Wiki article is a bit confusing. Does every player need a hyper trigger set up? Or just a few to get the hyper triggers working?

    Post has been edited 1 time(s), last time on Mar 17 2018, 6:13 pm by Blackk9.



    None.

    Mar 17 2018, 6:15 pm Pr0nogo Post #35



    If you're using switch hypers, 2 players need them. If you're using the preserve method, only one player needs them. No players with hypers should own other triggers with waits.




    Mar 18 2018, 8:34 am NudeRaider Post #36

    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's several ways to set up hypers. Each with their own things to keep in mind, which all stem from the special properties of how sc handles waits. You only need one player that runs their hypers, because the effect (inducing another trigger loop) is global.

    So when only one player has the hypers, and you have a wait above the hypers in their trigger list, the wait above will be executed, while the hyper triggers (and thus their effect) will be blocked. You can circumvent that by giving all players the hyper triggers, making sure they're at the bottom, so they get blocked, not the other wait. Now unless each player runs a wait at the same time, the hyper effect will be upheld.

    Obviously to keep things simple you could also give the hypers to just one player that is never going to run a wait. Computer players are a good choice for that.
    And now that can't use waits anymore, do your timing with death counters. Since your trigger loops are sped up dramatically, death counters can now be used for even for pretty precise timing needs, up to an accuracy of 84ms. (instead of 42ms, which is the resolution of waits. The game engine lies to you when it lets you input more accurate / smaller numbers.)




    Mar 18 2018, 8:39 am Lanthanide Post #37



    Or, use EUD hyper triggers, and you can use waits as much as you like, and it's just a simple trigger you have to preserve:
    EUD 2 frame hyper-triggers
    Players

  • [Any player you like]
  • Conditions

  • Always
  • Actions

  • Preserve Trigger
  • Modify Memory at Death Table +203151: Set to 1


  • That gives you 'traditional' 2-frame hypers. If you want 1 frame (23.8 trigger executions per second), which is unattainable by any other method, set to 0 instead.

    Most tutorials and guides etc will be based on 2-frame hypers (11.9 trigger executions per second). There are a few techniques that are only really possible if you use 1-frame hypers, but these are mostly EUD-based ones (although you should be able to use a 1x1 location to track *any* unit with 1-frame hypers).



    None.

    Mar 18 2018, 3:43 pm NudeRaider Post #38

    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

    Just going to note that 1 frame hypers (23.8 trigger loops / s) is equivalent to one trigger loop per 42ms, the resolution of waits I mentioned.




    Mar 19 2018, 2:16 am Blackk9 Post #39



    This question is actually on-topic.

    How do I check if a player exists with Triggers? I need to do this in order to de-spawn buildings in a player's location if they don't exist in the game.



    None.

    Mar 19 2018, 2:47 am jjf28 Post #40

    Cartography Artisan

    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.



    TheNitesWhoSay - Clan Aura - github

    Reached the top of StarCraft theory crafting 2:12 AM CST, August 2nd, 2014.

    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.
    [11:50 pm]
    O)FaRTy1billion[MM] -- nice, now i have more than enough
    [11:49 pm]
    O)FaRTy1billion[MM] -- if i don't gamble them away first
    [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
    [2024-4-17. : 1:52 am]
    Vrael -- hah do you think I was born yesterday?
    [2024-4-17. : 1:08 am]
    O)FaRTy1billion[MM] -- i'll trade you mineral counts
    [2024-4-16. : 5:05 pm]
    Vrael -- Its simple, just send all minerals to Vrael until you have 0 minerals then your account is gone
    [2024-4-16. : 4:31 pm]
    Zoan -- where's the option to delete my account
    [2024-4-16. : 4:30 pm]
    Zoan -- goodbye forever
    Please log in to shout.


    Members Online: Roy