Staredit Network > Forums > SC1 Mapping Tools > Topic: MacroTriggers production thread
MacroTriggers production thread
May 16 2008, 10:36 pm
By: Wormer
Pages: < 1 « 10 11 12 13 1415 >
 

Nov 11 2009, 6:56 pm Wormer Post #221



Quote from Falkoner
Depends on what you're going for, also, using switches becomes impossible when you require numbers any more than 65536 outcomes, I mainly like it because it's easier to work with, but the main advantage of it is if you need a non-binary amount(can be done by using larger numbers and dividing it up), or if you want multiple outcomes within a range to have the same outcome.
Okay, generally right.

But still, you can work with the division of the range of the size 2n (n<16) into k (1<=k<=2n) subranges of the "same" outcomes with not a single additional trigger, as long as these subranges are such that
0 = 2n0 < 2n1 < 2n2 < ... < 2nk-1 < 2nk = 2n,
where nj - nj-1 >= nj+1 - nj for each j=1,...,k-1.

PS
You can also work with some other divisions of the range into subranges in the same way.
The condition on the division in the general case is more complex though.

Post has been edited 1 time(s), last time on Nov 11 2009, 7:01 pm by Wormer. Reason: brrr an error, my bad



Some.

Nov 11 2009, 7:00 pm Falkoner Post #222



Yeah, I also realized the range ability, but it still limits you to binary multiples of ranges. It does work, but I like the less use of switches, and how much easier it is to work with.



None.

Nov 11 2009, 7:03 pm Wormer Post #223



Quote from Falkoner
how much easier it is to work with
Yeah, that is the point.

Quote from Falkoner
but it still limits you to binary multiples of ranges
There are cases when you're not limited to only binary multiplies.
Quote from Wormer
The condition on the division in the general case is more complex though

ADDITION:
Actually, I believe you can work with almost any division. Haven't looked through the whole thing in all details though.

ADDITION2:
Yeah, I am convinced it could be done in any case. The precise algorithm how to make triggers in general case is quite tangled, but if you give me the example division I could tell you the answer.

Post has been edited 2 time(s), last time on Nov 11 2009, 7:12 pm by Wormer.



Some.

Nov 13 2009, 8:03 am The Starport Post #224



Quote from Falkoner
You should replace the Unused Units list in Tuxlar's Information with this one:
Collapsable Box


That's a list of all units that can't be killed in game, so basically any unit that you can use for Death Counts without any fear of them being killed.
Some of those units in the list are not valid Trigedit units, by the way:
Alan Schezar Turret
Tank Turret (Tank)
Edmund Duke Turret (Tank mode)
Edmund Duke Turret (Siege mode)
Tank Turret (Siege Mode)
Cargo Ship
Mercenary Gunship
Was Starbase
Was Repair Bay
Unused Zerg Building
Unused Zerg Building 5
Independant Command Center
Independant Jump Gate


Don't know whose to blame for these dumb unit naming conventions, but trigedit is pretty picky with them.

Post has been edited 2 time(s), last time on Nov 20 2009, 8:08 am by Tuxedo-Templar.



None.

Nov 20 2009, 8:10 am The Starport Post #225



Also, I deleted that first video because it had a lot of poor information and listening to my voice in that one bugs the shit out of me. I'll try to make a proper substitute at some point.



None.

Nov 20 2009, 7:35 pm Wormer Post #226



Oh, sad :(
Head post updated.



Some.

Nov 21 2009, 1:48 am Falkoner Post #227



Yeah, I'd like to get the text version of the installation back..



None.

Nov 23 2009, 6:24 pm The Starport Post #228



I'm thinking of making a simple Trigedit -> Macrotriggers converter after Mafia. It won't "compress" triggers in any sort of intuitive way (like by cramming repetitive triggers in loops automagically or anything like that), but it'll at least allow you to jump into using it mid-project, if you're so inclined.

Who would consider using something like this?



None.

Nov 23 2009, 6:27 pm Wormer Post #229



Will be nice. This may help new people to get familiar with Macrotriggers.



Some.

Nov 29 2009, 8:57 pm melnikov Post #230



i have a question. is MacroTriggers similar to Jass or vJass?

Post has been edited 1 time(s), last time on Nov 29 2009, 9:07 pm by melnikov.



None.

Nov 29 2009, 10:22 pm Wormer Post #231



Quote from melnikov
i have a question. is MacroTriggers similar to Jass or vJass?
I don't know nor Jass niether vJass but I think it's not.
Just look at a few examples to answer the question.
(You may download them from the first post of the thread.)



Some.

Nov 29 2009, 10:27 pm The Starport Post #232



Jass I think is the Warcraft 3 scripting language. MacroTriggers barely qualifies as a "scripting" language, if you want to put it that way. So no. They're not really similar.

MacroTriggers is a lot easier than a normal scripting language, if that's what you're asking (to the extent that triggers themselves can be called 'easy', I guess you could say). It is a tad more complicated than just normal, raw, wizard-based triggers, of course, but if you can handle that then it'll pay off many times over for any non-trivial map project.



None.

Nov 30 2009, 8:02 pm melnikov Post #233



where can i find MacroTriggers Tutorials?



None.

Dec 1 2009, 12:52 am The Starport Post #234



Here. :P



None.

Dec 3 2009, 9:18 pm melnikov Post #235



could anybody make a tutorial video about how to install MacroTriggers for NotePad++?
I installed .jar file. I copied the userDefinelang.xml in notepad++ directory. but I can't use MacroTriggers Syntax in np++ :crazy: + it creates empty .trigger and .property files
Quote
CD: D:\games\StarCraft\mtriggers
Current directory: D:\games\StarCraft\mtriggers
NPP_SAVE: D:\games\StarCraft\mtriggers\t.mtrigger
java -jar "D:\games\StarCraft\mt\mtrigsc.jar" "D:\games\StarCraft\mtriggers\" "t.trigger" "t.property"
Process started >>>
MacroTriggers Compiler v1.6
Exception in thread "main" java.io.FileNotFoundException: D:\games\StarCraft\mtriggers" t.trigger t.property (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at org.antlr.runtime.ANTLRFileStream.load(ANTLRFileStream.java:59)
at org.antlr.runtime.ANTLRFileStream.<init>(ANTLRFileStream.java:47)
at org.antlr.runtime.ANTLRFileStream.<init>(ANTLRFileStream.java:42)
at ru.mtrigs.MTrigs.main(MTrigs.java:26)
<<< Process finished.
NPP_CLOSE: t.property
NPP_OPEN: t.property
NPP_CLOSE: t.trigger
NPP_OPEN: t.trigger
================ READY ================


Post has been edited 2 time(s), last time on Dec 3 2009, 10:03 pm by melnikov.



None.

Dec 20 2009, 7:03 pm Morphling Post #236



I was bored and made these.
Edit: I fixed some triggers.

Attachments:
Division
Hits: 10 Size: 3.68kb
Multiplication
Hits: 8 Size: 2.19kb

Post has been edited 1 time(s), last time on Dec 20 2009, 9:31 pm by Morphling.



None.

Dec 20 2009, 11:49 pm Falkoner Post #237



If you really want them to be reusable, make them a function, I wrote a function for Mystic Islands that takes one death count, another death count, and a maximum value for parameters, and then makes binary count-offs to transfer a number at least as large as the maximum value from the first death count to the second one, so when in the map I need to transfer a value, I simply use a single line, with 3 parameters.

I plan on modifying it soon to allow for a fourth parameter that allows for different math expressions to be done during the transfer, can you overload functions in MacroTriggers?



None.

Dec 21 2009, 8:07 am Wormer Post #238



melnikov
Sorry, I was very busy the last month. Please tell if you still need help.

Morphling
Frankly speaking, I am not in hardcore mood ATM to be able to force myself through your triggers.
Do you use natural division/multiplication algorithms or something more complex?

As a note,
you can use expressions (in particular variables) everywhere the value is permitted (in particular loops), like
Quote

INTEGER BinaryCountOff1 = 15

// Bleh-bleh-bleh

FOR ReplicateEverything = 0 TO BinaryCountOff1 BY 1 DO

// Bleh-bleh-bleh

ENDL

Falkoner
I am quite pessimistic towards reuseability of such things. My view on math operations with DCs is more theoretical, because I believe their implementation is too huge for real applications in real maps. Many triggers inevitably lead to the map lag. Nothing really we can do about it.

What you call functions is better to call macroses. The difference is that first suggest a kind of runtime support, while the last exist only on the high language level. There are no functions in SC, and macroses unfold in normal triggers in the end. I am also quite pessimistic about macroses. As my own practice with MT has shown they are almost never needed to make things good. One can look for different reasons of their uselessness. They probably would have been much more useful if conditions and actions were treated as data.

Don't remember about overloading. It is easy to check: define two blank macroses with equal names and different set of parameters and then call them both. See if it will compile.

Post has been edited 6 time(s), last time on Dec 21 2009, 8:51 am by Wormer.



Some.

Dec 21 2009, 6:31 pm Falkoner Post #239



Quote
There are no functions in SC, and macroses unfold in normal triggers in the end. I am also quite pessimistic about macroses. As my own practice with MT has shown they are almost never needed to make things good. One can look for different reasons of their uselessness. They probably would have been much more useful if conditions and actions were treated as data.

I've found them to be quite useful, actually, since instead of having like 15 triggers taking up a good hundred lines or more of space in my triggers, just to transfer a number possibly as high as 32768, I have one line going:
Code
MACRO transfer(@P(1), @P(2), @U("Cantina"), @U("Cave-in"), 32768)


And I now have the triggers to transfer the deaths from Cantina for P1 to Cave-in for P2, functionality-wise, it's the same, but in readability and organization it does wonders!



None.

Dec 24 2009, 8:49 pm DavidJCobb Post #240



Is there functionality for using arrays in triggers? I know you can define an array outside of a trigger, and pull values from it to use in the trigger... But I was wondering if there was a way to have a dynamic array that gets directly manipulated and edited by triggers. (If there isn't, such functionality could be implemented (if needed) in the form of multiple death counters, where each value of each counter is used as an array index.)

EDIT: Also, can a trigger call a macro?

EDIT: Triggers can't call macros; and AFAIK dynamic arrays aren't possible without manual implementations using death counters.

Post has been edited 2 time(s), last time on Dec 24 2009, 11:40 pm by DavidJCobb. Reason: Answered my own questions through testin



None.

Options
Pages: < 1 « 10 11 12 13 1415 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:26 pm]
UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7: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:
Please log in to shout.


Members Online: UndeadStar, Enfie