Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Cycling between units in the Unit Index (EUD question)
Cycling between units in the Unit Index (EUD question)
Apr 5 2019, 12:48 pm
By: Brusilov  

Apr 5 2019, 12:48 pm Brusilov Post #1



Sorry to bother everyone by asking about this again, but my previous thread got off topic, so I'm separating this into a new topic:

I have 200+ cyber cores on the map. At any given time, a player is likely to own between 5 to 50 of them. Each of these cyber cores is a unit spawner, and when the unit spawn trigger activates, the trigger must check the unit HP of the cyber core and spawn units based on the HP value.

My problem is; I can't just use this simple trick anymore, which would let me cycle through all cyber cores until they're Player 12, then give them back to Current Player:

Example
Players

  • Force 1
  • Conditions

  • Spawn is Set
  • Current Player brings Cyber Core to 'Anywhere'
  • Actions

  • Create Units
  • Give Cyber Core to Player 12
  • Move 'Spawn' to Cyber Core owned by Current Player at 'Anywhere'
  • Preserve Trigger


  • Because I'm reading HP values, I have to cycle through units based on the Unit Index ID. However, what if Player 1 owns Cyber Cores at Unit ID index 2 and index 125? I could have a trigger that checks sequentially whether the player owns 3, 4, 5, 6.... and so on until it arrives at 125 and fires successfully. But this is heavy and would take several seconds. And this trigger might need to fire for multiple players at once.

    Is there a better way? Can I use EUD's to tell it to "go to the next Cyber Core in the Unit Index *owned by Current Player* (or, idk, output that value to a death count, so that I can skip indexes 3-124)? Is there some trick with arithmetic and stored values I could use? I'm pretty new to EUD's so I appreciate any help here. I want to make this as streamlined as possible.



    None.

    Apr 5 2019, 1:44 pm Brusilov Post #2



    I just had an idea, actually:

    Perhaps when the Spawn trigger initiates, I'll automatically move a location to 'Any' Cyber Core owned by Current Player and spawn a unit. Then, I send it off to a separate "detection" trigger. This trigger will detect what Cyber Core the spawned unit was next to, and then set a death counter to a number that matches the Unit Index ID of that cyber core. Then my unit spawn will take place, the cyber core will be given to Player 12, rinse and repeat until all Cyber Cores are Player 12.

    There's a lot of stages, but I think it could "work". Does anyone have a better idea? I've illustrated my idea just below:

    Move to Cyber Core
    Players

  • Force 1
  • Conditions

  • Switch 'Spawn' is 'Set'
  • Switch 'Detect Cyber Core' is 'not set'
  • Switch 'Spawn Calculations' is 'not set'
  • Current Player brings 'at least' 1 Cyber Core to 'Anywhere'
  • Actions

  • Move 'Location 1' to Cybernetics Core owned by 'Current Player' at 'Anywhere'
  • Create Unit '1' 'Terran Wraith' for 'Current Player' at 'Location 1'
  • Set Switch 'Detect Cyber Core'
  • Preserve Trigger


  • Detect Index ID
    Players

  • Force 1
  • Conditions

  • Switch 'Spawn' is 'Set'
  • Switch 'Detect Cyber Core' is 'Set'
  • Current Player brings 'at least' '1' 'Terran Wraith' to 'Cyber Core Location 25 (unit index 25)'
  • Actions

  • Set switch 'Detect Cyber Core' to 'not set'
  • Set switch 'Spawn Calculations' to 'set'
  • Set deaths for Current Player: 'set to' '25' for 'Independent Starport'
  • Remove '1' 'Terran Wraith' for 'Current Player' at 'Cyber Core Location 25'
  • Preserve Trigger


  • Spawn troops, reset to start
    Players

  • Force 1
  • Conditions

  • Spawn Calculation is 'set'
  • 'Current Player' has suffered 'exactly' '25' deaths of 'Independent Starport'
  • Actions

  • [perform EUD calculations on Unit Index 25]
  • Spawn units
  • Clear switches 'Spawn Calculation' and 'Detect Cyber Core'


  • Reset cyber cores when spawn is finished
    Players

  • Force 1
  • Conditions

  • Switch 'Spawn' is 'Set'
  • Switch 'Detect Cyber Core' is 'not set'
  • Switch 'Spawn Calculations' is 'not set'
  • Current Player brings 'at lmost' 0 Cyber Core to 'Anywhere'
  • Actions

  • Give 'All' 'Cybernetics Core' owned by 'Player 12' to 'Current Player'
  • Clear switch 'Spawn'
  • Preserve Trigger


  • My only worry with this one is that the "spawn units" trigger will actually be between 3-9 different triggers... meaning that each individual cyber core will have like 10 triggers run on it every spawn.



    None.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [07:46 am]
    RIVE -- :wob:
    [2024-4-22. : 6:48 pm]
    Ultraviolet -- :wob:
    [2024-4-21. : 1:32 pm]
    Oh_Man -- I will
    [2024-4-20. : 11:29 pm]
    Zoan -- Oh_Man
    Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
    You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
    [2024-4-20. : 8:20 pm]
    Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
    [2024-4-20. : 8:20 pm]
    Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
    [2024-4-20. : 8:18 pm]
    Ultraviolet -- Oh_Man
    Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
    oh ya I saw that when Armo posted it on Discord, pretty crazy
    [2024-4-20. : 8:09 pm]
    Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
    [2024-4-20. : 8:09 pm]
    Vrael -- woo baby talk about a time crunch
    [2024-4-20. : 8:08 pm]
    Vrael -- Oh_Man
    Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
    so that gives me approximately 27 more years to finish tenebrous before you get to it?
    Please log in to shout.


    Members Online: jun3hong, Roy