• 0

    posted a message on Is there a compact way to run the same trigger based on a number of different events?

    Lets say I have 3 regions. When a unit walks into a given region, I want that unit to be dealt a certain amount of damage (depending on the region). I could make 3 triggers, have each trigger represent 1 region and then manually add how much damage each region causes. This isn't ideal because what if i want to add 5 more regions? I would have to make 5 more triggers. Even worse, what if i wanted to deal some damage and take away some minerals. I would have to manually modify all 8 triggers https://mobdro.onl/ https://vidmate.onl/.

    A more clever solution is to make a custom record that is made up of a region variable and an int variable (for the damage), make an array out of that record, then make 1 trigger that has 3 events (one for each region). When the trigger fires I flip through the array to find the appropriate region, then I deal the appropriate damage. Still, if I wanted to add more regions I would have to modify the array of custom records and the list of events in the trigger.

    I would really prefer it if i could make a single trigger with a single event. The event would have something like "fire when a unit enters any region". When the trigger fires I would grab the triggering region and attempt to look it up in my array. If i find the record, hooray! go ahead and run the damage code. If i don't find the record, well then don't do anything. The advantage of this is any time i want to add more regions, i just have to modify the array.

    1. Does what i'm asking for make sense? 2) How do I do this? 3) If i can't do this, how can i do something similar (i.e. set up my triggers/variables so that adding and removing regions can be done at exactly 1 location)? 4) Is this not the right place to be asking SC2 Map Editor questions? 5) Where should I be asking for editor help?

     
    Posted in: Map Feedback
  • To post a comment, please or register a new account.