Gate triggers
May 17 2008, 1:55 am
By: Cardanis  

May 17 2008, 1:55 am Cardanis Post #1



So earlier I was asking for help on the triggers for gates. Eventually, I got it all figured out, and have reached the point where my map is now in testing. However, Ive had a few troubles with gates that ive noticed, a few things being that sometimes not all the doors open/close (most entrances are covered by 3-4 doors) as in like 3 are up, and 1 is down ( it looks kindof weird, lol) also, sometimes the doors just dont close at all. I was wondering if anyone would mind looking at my trigs, seeing if there was anything up?

This is the trig to see if the hinge is destroyed (the hinge is a shield battery in this case) (oh, and if the switch is set, the gate is down):

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Any unit", "watchtower", At least, 1);
Bring("Player 12", "Protoss Shield Battery", "watchtower", At least, 1);
Bring("Player 1", "Protoss Beacon", "watchtowerbeacon", At least, 1);
Switch("watchtower", not set);

Actions:
Set Switch("watchtower", set);
Preserve Trigger();
}

Now, each gate corresponds to a territory, being a beacon. Ownership of the gate is determined by ownership of the beacon. If the beacons neutral, anyone can open the gate. (these two trigs run for all players, and Force 1 is the force that includes all of the Human Players).

Trigger("All players"){
Conditions:
Bring("Current Player", "Any unit", "watchtower", At least, 1);
Bring("Player 12", "Protoss Shield Battery", "watchtower", At least, 1);
Bring("Player 12", "Protoss Beacon", "watchtowerbeacon", At least, 1);
Switch("watchtower", not set);

Actions:
Preserve Trigger();
Set Switch("watchtower", set);
}

//-----------------------------------------------------------------//

Trigger("All players"){
Conditions:
Bring("Force 1", "Any unit", "watchtower", Exactly, 0);
Bring("Player 12", "Protoss Shield Battery", "watchtower", At least, 1);
Bring("Player 12", "Protoss Beacon", "watchtowerbeacon", At least, 1);
Switch("watchtower", set);

Actions:
Set Switch("watchtower", clear);
Preserve Trigger();
}


Now, if a player owns the beacon, I want only them to be able to open it.

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Any unit", "watchtower", At least, 1);
Bring("Player 12", "Protoss Shield Battery", "watchtower", At least, 1);
Bring("Player 1", "Protoss Beacon", "watchtowerbeacon", At least, 1);
Switch("watchtower", clear);

Actions:
Set Switch("watchtower", set);
Preserve Trigger();
}

Trigger("Player 1"){
Conditions:
Bring("Player 1", "Any unit", "watchtower", Exactly, 0);
Bring("Player 12", "Protoss Shield Battery", "watchtower", At least, 1);
Bring("Player 1", "Protoss Beacon", "watchtowerbeacon", At least, 1);
Switch("watchtower", set);

Actions:
Set Switch("watchtower", clear);
Preserve Trigger();
}



These are the two triggers, given to a relatively unused Computer player (though he does have hyper trigs, will that effect it?) which control the actual motion of the gates depending on the switch setting.

Trigger("Player 5"){
Conditions:
Switch("watchtower", set);
Bring("Player 12", "Left Pit Door", "watchtower", At least, 1);

Actions:
Set Doodad State("Player 12", "Left Pit Door", "watchtower", disabled);
Give Units to Player("Player 12", "Player 11", "Left Pit Door", 1, "watchtower");
Preserve Trigger();
}

//-----------------------------------------------------------------//

Trigger("Player 5"){
Conditions:
Switch("watchtower", not set);
Bring("Player 11", "Left Pit Door", "watchtower", At least, 1);

Actions:
Set Doodad State("Player 11", "Left Pit Door", "watchtower", enabled);
Give Units to Player("Player 11", "Player 12", "Left Pit Door", 1, "watchtower");
Preserve Trigger();
}








Any input?



None.

May 17 2008, 11:39 am NudeRaider Post #2

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

sigh... Those text triggers are too hard to read. Instead of fixing them (it seems you made it too complex anyways) I will post working triggers.

But first a few helpful facts. (which you might already know)
Hypertriggers owned by a computer player will not affect anything that has no waits. Transmissions are also waits and in single player move screen is too.
You are using P11 and P12 a lot, so make sure the triggers affecting their units are owned by one of P1-8
You seem to try and change doodad state of multiple doors in the same location. You should know that the doodad state action changes only the state of the leftmost unit in that location. If x-coordinates are the same the last created/placed unit is selected. As a sidenote you should make sure that the doors are correctly attached to walls because when you just use 4 doors to cover a gap in the wall small units can slip through even when gates are closed.

I'm not sure I understood the rules how to change ownership, but I guess you're able to do this one alone.

So you just need 1 trigger to toggle doors:
All players
Conditions:
Current Player brings at least 1 [men] to 'watchtower'
Current Player brings at least 1 beacon to 'watchtower'
Actions:
move all [men] of current player from 'watchtower' to 'watchtower back' (= location just outside of 'watchtower')
Toggle doodad state of <door type> at 'door 1'
Toggle doodad state of <door type> at 'door 2'
Toggle doodad state of <door type> at 'door 3'
Toggle doodad state of <door type> at 'door 4'
preserve trigger

Make sure no door overlaps to a neighboring door location. Making these locations 1x1 should suffice.

I know I used 4 instead of 1 location for the doors, but you see how that makes things MUCH easier.
I'm not sure if the toggling of the doors is reliable. It should, but in my years of mapping I learned never to trust starcraft. ;)
Test, and IF it makes trouble you'll need 2 triggers:

All players
Conditions:
Current Player brings at least 1 [men] to 'watchtower'
Current Player brings at least 1 beacon to 'watchtower'
Switch 1 is set
Actions:
move all [men] of current player from 'watchtower' to 'watchtower back' (= location just outside of 'watchtower')
Disable doodad state of <door type> at 'door 1'
Disable doodad state of <door type> at 'door 2'
Disable doodad state of <door type> at 'door 3'
Disable doodad state of <door type> at 'door 4'
Clear Switch 1
preserve trigger

All players
Conditions:
Current Player brings at least 1 [men] to 'watchtower'
Current Player brings at least 1 beacon to 'watchtower'
Switch 1 is cleared
Actions:
move all [men] of current player from 'watchtower' to 'watchtower back' (= location just outside of 'watchtower')
Enable doodad state of <door type> at 'door 1'
Enable doodad state of <door type> at 'door 2'
Enable doodad state of <door type> at 'door 3'
Enable doodad state of <door type> at 'door 4'
Set Switch 1
preserve trigger




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2026-7-18. : 2:27 am]
Symmetry -- https://staredit.net/topic/18903/ THE REVIEWS ARE HERE! "ok these are pretty good memes" - ssj9Kevin
[2026-7-17. : 2:58 pm]
Ultraviolet -- Symmetry
Symmetry shouted: Man I wish we had this tech back in the day when people played ums lmao
fr fr
[2026-7-17. : 2:39 am]
Symmetry -- Man I wish we had this tech back in the day when people played ums lmao
[2026-7-16. : 6:28 am]
NudeRaider -- EUD actions, specifically. The conditions remained. Today we can even have actions again, but they're all virtualized/whitelisted (not sure on the actual technical implementation) so you can only use them for specific intended purposed, not arbitrary code injections.
[2026-7-16. : 6:26 am]
NudeRaider -- I mean yes, maps - through EUDs - were theoretically able to do that as well, but that was patched quickly.
[2026-7-16. : 6:25 am]
NudeRaider -- Symmetry
Symmetry shouted: Ohhh imagine a SC map that could delete itself
not the map, the editor
[2026-7-16. : 2:28 am]
Symmetry -- I vaguely remember Voy doing some ACE back in the day, but I had no idea EUDs could do that kind of shit. I am very much catching up on the technology
[2026-7-16. : 2:28 am]
Symmetry -- Ohhh imagine a SC map that could delete itself
[2026-7-15. : 8:51 pm]
NudeRaider -- Symmetry
Symmetry shouted: NudeRaider Is EUD editor capable of writing shit onto the player's harddrive? That seems like it would be dangerous
yeah an editor that isn't allowed to write files sounds rather pointless, so I'd assume it can. Like most other programs too btw. and yes, obviously that's dangerous, but also kinda necessary. MS introduced that virtualization for exactly that reason.
[2026-7-15. : 4:10 am]
Ultraviolet -- I don't think so. I think they shut that shit down after 1.16, maybe even earlier
Please log in to shout.


Members Online: Roy, O)FaRTy1billion[MM], RIVE