Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: SCMDraft Trigger Syntax
SCMDraft Trigger Syntax
Dec 19 2008, 12:42 am
By: guff1988  

Dec 19 2008, 12:42 am guff1988 Post #1



I am trying to form a trigger in code using SCMDraft. I am familiar with programming so I am comfortable wit this style of trigger coding but I am a little shaky of the terms and syntax to use.

I am trying to form a code for "If Player 'x' brings any unit to "fate" then move unit for current player at "fate" to player 'x' trigger" Where x represents the player number and player x trigger is a trigger by that players base

so far i have this(obviously ill need an if,then for each player)
Trigger("All Players"){
Conditions:
Bring("Player 1", "Any Unit", "Fate of Golem");

Actions:



None.

Dec 19 2008, 1:19 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

Text triggers are not meant to be written from scratch. Don't do it.
They are meant to create large quantities of similar triggers or for bug fixing.

An advanced triggering method would be to use an editor like Notepad++ to create your own templates.
Make triggers using the classic trigger editor of ScmDraft to see what the syntax has to be.




Dec 20 2008, 1:19 pm Wormer Post #3



guff1988, I cant understand what is your particular problem.

Well, beside that, I remember a wired problem with synthax when the text trigger edit wont compile the trigger if there is a space between the closeing bracket and opening brace in the line "Trigger("All Players"){".

Quote
Text triggers are not meant to be written from scratch. Don't do it.
Why not? :) Dont spoil youngsters' minds :) guff1988, if you're interested in codeing triggers in text you should look at this: Macro Triggers. In general this tool will help you to intelligently copy your triggers and then to modify all your copies at once in a universal way. For example, in your case, instead of copying your triggers for all players x manually you will only have to write:

Code
FOR x = 1 TO 8 DO
    TRIGGER
    OWNERS: @AllPlayers
    CONDITIONS:
        Bring(@P(x), @AtLeast, 1, @AnyUnit, @L("Fate of Golem"))
    ACTIONS:
        PreserveTrigger()
        MoveUnit(@All, @AnyUnit, @P(x), @L("Fate of Golem"), @L("Base "+x))
    ENDT
ENDL

Where "Base x" is the location by the base of the Player x. This will copy the trigger under the for-loop for each x getting values from 1 to 8 inclusive. You should understand this fine, as far as you're familliar with programming. If not, feel free to ask.

After that, you're running the tool on these lines which produces the text file with the multiplied triggers which you're copy-pasteing into the text triggers in SCMD and compile.

Post has been edited 1 time(s), last time on Dec 20 2008, 1:25 pm by Wormer.



Some.

Dec 20 2008, 1:47 pm NudeRaider Post #4

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 Wormer
Quote
Text triggers are not meant to be written from scratch. Don't do it.
Why not? :) Dont spoil youngsters' minds :)
well if you just read my entire post you would have noticed that I suggested basically the same thing as you did.
Quote from NudeRaider
An advanced triggering method would be to use an editor like Notepad++ to create your own templates.
However I admit writing "manually" instead of "from scratch" would have been clearer.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:14 am]
Oh_Man -- pluto vs pro gamer snow: https://youtu.be/NOXXpATkdZU
[2026-9-25. : 2:22 pm]
Oh_Man -- https://youtu.be/Lfo4C0xzU04
[2026-9-25. : 12:00 am]
Oh_Man -- he hasnt won a single game so far this is hilarious
[2026-9-24. : 11:41 pm]
Oh_Man -- new arty username Rage Against The Machine
[2026-9-24. : 10:14 pm]
Oh_Man -- https://m.youtube.com/watch?v=KPXri8q9ZBs artys vsing the bot now
[2026-9-24. : 8:12 pm]
Ultraviolet -- do you even lift bro?
[2026-9-23. : 5:21 pm]
NudeRaider -- Oh_Man
Oh_Man shouted: NudeRaider yeh thts straight up cheating
the mutas yes, the wraiths probably not. Have you even watched the video? ;)
[2026-9-23. : 12:56 pm]
Oh_Man -- NudeRaider
NudeRaider shouted: Oh_Man Artosis hasn't caught on how devastating the perfect focus fire is. With the mutas he was like "the Mutas always seem to have less hp than against a human". But he didn't notice that the flock he had selected always just had one muta that was hurt. Same with the wraiths here. He's talking about how valks+wraith is gonna destroy Pluto's valks, then 5s later he's dumbfounded the human player's air is just gone and he never figured out why. And for some reason didn't even think to go back and look at the battle.
yeh thts straight up cheating
[2026-9-23. : 12:24 pm]
Oh_Man -- arty's done another vid. he's also announced he's going to organise showmatches with pro, with NO maphacks, so we can see its actual capabilities
Please log in to shout.


Members Online: Zycorax, Oh_Man