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 2
n (n<16) into k (1<=k<=2
n) subranges of the "same" outcomes with not a single additional trigger, as long as these subranges are such that
0 = 2
n0 < 2
n1 < 2
n2 < ... < 2
nk-1 < 2
nk = 2
n,
where n
j - n
j-1 >= n
j+1 - n
j for each j=1,...,k-1.
PSYou 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.
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.
how much easier it is to work with
Yeah, that is the point.
but it still limits you to binary multiples of ranges
There are cases when you're not limited to only binary multiplies.
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.
You should replace the Unused Units list in Tuxlar's Information with this one:
Collapsable Box
Goliath Turret
Nuclear Missile
Alan Schezar Turret
Tank Turret (Tank)
Edmund Duke Turret (Tank mode)
Edmund Duke Turret (Siege mode)
Tank Turret (Siege Mode)
Scanner Sweep
Cargo Ship
Mercenary Gunship
Map Revealer
Disruption Web
Was Starbase
Was Repair Bay
Unused Zerg Building
Unused Zerg Building 5
Unused Protoss Building
Unused Protoss Building
Mineral Field (Type 1)
Mineral Field (Type 2)
Mineral Field (Type 3)
Cave
Cave-in
Cantina
Mining Platform
Independant Command Center
Independant Jump Gate
Ruins
Kyadarin Crystal Formation
Vespene Geyser
Zerg Marker
Terran Marker
Protoss Marker
Zerg Beacon
Terran Beacon
Protoss Beacon
Zerg Flag Beacon
Terran Flag Beacon
Protoss Flag Beacon
Dark Swarm
Left Upper Level Door
Right Upper Level Door
Left Pit Door
Right Pit Door
Start Location
Flag
Young Chrysalis
Psi Emitter
Data Disc
Khaydarin Crystal
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.
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.
Yeah, I'd like to get the text version of the installation back..
None.
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.
Will be nice. This may help new people to get familiar with Macrotriggers.
Some.
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.
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.
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.
where can i find MacroTriggers Tutorials?
None.
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++
+ it creates empty .trigger and .property files
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.
I was bored and made these.
Edit: I fixed some triggers.
Attachments:
Post has been edited 1 time(s), last time on Dec 20 2009, 9:31 pm by Morphling.
None.
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.
melnikovSorry, I was very busy the last month. Please tell if you still need help.
MorphlingFrankly 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
INTEGER BinaryCountOff1 = 15
// Bleh-bleh-bleh
FOR ReplicateEverything = 0 TO BinaryCountOff1 BY 1 DO
// Bleh-bleh-bleh
ENDL
FalkonerI 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.
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:
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.
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.