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

Aug 10 2009, 5:14 am Wormer Post #81



Alright, I am back! :shout:

Quote from name:Tuxedo-Templar
Is there a way to add in conditions or actions inside in an existing trigger via a loop or MACRODEF or something equivalent?
Like the "PLACEHOLDEROMG"? No way to define your own conditions, and macroses are only for triggers. But could you tell me what are you going to achieve?



Some.

Aug 10 2009, 2:13 pm The Starport Post #82



Edit: Actually never mind.

See my email about the compile fail, though. I can't figure out what's wrong.



None.

Aug 10 2009, 2:22 pm Wormer Post #83



Uh... Can't see the email yet!..

Oh lol, found 3 emails! :lol:

EDIT: oh, well for record-sake
[06:49 pm] Tuxedo-Templar -- Ugh shoutbox butchers replies you should use the thread instead.
[06:49 pm] [DeVouReR]:] -- hi tux oO
[06:49 pm] Wormer -- And yes, the best way to achieve the effect of the "PLACEHOLDEROMG" is defining
macroses I guess...
[06:48 pm] Tuxedo-Templar -- I'm aware of that. :P
[06:48 pm] Tuxedo-Templar -- No you're right apparently you can't. I'm just used to that from these dumb
scripting languages I work with. :P
[06:47 pm] Wormer -- Just to make it clear
[06:46 pm] Wormer -- And macro definitions as you understand does not result in any triggers in output
[06:45 pm] Tuxedo-Templar -- Noted. Thanks for the tip.
[06:45 pm] Wormer -- Also, I'm not sure if you can use macroses before they are defined
[06:44 pm] Tuxedo-Templar -- Oh ok. Shoulda guessed it would be something stupid after all.
[06:41 pm] Wormer -- And if you don't need the loop variable in the loop body you can use
REPEAT n <body> ENDL
[06:40 pm] Wormer -- Also, as a hint, the BY thing in loops is optional, default value is 1
[06:39 pm] Wormer -- And you can't have any macro definitions inside loops, that's why it waits for 'ENDL'
[06:38 pm] Wormer -- Nope, just line 542 for-loop is not closed! :P
[06:35 pm] Wormer -- lol =) I'm looking into it now
[06:29 pm] Tuxedo-Templar -- sup. I broke MT I think.


Post has been edited 2 time(s), last time on Aug 10 2009, 2:53 pm by Wormer.



Some.

Aug 10 2009, 3:03 pm The Starport Post #84



Heh. It was a stupid mistake of mine after all. :P

Given my frequent habit of trigger refactoring and cut and paste, I'm going to amend my conventions to wrap each looped trigger individually within separate declarations of its loop rather than putting multiple triggers inside the same loop block. I think that just makes more sense, and should prevent more dumb mistakes like that.


For that particular case, I declared the macro ahead of its use for organizational purposes. Not strictly necessary, but during AG I always hated shoving a few oddball triggers into the middle of an otherwise-neat and uniform group of existing triggers to work around yet another Starcrap design idiosyncrasy. I didn't get to find out if macros didn't work before their declaration on account of that non-terminated loop, though.



None.

Aug 10 2009, 5:02 pm Wormer Post #85



Quote from name:Tuxedo-Templar
Given my frequent habit of trigger refactoring and cut and paste, I'm going to amend my conventions to wrap each looped trigger individually within separate declarations of its loop rather than putting multiple triggers inside the same loop block. I think that just makes more sense, and should prevent more dumb mistakes like that.
This made me think of a probably useful language construct added as an optional suffix to a trigger and specifying to copy it required number of times like...
TRIGGER(int i=0; i<21; i++)
OWNERS:
CONDITIONS:
ACTIONS:
ENDT

LOL it's like C-style, brrr...
TRIGGER MULTIPLY n=0 TO 21 BY 2
OWNERS:
CONDITIONS:
ACTIONS:
ENDT

brrrr, don't know, but might be not a bad idea...



Some.

Aug 10 2009, 6:25 pm The Starport Post #86



Actually it wouldn't be bad, but it isn't necessary. FOR or REPEAT really isn't that bad to use. :P



None.

Aug 11 2009, 7:27 pm Morphling Post #87



I have recently completed a concept map using Macro Triggers and will release it soon.
Edit:
My maps Macro Triggers


Post has been edited 1 time(s), last time on Aug 11 2009, 8:34 pm by Morphling.



None.

Aug 11 2009, 10:37 pm The Starport Post #88



I'm genuinely curious to see how well a 24575 trigger map works out. :P



None.

Aug 11 2009, 10:38 pm Morphling Post #89



I doubled the trigger count for two people. It doesn't lag one bit, but it takes a little to load and there is a noticable delay when you quit.



None.

Aug 12 2009, 3:05 am Morphling Post #90



I'm bored and decided to post my map.

You must be one of the two players in the top force to see the concept. Just order the scourge and an explosion will appear where you clicked. There are 49,240 triggers in this map, but it doesn't lag. However, there will be a noticable delay when you start and quit the map due to the massive amount of triggers.

This map has a lot of potential, but it's limits may be lag and the large file size.

This would not be possible without Macro Triggers. Thank you Wormer!

Edit: Sorry about the double post. I forgot I posted last. :><:

Attachments:
Order Coordinates [0.01].scx
Hits: 15 Size: 2592.24kb



None.

Aug 12 2009, 3:20 am payne Post #91

:payne:

Your map completely crashed my sc, haha.
It's probably my very old CPU that exploded xD

EDIT: It was because of odd dimensions. Though it took my computer over 3 minutes to open the map once loaded xD And SC did crash when I exited... rofl!

Post has been edited 1 time(s), last time on Aug 12 2009, 3:32 am by payne.



None.

Aug 12 2009, 3:37 am Morphling Post #92



It never crashed any of my testers. The dimensions are fine. You do not need to play a normal sized before playing this.



None.

Aug 12 2009, 3:39 am payne Post #93

:payne:

60x12 isn't fine without playing a normal sized map before :O
And it did crash me, but it's probably because my computer sucks balls :P

And I'll surely take a look at this when I'll start triggering my RPG :D



None.

Aug 12 2009, 3:41 am Morphling Post #94



The map is 64x12.... If one dimension is normal then you don't need to play a normal sized map before playing this.

Edit: There was a small problem in the code.
Correct Code


Post has been edited 1 time(s), last time on Aug 12 2009, 3:37 pm by Morphling.



None.

Aug 13 2009, 9:27 am Wormer Post #95



Ugrh, MorphLing... could you explain it better please? Can't get it xD

Quote from Wormer
This made me think of a probably useful language construct added as an optional suffix to a trigger and specifying to copy it required number of times
Quote from name:Tuxedo-Templar
Actually it wouldn't be bad, but it isn't necessary. FOR or REPEAT really isn't that bad to use. :P
I had a look into my MT source code and decided I definitely don't want to add this :rolleyes: At least now... The reason is the MT code leaves better to be desired, and it becomes a total pain changing something...



Some.

Aug 13 2009, 7:11 pm Morphling Post #96



First Trigger


Second Trigger

It may be a little confusing. I know that I am not very good at explaining, but I hope it helped.



None.

Aug 13 2009, 9:18 pm Wormer Post #97



Oh, thanks! Now I see.

You could use the REPEAT N <body> ENDL construct instead of FOR i = 1 TO N <body> ENDL if you don't need the loop variable i inside the loop <body>. You can also omit the "BY 1" in FOR-loop, it is implied by default. You use too many "magic numbers". One could have made it much clearer written like this:
// Memory offset to the variable v where SC stores order's coordinates.
// Variable v has size of a double word (4 bytes).
// Lower word is X coord and higher word is Y coord (in pixels):
// v = X + Y * 2^16,
// X = v % 2^16,
// Y = v / 2^16,
// where '%' and '/' are modulo and integer division operations accordingly.

INTEGER nOrderMemOffset = 19047

// Map dimenitions in tiles
INTEGER nXTileMax = 64
INTEGER nYTileMax = 24

// Tile width and height in pixels
INTEGER nTileWidth = 32
INTEGER nTileHeight = 32

UNIT dcXOut = @U("Cantina")
UNIT dcYOut = @U("Cave")

// Results in X tile and Y tile coordinates (0-based)
// written to dcXOut and dcYOut accordingly
FOR yPixel = 0 TO nYTileMax * nTileHeight - 1 DO
FOR xPixel = 0 TO (nXTileMax - 1) * nTileWidth - 1 BY nTileWidth DO
// SC resets v to 0 when no order is given, we don't detect 0
INTEGER delta = 1
IF (xPixel == nTileWidth) & (yPixel == 0) THEN delta = 0 ENDIF

TRIGGER
OWNERS: @P(1)
CONDITIONS:
Memory(nOrderMemOffset, @AtLeast, xPixel + delta yPixel * 2^16)
Memory(nOrderMemOffset, @AtMost, xPixel + (nTileWidth - 1) + yPixel * 2^16)
ACTIONS:
SetDeaths(@CurrentPlayer, @Set, xPixel % nTileWidth, dcXOut)
SetDeaths(@CurrentPlayer, @Set, yPixel % nTileHeight, dcYOut)
PreserveTrigger()
Comment("")
ENDT
ENDL
ENDL

This is self-explanatory even without comments. Am I right?
If you give the map, I can post this as an example of macro triggers at the first page.

EDIT:
I've just realized it won't compile, because it is a hopeless endeavor to define a variable in a loop, but nevertheless...
Of course, this is easy to fix, but who cares now?..

Post has been edited 8 time(s), last time on Aug 23 2009, 12:23 pm by Wormer. Reason: Realized I made an error



Some.

Aug 15 2009, 3:24 am bearcat_fan Post #98



Hey guys, I would really like to use this tool but my programming knowledge stops at Basic. Basic language will get me through learning this trigger language, but I cannot get the program open for the life of me.

I have read every post and have tried to get this program to run for the last 2 hours. I need to know exactly what to type in to get the jarfile to be accessed. I downloaded java environment and should be good to go there.

My command line is this:

C:\Users\Bearcat>java -jar C:\Program Files\Starcraft\Macro Trigger\mtrigsc.jar C:\Program Files\Starcraft\Macro Trigger\source.mtrigger
Also tried:
C:\Users\Bearcat>java -jar C:\Program Files\Starcraft\Macro Trigger\mtrigsc.jar C:\Program Files\Starcraft\Macro Trigger\source.mtrigger out.trigger out.property

When I hit enter, it says:
Unable to acces jarfile C:\users\bearcat\Program

I named an example trigger Source.mtrigger. From reading the posts, am I suppose to have a source.mtrigger file? I don't get what source.trigger, out.trigger, and out.property work when starting this.

Call me stupid, but I can't figure this out. I really appreciate any help and I would really like to use this tool for the RPG competition.

EDIT POST: Okay, so I used quotes and got it to say MacroTriggers Compilier v1.4 and then it gives another command line. I guess I need SCMD editor first to get triggers to start with? This is way confusing.....I am not in the loop.
EDIT AGAIN: So I downloaded SCM Draft and started playing with the text editor. I think this is all I need since I can create triggers in Excel and copy them in. I will see if I can't use your program if I can figure it out ;)~


Thanks,
bearcat_fan

Post has been edited 2 time(s), last time on Aug 15 2009, 3:55 am by bearcat_fan.



None.

Aug 15 2009, 6:51 am Wormer Post #99



bearcat_fan, yes you almost did it!

When you got the line saying "MacroTriggers Compilier v1.4" it means mtrigs worked out on your source.mtrigger file successfully and that you got output files created by the program. The only thing you left to do is to look for files out.trigger and out.property in the current folder which was "C:\Users\Bearcat". If there was something in your source.mtrigger file then you'll see some SCMD triggers in the file out.trigger and can copy/paste them into the SCMD text editor (yes, this how it works).

Also, could you tell me what system do you use? Is it XP or Vista? Because recently there were problems with writing to the programs folder on Vista (probably).

Post has been edited 2 time(s), last time on Aug 15 2009, 7:03 am by Wormer.



Some.

Aug 19 2009, 1:31 am NothingZ Post #100



After pressing Ctrl + F6 after finishing my triggers, how do I find where the output of the triggers were?
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

Also:

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'

Thanks in advance.

Post has been edited 1 time(s), last time on Aug 19 2009, 2:06 am by NothingZ.



None.

Options
Pages: < 1 « 3 4 5 6 715 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
[2024-4-27. : 9:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[2024-4-27. : 7:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[2024-4-27. : 6:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[2024-4-27. : 3:33 pm]
O)FaRTy1billion[MM] -- o sen is back
Please log in to shout.


Members Online: NudeRaider, Roy