Staredit Network > Forums > SC1 Mapping Tools > Topic: MacroTriggers production thread
MacroTriggers production thread
May 16 2008, 10:36 pm
By: Wormer
Pages: 1 2 315 >
 

May 16 2008, 10:36 pm Wormer Post #1



What is MacroTriggers?
MacroTriggers (MT) is a language allowing you to specify sequence of triggers. MT is similiar to SCMD text triggers but having additional facilities for triggers duplication. The compiler processes input text files written on MacroTriggers and generates SCMD text triggers which you copy/paste into your map.

Installation and usage


Downloads


Screenshoots


Development state notice


Post has been edited 32 time(s), last time on Jul 4 2010, 9:30 am by Wormer. Reason: added note on NppExec plugin requirement



Some.

May 17 2008, 8:02 pm Daedalus Post #2



Why did no-one reply to this? Meh :|

Holy crap, this is good! While I must admit that I will probably not use this since until now I've always worked a way around making tons of repeating triggers (which is a personal objective/motto). However, this sure is a great program. If it wasn't for the lame amount of possibilities (lack thereof) of Starcraft this really feels liking programming.

Great job!

It's a shame I'm the first commentor.



None.

May 17 2008, 8:24 pm Wormer Post #3



OMG! Someone've replied) :rolleyes: I dont know why but people seem to constantly ignore me when I'm talking about it :wtfage:

Quote
Why did no-one reply to this? Meh :|
I wonder! :ermm: This seem to be a bit hard for people to make that steps to run and it needs some effort to understand. I know, people are lazy! :)

But thanks for comment!!! :D It is still in development. You know, I'm making this for my personal use. I just wanted to share this with people who might find it handfull.

BTW, you can find the original production thread there: http://www.warbox.us/viewforum.php?f=45&sid=991ac09b64d71ab31eb1759cf5719f28

Post has been edited 2 time(s), last time on May 17 2008, 8:58 pm by Wormer.



Some.

May 18 2008, 3:22 am Falkoner Post #4



So, I'm wondering, did you base this off of any certain programming language, or what?



None.

May 18 2008, 7:13 am Wormer Post #5



No, I'm not. This is not a general programming language, it is specific one. It is not even a programming laguage, it is just a language for specifying sequences of triggers. It is most similiar to Macro Assebmler by it's fucntionality. MacroTriggers relates to SCMD text triggers very much alike Assembler relates to Macro Assembler. By synthax it might remind one an Oberon programming language. But it's non of them. Anyway, it should not say much for you, should it? :rolleyes:

I definetly should have written fast tutorial on how to write on MacroTriggers. I just don't see much attention and hence dont hurry with writeing. But anyway, anyone can always look at examples and learn the language from them. It's not that complex at all! And you can always ask me, I am always glad to explain.



Some.

May 18 2008, 11:08 pm Falkoner Post #6



Is it able to convert old triggers into the format? I'm already over half way done with a map, but I'd love to use this..



None.

May 19 2008, 4:38 am Wormer Post #7



Quote from Falkoner
Is it able to convert old triggers into the format? I'm already over half way done with a map, but I'd love to use this..
I was waiting for this question :) Unfortunately there is no way for now. However, I was thinking about writing the tool for converting triggers from the SCMD format (or better embedding it in the compiler). Though I don't sure if it can be usefull (mabe if only you like the MacroTriggers (MT) synthax). It is better to start triggering on MT from the beginning, specifying a new variable for each unit/location/switch/string and ect. This will allow you fast refactoring in the future. Having definitions of the objects you use in the map all in one place could be also used as some kind of documentation in the future too. This could serve like a reference on what you're using. If you're not lazy (as I am :bleh: ), you could even place some comments there.

But, if you have over half way done map and want to implement a system wich you want to write on MT you could do it, compile and then copy/paste resulting triggers in your main triggers file. Noone forces you to copy/paste them directly into the SCMD editor. In this case you should only correct CUWP slots as the compiler begins numeration from one (btw, it might be good idea to be albe to say the compiler how it should numerate CUWP slots in the resulting file).

Post has been edited 1 time(s), last time on May 19 2008, 4:43 am by Wormer.



Some.

May 19 2008, 9:51 pm Falkoner Post #8



Meh, I guess I can finish this map without them, but expect me to be talking to you a lot more about it once this one is finished.



None.

Jun 18 2008, 4:08 am Smile Post #9



This is great...
And you man great tooo :) ^^



None.

Jun 18 2008, 7:18 pm fritfrat Post #10



That is awesome. Good luck finishing it, as many people will find it useful.



None.

Jan 8 2009, 5:40 pm Wormer Post #11



Updated the head topic with the latest (v1.2) version of MT compiler.
This version do not add new features but has few bugfixes related to generated SCMD triggers synthax.
Enjoy :)

EDIT: If anyone have made open source maps using MT language, I will be glad to post that in the head post under the examples.



Some.

Apr 26 2009, 8:41 pm Wormer Post #12



Have you ever dreamed to have actions and conditions auto-completion with parameters hints on input for real text triggers?

Now you have a chance to try that yourself with MacroTriggers! Just look at this sexynezzzz! :}

Autocompletion:


Hints on parameters:


Well, this works in Notepad++. All you have to do is to copy this file into "Notepad++\Plugins\APIs". Also a User Defined syntax highlighting is required. It must be called exactly as "mtrigger" and associated with .mtrigger extention for your MacroTriggers source files. Also be sure that your Auto-completion and Parameters Hints on Input are on at Settings->Preferences...->Backup/Auto-completion. Enjoy and dont forget to restart your Notepad++ before you can use it!

EDIT: Hotkeys for opening the autocompletion window and hints are Ctrl+Space and Ctrl+Shift+Space accordingly. Just in case you accidently closed that window. ;)

Post has been edited 1 time(s), last time on Apr 26 2009, 8:49 pm by Wormer.



Some.

Apr 26 2009, 8:56 pm Falkoner Post #13



Awesome! I think I will most definitely use that, very nice additon :)



None.

Apr 26 2009, 9:00 pm Wormer Post #14



Thanks, I am going to add keywords (like TRIGGER, CONDITIONS, LOCATION and such) auto-completion soon! Also, by the way, I've discovered another very powerful text editor Vim (google it!). It has got much greater (Notepad++ is a toy in comparance with it) capabilities for text highlighting and probably other things... But it is not intuitive and you need to learn and practice much to use it.



Some.

Apr 26 2009, 9:07 pm Falkoner Post #15



I'm surprised no one has used this yet, I intend to put it to full use in Mystic Islands RPG :)



None.

Apr 26 2009, 9:31 pm Conspiracy Post #16



Hmm... I looked at it and its a bit difficult to set it up for someone who doesn't have much knowledge in programming. But I did look at your example text and it is much better than what SCMD has with the //-----// and {} crap (I know {} is used in programming). I wish you would have made it a bit simpler, like no tabs represents the players the trigger includes, one tab is conditions and two tabs is actions.

Overall, I would enjoy it if I could set up easier.



None.

Apr 27 2009, 1:16 am Fallen Post #17



I feel kinda dumb, i trust Falknor when he says something good, or recommends something. But MT seems way to complicated, to long to make. What are the advantages with using you way?



None.

Apr 27 2009, 1:52 am Falkoner Post #18



Quote
I feel kinda dumb, i trust Falknor when he says something good, or recommends something. But MT seems way to complicated, to long to make. What are the advantages with using you way?

Well, for a small, relatively simple map, there are none, but when maps start getting into the thousands of triggers, you need some way to easily organize triggers, and this is a very good method.



None.

Apr 27 2009, 8:58 am Wormer Post #19



Finally! A year passed and I'm starting to get some feedback! :D

Quote from Conspiracy
I looked at it and its a bit difficult to set it up for someone who doesn't have much knowledge in programming.
This is a command line program, that why it's use little differs from programs with window interface. I assure you it is very simple to setup and use. Follow the next steps:

1. Download Java Runtime Environment (JRE) from http://java.sun.com and install. Probably the fastest way to find JRE it is to type the JRE download in Google and the first link leads to http://www.java.com/ru/download/manual.jsp.

2. Download and install mtrigsc.jar. Donwload mtrigsc v1.2. To install mtrigsc simply copy it to any folder on your hard drive. Remember the full path (starting from drive letter) to mtrigsc.jar, you need it to invoke the compiler.

3. Use mtrigsc from command line. The .jar file mtrigsc.jar is a java executeable file. It takes three parameters: the source file with your triggers written on MacroTriggers and names of two output files with SCMD triggers and properties respectively. The most straightforward way is to invoke it directly from the command line. To open command line you go Start->Run... and type cmd. To run mtrigsc on your source file source.mtrigger you type java -jar <full path to mtrigsc.jar> <full path to source.mtrigger> out.trigger out.property. Two specified files out.trigger and out.property will be created in your current directory.

4. Use mtrigsc with Notepad++. Notepad++ takes care of all tedious work with the command line. You write a script which Notepad++ invokes every time you hit the F6 button. Notepad++ can substitute strings with the full path to the current file and such, so you don't need to worry about it anymore. So, you open your source.mtrigs file in Notepad++ and hit F6. The dialog will open. You type the following line java -jar "<full path to mtrigsc.jar>" "$(FULL_CURRENT_PATH)" "$(NAME_PART).trigger" "$(NAME_PART).property" and press ok. Notepad++ will substitue $(FULL_CURRENT_PATH) with the full path to the file you edit and $(NAME_PART) with it's name without the extension. If there were no errors in the file source.mtrigs you get two files with output information named source.trigger and source.property in the current directory. The next time you want to compile you simply hit Ctrl+F6 which invokes the last script. Notepad++ can even open the resulting file for you. To make it do so you add the following two lines to your script:
NPP_CLOSE "$(NAME_PART).trigger"
NPP_OPEN "$(NAME_PART).trigger"

The next time you will press Ctrl+F6 the file with resulting SCMD triggers will open.

Quote from Conspiracy
Overall, I would enjoy it if I could set up easier.
So, what can be easier than hitting Ctrl+F6 buttons? Awww!.. Hitting the one button, right? :lol:

Post has been edited 2 time(s), last time on Apr 27 2009, 9:08 am by Wormer.



Some.

Apr 27 2009, 9:40 am Wormer Post #20



Quote from Conspiracy
But I did look at your example text and it is much better than what SCMD has with the //-----// and {} crap (I know {} is used in programming).
SCMD generates triggers automatically and inserts the //-----// between triggers. Every line starting with double slash '//' is a comment and it does not matter what you type there. This is only a question of formatting. There is no way to automatically generate MacroTriggers from your map with existing triggers. You write MacroTriggers from blank list and do any formatting you like.

Symbols '{}' in SCMD are used to represent where the trigger starts and where is ends. MacroTriggers use keywords 'TRIGGER' and 'ENDT' for this purpose. Actually there is no need to use braces or 'ENDT' but to my mind trigger looks more accomplished when it has these.

Quote from Conspiracy
I wish you would have made it a bit simpler, like no tabs represents the players the trigger includes, one tab is conditions and two tabs is actions.
Do you mean one should write trigger

TRIGGER
OWNERS: Force1, Player3, Player8
CONDITIONS:
Bring(@Neutral, @AtLeast, 1, uMarker, lStack)
ACTIONS:
GiveUnits(@All, uMarker, @Neutral, lStack, @CurrentPlayer)
SetDeaths(@AllPlayers, @Set, 0, dcIsGameMaster)
SetDeaths(@CurrentPlayer, @Set, 1, dcIsGameMaster)
PreserveTrigger()
ENDT

like this

TRIGGER
Force1, Player3, Player8
Bring(@Neutral, @AtLeast, 1, uMarker, lStack)
GiveUnits(@All, uMarker, @Neutral, lStack, @CurrentPlayer)
SetDeaths(@AllPlayers, @Set, 0, dcIsGameMaster)
SetDeaths(@CurrentPlayer, @Set, 1, dcIsGameMaster)
PreserveTrigger()
ENDT


You see, it is a bad idea to use Tabs and Newline characters to represent some kind of information about triggers. Tabs, Whitespaces and Newline characters should be used only for formatting purposes. For example the above trigger could be written like this:

TRIGGER OWNERS: Force1,Player3,
Player8 CONDITIONS: Bring(@Neutral,@AtLeast, 1 , uMarker, lStack
)ACTIONS:
GiveUnits(@All, uMarker, @Neutral, lStack, @CurrentPlayer )
SetDeaths(@AllPlayers, @Set, 0, dcIsGameMaster )
SetDeaths(@CurrentPlayer, @Set, 1, dcIsGameMaster )
PreserveTrigger ( ) ENDT

The idea is to allow the user to format his triggers in the way he likes the most.

For example I use the next writing for hyper triggers:

TRIGGER
OWNERS: Player
CONDITIONS:
ACTIONS:
Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0)
Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0)
Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0)
Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0)
Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0)
Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0)
Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0)
Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0) Wait(0)
PreserveTrigger()
ENDT




Some.

Options
Pages: 1 2 315 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- there are some real members mixed in those latter pages, but the *vast* majority are spam accounts
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- there are almost 3k pages
[2024-4-14. : 9:21 pm]
O)FaRTy1billion[MM] -- the real members stop around page 250
[2024-4-14. : 9:20 pm]
O)FaRTy1billion[MM] -- look at the members list
[2024-4-12. : 12:52 pm]
Oh_Man -- da real donwano
da real donwano shouted: This is the first time I've seen spam bots like this on SEN. But then again, for the last 15 years I haven't been very active.
it's pretty common
[2024-4-11. : 9:53 pm]
da real donwano -- This is the first time I've seen spam bots like this on SEN. But then again, for the last 15 years I haven't been very active.
[2024-4-11. : 4:18 pm]
IlyaSnopchenko -- still better than "Pakistani hookers in Sharjah" that I've seen advertised in another forum
[2024-4-11. : 4:07 pm]
Ultraviolet -- These guys are hella persistent
[2024-4-11. : 3:29 pm]
Vrael -- You know, the outdoors is overrated. Got any indoor gym and fitness equipment?
[2024-4-10. : 8:11 am]
Sylph-Of-Space -- Hello!
Please log in to shout.


Members Online: Roy, jun3hong