INTEGER q = 8 // Total switches quantity
ARRAY mehSwitchez = {
@S("Switch1"), @S("Switch2"), @S("Switch3"), @S("Switch4"),
@S("Switch5"), @S("Switch6"), @S("Switch7"), @S("Switch8"),
}
FOR n = 0 TO 2^q - 1 DO
TRIGGER
OWNERS: @Neutral
CONDITIONS:
Switch(mehSwitchez[0], @ST((n / 2^0) % 2 == 1))
Switch(mehSwitchez[1], @ST((n / 2^1) % 2 == 1))
Switch(mehSwitchez[2], @ST((n / 2^2) % 2 == 1))
Switch(mehSwitchez[3], @ST((n / 2^3) % 2 == 1))
Switch(mehSwitchez[4], @ST((n / 2^4) % 2 == 1))
Switch(mehSwitchez[5], @ST((n / 2^5) % 2 == 1))
Switch(mehSwitchez[6], @ST((n / 2^6) % 2 == 1))
Switch(mehSwitchez[7], @ST((n / 2^7) % 2 == 1))
ACTIONS:
Comment("Whatever actions here.")
ENDT
ENDL
Some.
Wormer, if you're parsing every trigger, why not make your application write a .trg file directly instead of making it output trigedit text?
?????
I use Notepad++ Portable. How do I define the language in there? Ive googled it without success.
None.
Switch(mehSwitchez[0], @ST((n / 2^0) % 2 == 1))
Switch(mehSwitchez[1], @ST((n / 2^1) % 2 == 1))
Switch(mehSwitchez[2], @ST((n / 2^2) % 2 == 1))
Switch(mehSwitchez[3], @ST((n / 2^3) % 2 == 1))
Switch(mehSwitchez[4], @ST((n / 2^4) % 2 == 1))
Switch(mehSwitchez[5], @ST((n / 2^5) % 2 == 1))
Switch(mehSwitchez[6], @ST((n / 2^6) % 2 == 1))
Switch(mehSwitchez[7], @ST((n / 2^7) % 2 == 1))
Example of why we need loops in triggers.
None.
Wormer, if you're parsing every trigger, why not make your application write a .trg file directly instead of making it output trigedit text?
There is one problem with .trg files: as I understood it (see wiki
.trg format discussion), WAVs could not be specified here.
I use Notepad++ Portable. How do I define the language in there? Ive googled it without success.
You copy the userDefineLang.xml and shortcuts.xml files provided with MT distribution into the "Notepad++Portable\App\Notepad++" and the mtrigs.xml file into the "Notepad++Portable\App\Notepad++\plugins\APIs".
Some.
Quote from name:Tuxedo-Templar
TRIGGER
OWNERS: @AllPlayers
CONDITIONS:
Always()
ACTIONS:
PreserveTrigger()
ENDT
Gives me this:
line 2:8: type mismatch
?
I can work around it (maybe) by specifying all 8 players, but...
Tux! There is an excellent workaround!
Quote from Macro Triggers
FORCE AllPlayers = @F("All Players")
TRIGGER
OWNERS: AllPlayers
CONDITIONS: ...
ACTIONS: ...
ENDT
Some.
Wormer, if you're parsing every trigger, why not make your application write a .trg file directly instead of making it output trigedit text?
There is one problem with .trg files: as I understood it (see wiki
.trg format discussion), WAVs could not be specified here.
Staredit does not save the wavs because it uses the .trg format to move the triggers from one map to another. But you can add the wav strings to the .trg string tables and reference them by ID. I don't think there's anything wrong with that. Have you tested if Staredit loads them? And if not, who cares. SCMDraft and StarForge probably will.
?????
Alright, actually that is an idea
Some.
PyMS and ProTRG developer
Wormer, if you're parsing every trigger, why not make your application write a .trg file directly instead of making it output trigedit text?
There is one problem with .trg files: as I understood it (see wiki
.trg format discussion), WAVs could not be specified here.
Staredit does not save the wavs because it uses the .trg format to move the triggers from one map to another. But you can add the wav strings to the .trg string tables and reference them by ID. I don't think there's anything wrong with that. Have you tested if Staredit loads them? And if not, who cares. SCMDraft and StarForge probably will.
Yeah the path of the WAV is just a normal string referenced by the action, the only reason StarEdit doesn't export it is because when you import the .trg the map wont have the actual WAV in the MPQ with the CHK. So as long as the map editor handles it correctly it should be fine.
4:56: Unfortunately I cant show you this ingame
I understand that we dont need "ingame" show in this tutorial, but I want to know - why you cant? What reasons? Technical problems? What software you using for video capture?
If problem is "Desktop resolution is 1280x1024 and SC resolution is 640x480", I have idea how to fix this without changing desktop resolution. But I need to know - what video card you have? What version of driver? What kind of Display you have and how do you attached it to Video Card (DVI, D-SUB or else)?
There is a nice option in latest Nvidia drivers (dont know about ATI) that can do Starcraft resolution same to desktop resolution, so video capture tool will think that SC has (for example) 1280x1024 and autoscale it to whole screen (in result video).
Thanks.
Btw: nice tutorial! It is not hard to use MT instead of "only text trigedit", but hard to use Text Trigedit after classic:)
Post has been edited 2 time(s), last time on Aug 25 2009, 9:20 pm by theleo_ua.
None.
4:56: Unfortunately I cant show you this ingame
I understand that we dont need "ingame" show in this tutorial, but I want to know - why you cant? What reasons? Technical problems? What software you using for video capture?
That might be, but I think everything is simpler: he simply can't upload videos >10 minutes on YouTube
Some.
4:56: Unfortunately I cant show you this ingame
I understand that we dont need "ingame" show in this tutorial, but I want to know - why you cant? What reasons? Technical problems? What software you using for video capture?
That might be, but I think everything is simpler: he simply can't upload videos >10 minutes on YouTube
He's also probably too lazy
Post has been edited 1 time(s), last time on Aug 26 2009, 2:01 am by Clokr_.
?????
4:56: Unfortunately I cant show you this ingame
I understand that we dont need "ingame" show in this tutorial, but I want to know - why you cant? What reasons? Technical problems? What software you using for video capture?
If problem is "Desktop resolution is 1280x1024 and SC resolution is 640x480", I have idea how to fix this without changing desktop resolution. But I need to know - what video card you have? What version of driver? What kind of Display you have and how do you attached it to Video Card (DVI, D-SUB or else)?
There is a nice option in latest Nvidia drivers (dont know about ATI) that can do Starcraft resolution same to desktop resolution, so video capture tool will think that SC has (for example) 1280x1024 and autoscale it to whole screen (in result video).
Thanks.
Btw: nice tutorial! It is not hard to use MT instead of "only text trigedit", but hard to use Text Trigedit after classic:)
I'm using CamStudio to record, and it looks like crap when I try it. I'm running with some crappy Intel integrated graphics card at the moment.
I think I could use something like Wegame and splice it in via. editing, but that'd take some extra work.
But the movie was 9:30 minutes long as is, which is all that'll fit on Youtube, as Wormer said. Maybe if I make another I'll cut down on the 'lecturing' and babying and just run through the how-to as quickly as possible.
None.
Actually, Wormer, I found a much more simple way to do this.
FOR u = 0 TO 1 BY +1 DO
FOR y = 0 TO 1 BY +1 DO
FOR t = 0 TO 1 BY +1 DO
FOR r = 0 TO 1 BY +1 DO
FOR e = 0 TO 1 BY +1 DO
FOR w = 0 TO 1 BY +1 DO
FOR q = 0 TO 1 BY +1 DO
TRIGGER
OWNERS: @P(1)
CONDITIONS:
Switch(@S("Switch1"), @ST(q == 1)
Switch(@S("Switch2"), @ST(w == 1)
Switch(@S("Switch3"), @ST(e == 1)
Switch(@S("Switch4"), @ST(r == 1)
Switch(@S("Switch5"), @ST(t == 1)
Switch(@S("Switch6"), @ST(y == 1)
Switch(@S("Switch7"), @ST(u == 1)
This helped me generate 128 random possibilities
None.
NothingZ, haven't thought about it! This is fine too
Some.
WHOA! A bunch of actions generated wrong SCMD actions with premutated parameters!
This bug made me crazy today!..
Namely, following MacroTriggers actions
Quote from Macro Triggers
ModifyUnitProperty(@Energy, $amount, $unit, $player, $location, $n)
ModifyUnitProperty(@Hangar, $amount, $unit, $player, $location, $n)
ModifyUnitProperty(@Hitpoints, $amount, $unit, $player, $location, $n)
ModifyUnitProperty(@Resources, $amount, $unit, $player, $location, $n)
ModifyUnitProperty(@Shields, $amount, $unit, $player, $location, $n)
Generated the following SCMD actions with premutated parameters (
red and
yellow)
Modify Unit Energy($player, $unit, $n, $amount, $location);
Modify Unit Hanger Count($player, $unit, $n, $amount, $location);
Modify Unit Hit Points($player, $unit, $n, $amount, $location);
Modify Unit Resource Amount($player, $n, $amount, $location);
Modify Unit Shield Points($player, $unit, $n, $amount, $location);
FIXED! The new version 1.5 available at download section of the head post!
Some.
Nice. Just in time, too. I'm about ready to start playing around with some VHP stuff, so I'll surely be using these.
Also, does that All Players solution require having every player on a single force?
None.
Tux! There is an excellent workaround!
Quote from Macro Triggers
FORCE AllPlayers = @F("All Players")
TRIGGER
OWNERS: AllPlayers
CONDITIONS: ...
ACTIONS: ...
ENDT
This? No, this is a perfect workaround. The idea that MT generates SCMD triggers thinking the string "All Players" is a force name. But instead SCMD treats it as just All Players.
By the way I wonder what happens with SCMD text triggers when one
actually has forces with names like "All Players", "Player 1", "Player 2", ... etc.
Some.
Good question. Probably whatever the parser looks for first is whatever is used. Assuming some order of precedence is at work, at least.
None.
Found a good way to use two-dimensional arrays:
ARRAY _t1 = { @U("Terran Marine"), @U("Terran Firebat") }
ARRAY _t2 = { @U("Terran SCV"), @U("Terran Goliath") }
ARRAY testarray = { _t1, _t2 }
FOR i=0 TO 1 BY 1 DO
FOR j=0 TO 1 BY 1 DO
IF @True THEN
ARRAY _tmp = testarray[i]
TRIGGER
OWNERS: @P(1)
CONDITIONS:
Bring( @CurrentPlayer, @AtLeast, 1, _tmp[j], @Anywhere )
ACTIONS:
DisplayText( "hi", @AlwaysDisplay )
ENDT
ENDIF
ENDL
ENDL
Seems pitifully obvious, now that I think about it.
Bit of a hassle being the only way I've found so far to do it, though.
None.