Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: A "Hold Ground" kind of trigger mix?
A "Hold Ground" kind of trigger mix?
Dec 9 2008, 10:05 pm
By: Aravan  

Dec 9 2008, 10:05 pm Aravan Post #1



Okay guys, I need some help. I'm trying to make a map (for my, and my friends' personal use) that will feature a location (Temple) being protected by one AI (which has a base around that location) and one player against 2 other players. It all seems to work fine so far (haven't given it a lot of test tho, wanna make it a surprise), but I can't figure out how to make a certain trigger. I use the "bring" trigger right now, which works as follows:
1) Players: from "Force 1" and "Force 2" (I have each player in a separate Force for aesthetic reasons :D )
2) Conditions: Allies bring at least 18 men to "Temple Location"
Allies bring at least 6 Protoss High Templar to 'Temple location" (1 player is Protoss ofc)
3) Actions: Generally result in victory for current player, some other stuff too, that doesn't matter tho.

The trigger I want to make works very similarly, but with one "small" difference, which I can't get past. I want to make it that, when you bring the required units to that specific location a countdown timer starts (60 seconds for example) and once it gets to zero the players that brought the units (the Temple-attacking players) win, but (I DID search for it before posting here :) ):
1) If the units die, the timer stops for 30 secs and if the required amount of units doesn't appear there again it is disabled altogether (you start from scratch next time).
2) If the units die and are back there in the next 30 secs (the timer is paused) the countdown to victory is resumed.
You understand what I mean (deeply hope so, because this explanation was pretty extensive for such a simple thing :><: )? Kind of "hold ground" script. If there's any way to do this without too much complex messing, then please give me a step-by-step guide, so I can keep up, with you Pros :rolleyes: , or a link to a site where it is explained in detail.

P.S. Just for the record I use SCXE.



None.

Dec 9 2008, 10:31 pm ForTheSwarm Post #2



Trigger #1

Players: XX

Conditions: Bring at least 6 High Templar (or whatever units) to Temple Location.
Switch 1 is Cleared (or death count).

Actions: Set Countdown Timer to 60 seconds.
Set Switch 1 (or use death counts).
Preserve Trigger.

#2

Players: XX

Conditions: Switch 1 is Set (or death count)
Switch 2 is Cleared (or death count)
Players Bring Exactly Zero High Templar (or whatever units) to Temple Location.

Actions: Pause Countdown Timer.
Set Switch 2 (or use death counts)
Preserve Trigger.

#3

Players: XX

Conditions: Switch 2 is set.
Bring at least 6 High Templar to Temple Location.

Actions: Resume Countdown Timer.
Clear Switch 2.
Preserve Trigger.

Will add other triggers later.



None.

Dec 9 2008, 10:54 pm Elvang Post #3



This is how I would do it, where X = the player, Z1 = a unit player 1 won't ever use, Z2 = a second unit player 1 won't ever use, and timer is a switch. This setup assumes that some initialization trigger set the deaths for Z1 to 0 and Z2 to 30( or 720 if using hyper triggers). For the other player just copy/paste these and change the value of X and the location.
Related Knowledge: Death Counters Hyper Triggers

Code
Trigger 1a:
[Cond] If switch "timer" is set
[Cond] Player X brings at most 5 Protoss High Templar to "Temple Location"
[Cond] Player X brings at least 18 [men] to "Temple Location"

[Act] Modify death counts for Player X: Add 1 for unit Z1
[Act] Preserve Trigger

Trigger 1b:
[Cond] If switch "timer" is set
[Cond] Player X brings at most 17 [men] to "Temple Location"
[Cond] Player X brings at least 6 Protoss High Templar to "Temple Location"

[Act] Modify death counts for Player X: Add 1 for unit Z1
[Act] Preserve Trigger

Trigger 1c:
[Cond] If switch "timer" is set
[Cond] Player X brings at most 5 Protoss High Templar to "Temple Location"
[Cond] Player X brings at most 17 [men] to "Temple Location"

[Act] Modify death counts for Player X: Add 1 for unit Z1
[Act] Preserve Trigger

If the switch is set then it means that previously there were 6 templar at the temple, but this trigger also detects that there now isn't the required amount. So it adds 1 to the deaths of Z1, which for future reference will hold the value of the 30 second countdown.
EDIT: Just realized you also check to make sure that 6 templars AND 18 units are at the temple location, <s>so you'd have to split this trigger for each one and make sure they both don't run in the same cycle</s> 3 triggers instead of one.

Code
Trigger 2:
[Cond] If switch "timer" is set
[Cond] If Player X has at least 30 deaths of unit Z1

[Act] Modify death counts for Player X: Set to 0 for unit Z1
[Act] Modify death counts for Player X: Set to 60 for unit Z2
[Act] Clear switch "timer"
[Act] Any other stuff you want to happen
[Act] Preserve Trigger

The conditions check if 30 seconds have passed. Note, you need to change the 30 to 15 if your not using hypertriggers or 360 if you are, the 60 will also be either 30 or 720 respectively. If the 30 seconds have passed then it will set the death counters back to their defaults.

Code
Trigger 3:
[Cond] Player X brings at least 6 Protoss High Templar to "Temple Location"
[Cond] Player X brings at least 18 [men] to "Temple Location"

[Act] Set switch "timer"
[Act] Modify death counts for Player X: Subtract 1 for unit Z2
[Act] Preserve Trigger

If they bring the required number of templar to your location then set a switch to remember that the timer has been started. Additionally, while the required number of templar continue to live this will decrease the value of Z2, which is the death counter holding the 60 second countdown value.

Code
Trigger 4:
[Cond] Player X has suffered at most 0 deaths of unit Z2

[Act] Victory trigger stuff goes here

Self explanatory, 0 deaths of Z2 means that 60 seconds passed with 6 templar at the temple location.

With this setup you could also do a trigger checking for each value of Z2 and displaying a countdown timer at that time to inform players of the current position. IE:

Code
Trigger 1:
[Cond] Player X has suffered at most 720 deaths of unit Z2

[Act] Modify Countdown Timer: Set to 60 seconds
[Act] Preserve Trigger

Trigger 2:
[Cond] Player X has suffered at most 708 deaths of unit Z2

[Act] Modify Countdown Timer: Set to 59 seconds
[Act] Preserve Trigger

This assumes your using hyper triggers, if your not then the value of the deaths will be different for the example.

EDIT: Welcome to SEN btw.

Post has been edited 3 time(s), last time on Dec 11 2008, 1:30 am by Elvang.



None.

Dec 9 2008, 11:09 pm Pigy_G Post #4



Quote
SCXE.

Sorry if this is spam but I'd seriously recommened switching to SCMDraft 2. SCXE is complete fail its like 2 notch's above Staredit.



None.

Dec 10 2008, 12:34 am stickynote Post #5



Using SCXE is not fail. It's certainly not as powerful as scmdraft either, though. Although I do recommend you to switch to scmdraft, if you feel more comfortable working with scxe, that's fine. Scmdraft isn't that much more different than scxe, and it can do more stuff.



None.

Dec 10 2008, 12:47 am Riney Post #6

Thigh high affectionado

Dont forget to mention the fact that SCXTra CAN load and save triggers ;o



Riney#6948 on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

-- Updated as of December 2021 --

Dec 10 2008, 3:18 pm NudeRaider Post #7

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

Quote from name:Dark_Marine
Dont forget to mention the fact that SCXTra CAN load and save triggers ;o
And ScmDraft can not?




Dec 10 2008, 6:27 pm Riney Post #8

Thigh high affectionado





Riney#6948 on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

-- Updated as of December 2021 --

Dec 10 2008, 7:44 pm Vi3t-X Post #9



Quote from name:Dark_Marine
Dont forget to mention the fact that SCXTra CAN load and save triggers ;o
Text Editor.



None.

Dec 11 2008, 2:02 am Riney Post #10

Thigh high affectionado

Ive never managed to make it work, never saves

Not to mention, I would HIGHLY doubt a new mapper would even understand a text based trigger editor unless they're familer with other scripting languages.



Riney#6948 on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

-- Updated as of December 2021 --

Dec 11 2008, 2:25 am NudeRaider Post #11

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

Text triggers are for creating masses of similar triggers from a model, template or trigger making program, not for creating them from scratch. They're also useful to replace instances of one unit with another (or something similar) and for finding bugs.
No one would start typing text triggers manually. We use classic trigedit for that.

As for the importing and exporting triggers it's not important to understand their syntax. Just copy them to notepad and save them to a .txt file.
There's one thing that can throw you off, however: When you make changes in text triggers you have to hit the compile button. Saving from the menu does not work. The compile button is the checkmark on the right of the toolbar. But a shout here on SEN asking how to save text triggers would give you this information within minutes, since probably most of the mappers here know that.




Dec 11 2008, 2:30 am Riney Post #12

Thigh high affectionado

The rate of new people here increases every day, Maybe 1/4th



Riney#6948 on Discord.
Riney on Steam (Steam)
@RineyCat on Twitter

-- Updated as of December 2021 --

Dec 11 2008, 2:32 am NudeRaider Post #13

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

Your point being?




Dec 12 2008, 7:00 pm Aravan Post #14



Thanks for the help with this, guys. I have another problem, easy one (I think) this time. How can I make it, so a certain point on the map is revealed for all players for a certain period (the period doesn't have to be accurate)? I tried with Map Revealers being created and scanner sweeps, but scanner sweeps don't work for me (and I wouldn't want to reveal hidden units anyway), and the map revealers can't be killed. Any easy (this time :D ) solution for this?



None.

Dec 12 2008, 10:23 pm NudeRaider Post #15

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

You can kill them. Use the "kill unit" action. However this kills ALL map revealers of the specified player.

If you want to be able to kill them independently, just create a unit and remove it as the next action. The vision will be given, but the unit will not be shown.

If you need it to be killable via units then just place a civ or a dropship or some other unit without attack.




Dec 16 2008, 2:01 am StrikerX22 Post #16



I just wanted to give another note on the side about the Compile button... it's how SCMDraft2 recycles identical strings (that aren't from copying triggers). It'll give a bunch of errors for each it does... just hold enter. Then save, close the map, and reopen, or you'll keep getting the same errors any time you mess with any menu stuff, pretty much.

It also will detect syntax errors and tell you pretty well what the problem is, so you can post that info here if you have trouble.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:18 am]
Sylph-Of-Space -- No complaints here, i'm just curious!
[11:05 pm]
Ultraviolet -- :wob:
[03:55 pm]
Zoan -- :wob:
[10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[2024-5-18. : 3:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
Please log in to shout.


Members Online: RIVE, Roy