Region triggers

DonMushroom

Member
Reaction score
4
Hi again :)

I was wondering if it is possible to make a trigger that reviles the player when there opponent has a unit in 4 different regions? :)



So if player 1 holds region 1,2,3 and 4 then player 2 is relieved to everyone on players 1's team.
 

DonMushroom

Member
Reaction score
4
OK so i can reveal the map when i want it to :)

Events
Timer - Every 1.0 seconds of Game Time
Local Variables
P = 0 <Integer>
Conditions
Actions
General - For each integer P from 1 to 8 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Number of Living units in (Any units in Region 001 M owned by player P matching Excluded: Structure, Missile, Cloaked, Dead, Hidden, with at most Any Amount)) > 0
(Number of Living units in (Any units in Region 002 M owned by player P matching Excluded: Structure, Missile, Cloaked, Dead, Hidden, with at most Any Amount)) > 0
(Number of Living units in (Any units in Region 003 M owned by player P matching Excluded: Structure, Missile, Cloaked, Dead, Hidden, with at most Any Amount)) > 0
(Number of Living units in (Any units in Region 004 M owned by player P matching Excluded: Structure, Missile, Cloaked, Dead, Hidden, with at most Any Amount)) > 0
(Number of Living units in (Any units in Region 005 M owned by player P matching Excluded: Structure, Missile, Cloaked, Dead, Hidden, with at most Any Amount)) > 0
(Number of Living units in (Any units in Region 006 M owned by player P matching Excluded: Structure, Missile, Cloaked, Dead, Hidden, with at most Any Amount)) > 0
(Number of Living units in (Any units in Region 007 M owned by player P matching Excluded: Structure, Missile, Cloaked, Dead, Hidden, with at most Any Amount)) > 0
(Number of Living units in (Any units in Region 008 M owned by player P matching Excluded: Structure, Missile, Cloaked, Dead, Hidden, with at most Any Amount)) > 0
Then
Visibility - Create a visibility revealer for player P within (Entire map)
Else


So when a unit holds the all the points the map reveals :)

I am now having trouble with removing the revealer when one or more of the points is lost :(


How would i go about this? :D
 

Kyuft

Member
Reaction score
11
Instead of "Action: Every 1 second game time", wouldn't it be more efficient to do "Unit enters Region" and make the action run for the triggering player.

-Kyuft:shades:
 

Kyuft

Member
Reaction score
11
Are revealers considered units? If so, you could make an action under the "Else" tag that kills all units of unit type Revealer owned by the player.

-Kyuft:shades:
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Revealers is a seperate object type (You can save it in a Revealer variable).

I'd do something similar to what Kyuft suggested. Have a trigger with events for "Unit enters region" for all your four regions and then check if the owner of the triggering unit has units in all the regions. If he does, create a new revealer and save it in a revealer variable array with size 15(Just to make sure you fit all possible players). Save it in RevealArray[(Triggering Player)]. You might want to check if RevealArray[(Triggering Player)] == No revealer, before you create it. Just so you'll prevent it from creating additional revealers if you enter with more units.

Next up, have a trigger that triggers if a unit leaves any of the four regions. Remove RevealArray[(Triggering Player)].

I think both me and DonMushroom would be grateful if someone with a bit of triggering experience could take what I just wrote and turn it into actual triggers to post here. Assuming what I wrote is correct, which is not always the case. I would do it myself but Physics finals, laptop, no editor etc.
 

Dave312

Censored for your safe viewing
Reaction score
269
I need a couple of clarifications as to how this is supposed to work so I can post some triggers:

1) Do you want to reveal the entire map or just the opposing players units?
2) If just revealing the opposing players units, should it be revealing the units of every player on that team?
3) Does the same player need to have units in every region or should it also reveal provided that team has one unit in each region? (ie, if players 5,6,7 and 8 are on the same team, should it reveal the opposition if Player 5 has a unit in Region 1, Player 6 has a unit in Region 2, Player 7 has a unit in Region 3 and Player 8 has a unit in Region 4?
 

MissKerrigan

Active Member
Reaction score
23
hey what you guys all doing difficould here with variables and stuff, just create conditions 'unit is in region and make action 'create revealer'. Create another trigger if unit leaves region, remove revailer

I assuming it's something like a 'xel naga tower'?
 

DonMushroom

Member
Reaction score
4
Dave :)

1) Opposing players units
2) Every player on team that does not have points
3) The team has all the points between them

Kerrigan :)

I need all that because im trying to link 16 regions to a revieler to work with different combinations of the regions being held by different players :D
 

Dave312

Censored for your safe viewing
Reaction score
269
First of all I wouldn't be using revealers to grant the vision but instead use the Set Alliance Aspect action to grant one directional shared vision of the players units. This makes things easier because you don't need to worry about using variables to keep track of all the revealers and Shared Vision can be simply turned off.


Just to confirm: There are 16 regions which players "control". When a team controls 4 or more, any players on the opposing team that do not control any regions are revealed. If a team with granted shared vision loses regions and controls less than 4, shared vision is lost. If player who has shared vision against them gains control over a region then opposing players lose shared vision against them. Is this correct?
 

DonMushroom

Member
Reaction score
4
There are 16 regions :)
8 players (4 each team)
If a team controls all 16 the other team gets relieved.
If a team has all 16 and loses 1 the other team is no longer reviled :)

I have put the current version of the map in members projects so everyone can see how its coming along :)
 

Dave312

Censored for your safe viewing
Reaction score
269
Sorry I had to do this in a rush so hopefully I haven't made any mistakes. The long condition uses a Number of Units In Unit Group function where the Unit Group parameter is set to the Units In Region With Alliance To Player. If you have any problems/questions, let me know.

Trigger:
  • Player Gains Region
    • Events
      • Unit - Any Unit Enters Region01
      • Unit - Any Unit Enters Region02
      • Unit - Any Unit Enters Region03
      • etc...
    • Local Variables
      • i = 0 &lt;Integer&gt;
      • j = 0 &lt;Integer&gt;
    • Conditions
    • Actions
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • (Number of Living units in (Units in (Region01) having alliance Ally with player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most 1)) == 1
          • (Number of Living units in (Units in (Region02) having alliance Ally with player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most 1)) == 1
          • (Number of Living units in (Units in (Region03) having alliance Ally with player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most 1)) == 1
          • etc...
        • Then
          • Player Group - For each player j in (Enemies of player (Triggering player)) do (Actions)
            • Actions
              • Player - Turn player j Shared Vision On towards player (Triggering player)
              • Player Group - For each player i in (Allies of player (Triggering player)) do (Actions)
                • Actions
                  • Player - Turn player j Shared Vision On towards player i
        • Else

Trigger:
  • Player Loses Region
    • Events
      • Unit - Any Unit Leaves Region01
      • Unit - Any Unit Leaves Region02
      • Unit - Any Unit Leaves Region03
      • etc...
    • Local Variables
      • i = 0 &lt;Integer&gt;
      • j = 0 &lt;Integer&gt;
    • Conditions
    • Actions
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • (Number of Living units in (Units in (Region01) having alliance Ally with player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most 1)) == 1
          • (Number of Living units in (Units in (Region02) having alliance Ally with player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most 1)) == 1
          • (Number of Living units in (Units in (Region03) having alliance Ally with player (Triggering player) matching Excluded: Missile, Dead, Hidden, with at most 1)) == 1
          • etc...
        • Then
        • Else
          • Player Group - For each player j in (Enemies of player (Triggering player)) do (Actions)
            • Actions
              • Player - Turn player j Shared Vision Off towards player (Triggering player)
              • Player Group - For each player i in (Allies of player (Triggering player)) do (Actions)
                • Actions
                  • Player - Turn player j Shared Vision Off towards player i
 

DonMushroom

Member
Reaction score
4
I cant seem to get the first part working :p. I have copied the gains region trigger but just used 1 region as a test but vision is not shared :(
 

Dave312

Censored for your safe viewing
Reaction score
269
What I missed was that the Allies of player (Triggering player) function doesn't return the triggering player. So it was working, it was just giving your allies the shared vision of your enemies but not you. I have updated my previous post with revised triggers that will work (I have tested them this time).
 

DonMushroom

Member
Reaction score
4
I changed the second trigger to

(Number of Living units in (Units in Region 001 G having alliance Ally with player (Triggering player) matching Excluded: Missile, Cloaked, Dead, Hidden, with at most 0)) == 0

It seems to work now :) Thanks again Dave :D
 

DonMushroom

Member
Reaction score
4
Ok scrap that :p.

The first region in the event list works. The rest don't seem to have any effect :(
If a unit dies in the region none of the events work at all. :(
The one region that works reviles the whole map. (This works fine for me :) Just letting you know)
 

Dave312

Censored for your safe viewing
Reaction score
269
I changed the second trigger to

(Number of Living units in (Units in Region 001 G having alliance Ally with player (Triggering player) matching Excluded: Missile, Cloaked, Dead, Hidden, with at most 0)) == 0

It seems to work now :) Thanks again Dave :D

I don't think that would work. What would happen is it would search for units in that region and stop searching when it reaches the At Most amount. In this case it would stop searching when it finds 0 units (hence it wouldn't search at all) and you are saying the condition passes when the player doesn't have any units in that region.

The previous way I had it said that it had to find at least 1 unit, which is what you wanted.

When I did my testing I worked with 2 regions and it worked perfectly. However I didn't even consider what happens when a unit dies. You can easily solve this by adding a Unit Dies event to the Loses Region trigger.
 

DonMushroom

Member
Reaction score
4
Ok so got the first one working spot on :) (forgot to add all the if's)

Cant get the second one to work though. (with your trigger copied exactly) Just cant get the map to revile again :(

Sorry about this Dave :(
 

Dave312

Censored for your safe viewing
Reaction score
269
I'm not sure why you are unable to get it to work, so I've attached a test map so hopefully you can figure what's wrong. The regions you need to enter are marked by the concrete with landing lights (should be pretty obvious). I've also added the Unit Dies event to the "Loses Region" trigger so it will work if a unit is killed.
 

Attachments

  • RegionSharedVision.SC2Map
    33.6 KB · Views: 227
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top