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.
[07:32 pm]
Zoan -- I got $2000 bonus. I would like 2000 minerals, please
[2026-4-16. : 4:15 am]
DarkenedFantasies -- you eat lots of beans
[2026-4-16. : 3:46 am]
IskatuMesk -- how do i get gas
[2026-4-15. : 11:43 pm]
Moose -- you don't
[2026-4-15. : 10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
Please log in to shout.


Members Online: Moose, anoeth47