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

Aug 24 2009, 8:01 am Wormer Post #141



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.

Aug 24 2009, 10:09 am Clokr_ Post #142



Wormer, if you're parsing every trigger, why not make your application write a .trg file directly instead of making it output trigedit text?



?????

Aug 25 2009, 4:50 am fat_flying_pigs Post #143



I use Notepad++ Portable. How do I define the language in there? Ive googled it without success.



None.

Aug 25 2009, 5:10 am Falkoner Post #144



Quote
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.

Aug 25 2009, 8:53 am Wormer Post #145



Quote from Clokr_
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. :(

Quote from fat_flying_pigs
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.

Aug 25 2009, 12:24 pm Wormer Post #146



Quote from name:Tuxedo-Templar
Code
TRIGGER
OWNERS: @AllPlayers
CONDITIONS:
    Always()
ACTIONS:
    PreserveTrigger()
ENDT


Gives me this:
Code
line 2:8: type mismatch

?

I can work around it (maybe) by specifying all 8 players, but...
:lightbulb: Tux! There is an excellent workaround!
Quote from Macro Triggers
FORCE AllPlayers = @F("All Players")

TRIGGER
OWNERS: AllPlayers
CONDITIONS: ...
ACTIONS: ...
ENDT




Some.

Aug 25 2009, 4:46 pm Clokr_ Post #147



Quote from Wormer
Quote from Clokr_
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.



?????

Aug 25 2009, 6:39 pm Wormer Post #148



Alright, actually that is an idea :idea:



Some.

Aug 25 2009, 6:39 pm poiuy_qwert Post #149

PyMS and ProTRG developer

Quote from Clokr_
Quote from Wormer
Quote from Clokr_
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.




Aug 25 2009, 8:50 pm theleo_ua Post #150



Quote from name:Tuxedo-Templar
Now for a real tutorial! :D


http://www.youtube.com/watch?v=gi9b3EbDidA
(still processing...)

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.

Aug 25 2009, 9:51 pm Wormer Post #151



Quote from theleo_ua
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 :D



Some.

Aug 26 2009, 1:47 am Clokr_ Post #152



Quote from Wormer
Quote from theleo_ua
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 :D

He's also probably too lazy :P

Post has been edited 1 time(s), last time on Aug 26 2009, 2:01 am by Clokr_.



?????

Aug 26 2009, 4:31 am The Starport Post #153



Quote from theleo_ua
Quote from name:Tuxedo-Templar
Now for a real tutorial! :D


http://www.youtube.com/watch?v=gi9b3EbDidA
(still processing...)

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.

Aug 26 2009, 6:50 am NothingZ Post #154



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 :D



None.

Aug 26 2009, 8:16 am Wormer Post #155



NothingZ, haven't thought about it! This is fine too :)



Some.

Aug 26 2009, 7:32 pm Wormer Post #156



WHOA! :ranting:
A bunch of actions generated wrong SCMD actions with premutated parameters! :blush:
This bug made me crazy today!.. :crazy:

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)
Quote from SCMD Triggers
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.

Aug 27 2009, 9:29 am The Starport Post #157



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.

Aug 27 2009, 12:07 pm Wormer Post #158



Quote from Wormer
:lightbulb: 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.

Aug 27 2009, 1:12 pm The Starport Post #159



Good question. Probably whatever the parser looks for first is whatever is used. Assuming some order of precedence is at work, at least.



None.

Sep 2 2009, 2:56 am The Starport Post #160



Found a good way to use two-dimensional arrays:
Code
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. :P Bit of a hassle being the only way I've found so far to do it, though.



None.

Options
Pages: < 1 « 6 7 8 9 1015 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[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
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: Roy