Staredit Network > Forums > SC1 Mapping Tools > Topic: MacroTriggers production thread
MacroTriggers production thread
May 16 2008, 10:36 pm
By: Wormer
Pages: < 1 « 4 5 6 7 815 >
 

Aug 19 2009, 5:10 pm The Starport Post #101



http://www.youtube.com/watch?v=qAgqi72kRa0

Now you get to hear how much of a nerd I sound like. :P


Oh well. Worth it.

Post has been edited 2 time(s), last time on Aug 19 2009, 5:40 pm by Tuxedo-Templar.



None.

Aug 19 2009, 5:45 pm NothingZ Post #102



Quote from name:Tuxedo-Templar
http://www.youtube.com/watch?v=qAgqi72kRa0

Now you get to hear how much of a nerd I sound like. :P


Oh well. Worth it.

Thanks, Tux! :)
Will there be a second video out anytime soon?



None.

Aug 19 2009, 5:48 pm The Starport Post #103



Hopefully tomorrow or in a few days or so, yeah.



None.

Aug 19 2009, 6:19 pm NothingZ Post #104



Can I use array and variables together?

ARRAY anumber = { "a4", "a5", "a6", "a7", "a8", "a9", "a10" }
FOR n = 3 TO 9 BY +1 DO

I then did @L(anumber[n-2]), but then it never worked.

I know this has been answered "yes", but I couldn't get this to work :/



None.

Aug 19 2009, 6:53 pm Wormer Post #105



Quote from NothingZ
After pressing Ctrl + F6 after finishing my triggers, how do I find where the output of the triggers were?
If you haven't specified full path in the script on highlighted parameters
java -jar "<full path to mtrigsc.jar>" "$(FULL_CURRENT_PATH)" "$(NAME_PART).trigger" "$(NAME_PART).property"

then these files will be created in the current directory. A good question what a current directory in Notepad++ is. As far as I remember in Notepad++ current directory is the directory of the last opened file. That why you have to paste the next string in the script before the one which starts with "java -jar ...":
cd "$(CURRENT_DIRECTORY)"

This is setting up the current directory to the directory of the .mtrigger file which is being compiled at the moment.

Ugh, and yes this is my fault I haven't updated the code for the script on the title page (I'll do that in a moment), present my apologies.

Quote from NothingZ
Also, could locations be done like this? :

RemoveUnitsAt(@All, v3, @AllPlayers, @L("a(2^n)")
I want the location "number" to be increased by 1 everytime, so it would be like this:
a1, a2, a3, a4, a5, a6, a7, a8, a9, a10
You should write
FOR n=1 TO 10 DO
...
RemoveUnitsAt(@All, v3, @AllPlayers, @L("a"+n)
...
ENDL


The symbol '^' is used to calculate degree of the first operand in integer expressions.

Quote from NothingZ
MacroTriggers Compiler v1.4
BR.recoverFromMismatchedToken
in C:\Users\LOL\Desktop\Starcraft Map Making\MacroTriggers v1.4\RandomDefense2.mtrigger:line 0:-1: mismatched input '<EOF>' expecting 'ENDL'
Could you please provide text of the RandomDefense2.mtrigger file?

Quote from NothingZ
Can I use array and variables together?

ARRAY anumber = { "a4", "a5", "a6", "a7", "a8", "a9", "a10" }
FOR n = 3 TO 9 BY +1 DO

I then did @L(anumber[n-2]), but then it never worked.
Yes you can, but you should write like
FOR n = 3 TO 9 DO
...
@L(anumber[n-3])
...
ENDL

because array elements are 0-based (anumber[0] is the first element "a4").

Also you don't need '+' before the step and moreover you don't need to specify step 1, because 1 is the default value. If you want to count down you should specify negative step though. Like
FOR n = 9 TO 3 BY -1 DO ... ENDL




Some.

Aug 19 2009, 7:39 pm Wormer Post #106



I express mine huge thanks to Tuxlar for his super-sexy-awesome installation video tutorial! :cool2: :wub:

Updated the head post:
- Included the video tutorial into the installation part of the head post.
- Updated the script to Run the compiler from Notepad++ (should have done long-long ago...).
- Revised the head post a little, combining parts of text into collapse boxes.



Some.

Aug 19 2009, 7:50 pm NothingZ Post #107



Quote from Wormer
Quote from NothingZ
After pressing Ctrl + F6 after finishing my triggers, how do I find where the output of the triggers were?
If you haven't specified full path in the script on highlighted parameters
java -jar "<full path to mtrigsc.jar>" "$(FULL_CURRENT_PATH)" "$(NAME_PART).trigger" "$(NAME_PART).property"

then these files will be created in the current directory. A good question what a current directory in Notepad++ is. As far as I remember in Notepad++ current directory is the directory of the last opened file. That why you have to paste the next string in the script before the one which starts with "java -jar ...":
cd "$(CURRENT_DIRECTORY)"

This is setting up the current directory to the directory of the .mtrigger file which is being compiled at the moment.

Ugh, and yes this is my fault I haven't updated the code for the script on the title page (I'll do that in a moment), present my apologies.

Quote from NothingZ
Also, could locations be done like this? :

RemoveUnitsAt(@All, v3, @AllPlayers, @L("a(2^n)")
I want the location "number" to be increased by 1 everytime, so it would be like this:
a1, a2, a3, a4, a5, a6, a7, a8, a9, a10
You should write
FOR n=1 TO 10 DO
...
RemoveUnitsAt(@All, v3, @AllPlayers, @L("a"+n)
...
ENDL


The symbol '^' is used to calculate degree of the first operand in integer expressions.

Quote from NothingZ
MacroTriggers Compiler v1.4
BR.recoverFromMismatchedToken
in C:\Users\LOL\Desktop\Starcraft Map Making\MacroTriggers v1.4\RandomDefense2.mtrigger:line 0:-1: mismatched input '<EOF>' expecting 'ENDL'
Could you please provide text of the RandomDefense2.mtrigger file?

Quote from NothingZ
Can I use array and variables together?

ARRAY anumber = { "a4", "a5", "a6", "a7", "a8", "a9", "a10" }
FOR n = 3 TO 9 BY +1 DO

I then did @L(anumber[n-2]), but then it never worked.
Yes you can, but you should write like
FOR n = 3 TO 9 DO
...
@L(anumber[n-3])
...
ENDL

because array elements are 0-based (anumber[0] is the first element "a4").

Also you don't need '+' before the step and moreover you don't need to specify step 1, because 1 is the default value. If you want to count down you should specify negative step though. Like
FOR n = 9 TO 3 BY -1 DO ... ENDL

Thank you very much, Wormer. I got that to work!

But then I got to the next action, "CreateUnitWithProperties" OR "CreateUnit". I followed the helper:
CreateUnitWithProperties(1, v4, @L("SA1"), @CurrentPlayer, 1)
Num, Unit, Location, Player, Properties

This error pops up:

<my path>\RandomDefense3.mtrigger:line 22:3: type mismatch



None.

Aug 19 2009, 8:00 pm The Starport Post #108



Quote from Wormer
I express mine huge thanks to Tuxlar for his super-sexy-awesome installation video tutorial! :cool2: :wub:

Updated the head post:
- Included the video tutorial into the installation part of the head post.
- Updated the script to Run the compiler from Notepad++ (should have done long-long ago...).
- Revised the head post a little, combining parts of text into collapse boxes.
Neat. Glad you liked it. :D

If you have any annotations you want me to add, let me know. I'm not sure if the link I sent you lets you edit annotations yourself or not.



None.

Aug 19 2009, 8:03 pm Wormer Post #109



Quote from NothingZ
But then I got to the next action, "CreateUnitWithProperties" OR "CreateUnit". I followed the helper:
CreateUnitWithProperties(1, v4, @L("SA1"), @CurrentPlayer, 1)
Num, Unit, Location, Player, Properties

This error pops up:

<my path>\RandomDefense3.mtrigger:line 22:3: type mismatch
This is because when you use CreateUnitWithProperties action you have to specify properties variable as it's last parameter. Properties variable is defined like this:
PROPERTY prop 
HITPOINTS = 99 // you can use expressions here
ENERGY = 77
SHIELDS = 66
RESOURCES = 55555
HANGAR = 8
INVINCIBLE
BURROWED
LIFTED
HALLUCINATED
CLOACKED
ENDP

There you specify flags which should be toggled on and don't specify flags which are toggled off.
Then you specify property prop as the CUWP action last parameter:
CreateUnitWithProperties(1, v4, @L("SA1"), @CurrentPlayer, 1, prop)

And, please, don't forget to copy/paste your .properties file into SCMD text editor every time you change properties variables!



Some.

Aug 19 2009, 8:17 pm NothingZ Post #110



Quote from Wormer
Quote from NothingZ
But then I got to the next action, "CreateUnitWithProperties" OR "CreateUnit". I followed the helper:
CreateUnitWithProperties(1, v4, @L("SA1"), @CurrentPlayer, 1)
Num, Unit, Location, Player, Properties

This error pops up:

<my path>\RandomDefense3.mtrigger:line 22:3: type mismatch
This is because when you use CreateUnitWithProperties action you have to specify properties variable as it's last parameter. Properties variable is defined like this:
PROPERTY prop 
HITPOINTS = 99 // you can use expressions here
ENERGY = 77
SHIELDS = 66
RESOURCES = 55555
HANGAR = 8
INVINCIBLE
BURROWED
LIFTED
HALLUCINATED
CLOACKED
ENDP

There you specify flags which should be toggled on and don't specify flags which are toggled off.
Then you specify property prop as the CUWP action last parameter:
CreateUnitWithProperties(1, v4, @L("SA1"), @CurrentPlayer, 1, prop)

And, please, don't forget to copy/paste your .properties file into SCMD text editor every time you change properties variables!

Got it!

One last question..

Do these (//-----------------------------------------------------------------//) matter at all?



None.

Aug 19 2009, 8:20 pm Morphling Post #111



No.



None.

Aug 19 2009, 8:21 pm The Starport Post #112



Anything after any '//' in a line of code is ignored by the compiler. Useful for adding comments, separators, and other aesthetic-only elements.

There is an exception, though. Anything between a '// >' and '// <' pair is placed into a collapsible block. Useful for organizing large groups of triggers.


Go ahead and try it!



None.

Aug 19 2009, 8:29 pm NothingZ Post #113



Thanks, both of you :)

Maybe I should avoid asking another question, but I just can't :(

After opening the ScmDraft Trigger Editor, I pressed the "CHECK" without pasting anything on to it.
By doing so, a Debug error pops up, saying some of the lines had errors.
This made me not able to save what I will be pasting on to it.
How can I fix this?



None.

Aug 19 2009, 8:37 pm The Starport Post #114



Ignore those errors. As long as it doesn't mention anything specific (like a line number with something it can't read), those are misleading.



None.

Aug 19 2009, 8:40 pm NothingZ Post #115



Quote from name:Tuxedo-Templar
Ignore those errors. As long as it doesn't mention anything specific (like a line number with something it can't read), those are misleading.

It has specific line numbers like line 754: Started
Also, it says line 6: switch expected

It won't save after I press the check, I don't see them in the classic trigger list :/



None.

Aug 19 2009, 8:41 pm The Starport Post #116



Oh well that IS an error. Try to find out what's wrong at line 6, first.



None.

Aug 19 2009, 8:45 pm NothingZ Post #117



Quote from name:Tuxedo-Templar
Oh well that IS an error. Try to find out what's wrong at line 6, first.
I don't see any specific errors.
Some of my old switches has "Switch1" without spaces in between, and my new ones has spaces. That doesn't affect anyting does it?
Other than that, it shouldn't be telling me there are errors >:/..



None.

Aug 19 2009, 8:51 pm NothingZ Post #118



Quote from Morphling
That is the error.

Actually, when I made a new map to try ( you know they have these preset triggers? ), it also says there are errors, when there shouldn't even be one tiny spec of errors.

Funny thing, it says there is an error even though there are NO triggers O.o



None.

Aug 19 2009, 8:53 pm Wormer Post #119



Quote from NothingZ
Some of my old switches has "Switch1" without spaces in between, and my new ones has spaces. That doesn't affect anyting does it?
Switches names should go close to digits (with no spaces), like "Switch7", "Switch58".



Some.

Aug 19 2009, 9:09 pm NothingZ Post #120



Quote from Wormer
Quote from NothingZ
Some of my old switches has "Switch1" without spaces in between, and my new ones has spaces. That doesn't affect anyting does it?
Switches names should go close to digits (with no spaces), like "Switch7", "Switch58".

I believe that won't affect it (the spacing part) because after compiling, the switch and the number has spaces in them.
I also think that my ScmD is bugged because it says there are errors even when there are no triggers in there.



None.

Options
Pages: < 1 « 4 5 6 7 815 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
[2024-5-05. : 9:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[2024-5-05. : 9:35 pm]
Vrael -- that is insane
[2024-5-05. : 9:35 pm]
Vrael -- damn is that all EUD effects?
[2024-5-04. : 10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
[2024-5-04. : 1:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
Please log in to shout.


Members Online: Excalibur