PyTRG.py

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

Postby poiuy_qwert » Tue Sep 30, 2008 1:36 am

The Mojo and Artanis problem was a bug in interpreting units with subnames (the part after the <0>), and has been fixed.

The Leaderboard actions that require strings now accept the new keyword Default String to fix that problem.

Added the right-click menu to all text editors.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Fri Oct 03, 2008 2:41 am

:X These are stupid mistakes on my part. Go into LibsTRG.py, goto line 282 which is:

Code: Select all

if condition == 'Anywhere':

and change it to:

Code: Select all

if data == 'Anywhere':


For the second problem, goto line 775 which is:

Code: Select all

if -1 < t < 101:

and change it to:

Code: Select all

if -1 < p < 101:


Thanks for the report, i'll look into your LocUnlock problems soon.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Fri Mar 06, 2009 7:35 pm

It's because of the ( and ) in the unit name, no other unit has those in its name in the default stat_txt. The ( and ) should be decompiled to TBL formatting but it doesn't seem to be doing that for those characers. For now you can either edit/change the stat_txt you use for PyTBL, use the find/replace window to replace the names with the ID when compiling, or manually put in the TBL formatting like:
SetDeaths(Player 1, Floor Hatch <40>UNUSED<41>, Set To, 1)

Sorry for the inconvenience, this has been fixed for next version, thanks.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Fri Nov 06, 2009 2:54 am

The reason its done like that is because of how triggers deal with strings, and because I didn't think about the Comment action. But text triggers should make the Comment action obsolete. The Comment action requires a string in the string table and its only use is organization in a map editor, while a code comment is just dismissed. So it would be something like:

Code: Select all

# Initialize resources
Trigger(All Players):
   Conditions:
      Always()
   Actions:
      SetResources(Current Player, Set To, 50, Ore)

# Defeat
Trigger(All Players):
   Conditions:
      Command(Current Player, At Most, 0, Buildings)
   Actions:
      Defeat()

# Victory
Trigger(All Players):
   Conditions:
      Command(Non Allied Victory Players, At Most, 0, Buildings)
   Actions:
      Victory()


If you need to use the Comment action for some reason there is no easier/cleaner way then the ones you showed.
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

Postby poiuy_qwert » Wed Jan 13, 2010 4:09 am

1) No there is no way. Later down the line I plan for PyTRG be upgraded to use ProTRG once ProTRG is upgraded to compile to .trg's as well as SCMDraft triggers. You could however define constants to make it easier to remember.

Code: Select all

String 188:
Leader Board for Too Much Gold 2nd Pass<0>
Constant TooMuchGoldComment:
String 188

....

Trigger(All Players):
   Conditions:
      ElapsedTime(At Least, 60)
      CountdownTimer(Exactly, 45)
   Actions:
      LeaderBoardResources(Default String, Ore)
      PreserveTrigger()
      Comment(TooMuchGoldComment)


2) You should only have to change LibsTRG.py to make it work, but you'll need to edit PyTRG.pyw to get the correct hover information.

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

Who is online

Users browsing this forum: No registered users and 1 guest