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.
[2024-5-20. : 3:08 pm]
Sylph-Of-Space -- woah! nice! thank you!
[2024-5-20. : 4:05 am]
O)FaRTy1billion[MM] -- the setting exists, it's just hidden in a weird place
[2024-5-20. : 4:04 am]
O)FaRTy1billion[MM] -- instead change "Microtile Overlay" to "Impassable"
[2024-5-20. : 4:04 am]
O)FaRTy1billion[MM] -- er, wait, idk why i was looking for height
[2024-5-20. : 4:03 am]
O)FaRTy1billion[MM] -- below the minimap should be a thing that says "Overlay Settings" with a little + button in the corner, press the + to expand it, uncheck Use Defaults, then change "Tile Overlay" to "Height"
[2024-5-20. : 3:57 am]
Sylph-Of-Space -- Unless I'm dum (possible)
[2024-5-20. : 3:57 am]
Sylph-Of-Space -- It would be so so so nice if SCMDraft had some kind of dedicated "walkability" view for the tilesets.
[2024-5-20. : 3:53 am]
Sylph-Of-Space -- :'( dont cry for me cat-gentina
[2024-5-19. : 9:18 pm]
Ultraviolet -- 🔪🐈
[2024-5-19. : 12:34 pm]
NudeRaider -- curiosity kills the cat!
Please log in to shout.


Members Online: Roy, 8avae18100eM9