ProTRG v1.1

Help - Resources - Discussion
User avatar
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Thu Mar 11, 2010 3:22 am

Ohhh SCMDraft uses hexadecimal in the TBL formatting but I had used decimal (<13> and <10> should be <0D> and <0A>)! Since we have to change this we'll make it SCMDraft's preferred way with rn. Here is a fix for that and also includes the fix for the slash problem you are having. Go to line 258 which should be:

Code: Select all

      return '"%s"' % val.replace('rn','<13><10>).replace('r','<13><10>').replace('n','<13><10>')l

and replace it with:

Code: Select all

      return '"%s"' % val.replace('rn','rn').replace('r','rn').replace('n','rn').replace('','')

Also, SubtitleDisplay (Don't Always Display in SCMDraft) only shows the text when the user has the option "Show Subtitles" selected from the options menu. And then AlwaysDisplay is pretty straight forwards :P
User avatar
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Thu Mar 11, 2010 3:00 pm

[quote name='bajadulce' post='9497' date='Mar 11 2010, 03:19 AM']the sound files now compile correctly as:

Code: Select all

   Play WAV("soundMiscBuzz.wav", 0);
   Display Text Message(Don't Always Display, "rnrnrnrnrnrnrnrnrnrn<13><06>Message 2");
but those double slashes in "rn" while seem to compile fine in SCMDraft, they aren't displaying correctly. Looks like we just need "rn" to compile as "rn". Can this be changed, but still keep the double slashes in the "" and "" formatting?[/quote]
Ah my mistake again, didn't think about the rn when doing the slashes part. Go to line 258 which should be:

Code: Select all

      return '"%s"' % val.replace('rn','rn').replace('r','rn').replace('n','rn').replace('','')

and move the replace on the end to the beginning:

Code: Select all

      return '"%s"' % val.replace('','').replace('rn','rn').replace('r','rn').replace('n','rn')

[quote name='bajadulce' post='9497' date='Mar 11 2010, 03:19 AM']Sorry I haven't been able to use this program to its fullest with all the macros etc, but it has been a huge help making the trigs for my mod as I don't like the way SCMDraft's trig editor is formated. And that MacroTrig program that I've read about seems really odd. Thnx so much for putting up with all of this.[/quote]
I agree. And no problem, my pleasure.
User avatar
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Fri Mar 12, 2010 4:07 am

Ah, its hard getting all the names correct since SCMDraft has weird names for some things and no reference list, so I generated my list with a little script and a few problems slipped through. Open and go to lines 292-300 which should be:

Code: Select all

Marker = "Zerg Marker"
Marker = "Terran Marker"
Marker = "Protoss Marker"
Beacon = "Zerg Beacon"
Beacon = "Terran Beacon"
Beacon = "Protoss Beacon"
FlagBeacon = "Zerg Flag Beacon"
FlagBeacon = "Terran Flag Beacon"
FlagBeacon = "Protoss Flag Beacon"

and replace it with:

Code: Select all

ZergMarker = "Zerg Marker"
TerranMarker = "Terran Marker"
ProtossMarker = "Protoss Marker"
ZergBeacon = "Zerg Beacon"
TerranBeacon = "Terran Beacon"
ProtossBeacon = "Protoss Beacon"
ZergFlagBeacon = "Zerg Flag Beacon"
TerranFlagBeacon = "Terran Flag Beacon"
ProtossFlagBeacon = "Protoss Flag Beacon"

then go to lines 527-535 which should be:

Code: Select all


and replace it with:

Code: Select all


[quote name='bajadulce' post='9500' date='Mar 11 2010, 01:14 PM']Not sure If I screwed up my version of as this seems to have come up before in an earlier post, but Unit#26 Eduke Turret (Siege Mode) is compiling as "Duke Turret type 1" which seems to be Unit24 in SCMDraft or the (Tank Mode type1). SCMDraft isn't too helpful spotting this either as a lot of units share the same string! wtf?

Code: Select all

Command(CurrentPlayer, 26, AtLeast, 1)
compiles as:

Code: Select all

Command("Current Player", "Duke Turret type 1", At least, 1);

So seems like unit26 needs to be "type 2" for SCMDraft. What file assigns strings to Unit ID's?

For now I did this to to get around this, but this is sort of a hack:

Code: Select all

DukeTurret = "Duke Turret type 2"
EdmundDuke_SiegeMode = "Edmund Duke (Siege Mode)"
DukeTurret_SiegeMode = "Duke Turret type 1"
Hmm, looks like SCMDraft decided to name the Duke Turret that comes first "type 2", told you it can be screwy :P Anyway, that is actually exactly how to fix it.
User avatar
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Sat Mar 27, 2010 2:41 pm

ProTRG v1.1 released
Download Windows EXE: ProTRG v1.1 (1.7mb)
Download the Source: ProTRG v1.1 (49kb, requires Python)

* Updated readme
* Fixed LeaderboardComputerPlayers (changed parameter from SETSWITCHSTATE to SETOTHERSTATE)
* Fixed the default trigger file from "triggers.txt" to "triggers.protrg"
* Fixed the convenience global ACTIONS so it's set to True
* Fixed some TUNIT vs UNIT inconsistancies, and the definitions for conditions/actions with the PERCENT parameter type
* Fixed multilines and slashes in string conversion
* Fixed potential problem with script filenames starting with "protrg" (without quotes)
* Fixed switches to be numbered the same as SCMDraft switches (1-256 instead of 0-255)
* Fixed many unit names
* Added support for compiling straight to .trg's, including GOT compatible .trg's (Note: StarEdit has problems loading recycled strings)
* Added an optional mechanism to have stronger typed values for parameters (Explained more in the Coding section)
* Added support for Extended Unit Deaths (EUD's) using the new stronger type mechanism (using EXTENDEDUNIT type)
* Added DefaultString, which is set to an empty string (""), and all default AI scripts as Globals
* Added @include preprocessor to iclude ProTRG files in others
* Added better command line support
* Added better support for Properties
* Added the keyword argument "disabled" for conditions/actions
* Added the possibility to collapse code in Notepad++ using #> and #< for the start and end
* Added a list of the Globals and their values to reference.txt
* All conditions and actions now inherit from the Condition and Action classes instead of directly from Raw
* LOCATION id's are now 0 to 254 instead of 1 to 255 to conform with map editors default location names
* If an error happens in your script it will now print all the current triggers in the Trigger list (if any) after printing the error traceback
Posts: 1
Joined: Mon Apr 05, 2010 9:31 am

Postby CecilSunkure » Mon Apr 05, 2010 9:44 am

Hello there.

I was wondering if you could add in the memory condition, which is a newer condition for Scmdraft used to make EUD conditions.

Here is a memory condition in standard scmdraft text format:

Memory(x, Comparison, y);

x needs to be able to be negative, and I don't think y will ever need to be. Of course, you don't really do too much low level data manipulation in Python anyways, so I guess it doesn't matter. x and y need to both be integers as well. The comparison is the usual At Least, At Most, Exactly.

The next paragraph goes into explaining the differences between the old EUD conditions and the new ones -- you can probably just not read it and still add in the memory condition to ProTrg just fine.

The traditional EUD condition, done in StarForge, had a general formula of: Address = Offset + (4*(player )) + (48*(unit:id)). The memory condition uses deaths of Terran Marine, which has a unit:id of 0, so the formula becomes a bit simpler where the only variable to solve for becomes player; here is the memory condition formula: Address = Offset + 4*Player + 48*0. So to solve for player, you pretty much just subtract your address from the death table minimum value (which is 5808996) then divide by (4*player#).

If you need anymore info let me know, though, I can't see why you would need anything other than the standard scmdraft text format for the condition :P


Return to “PyMS (poiuy_qwert's complete modding suite)”

Who is online

Users browsing this forum: No registered users and 1 guest