[skip all navigation]

ProTRG v1.1, Easily and efficiently generate masses of triggers

Pages: < 1 2 3 4 5 >
Creator: MC˛poiuy_qwert
Time: Jan 10 2010, 11:13 pm

Post #41     MC˛poiuy_qwert Jan 29 2010, 4:26 am

[Avatar]
PyMS and ProTRG developer
offlinecontact
Rank: Regular
Thanks Cecil, I'll look into your code more when I have the chance.

The .trg exporting is pretty much only meant for modders, but could be useful for people that have no access to SCMDraft. And the problem you're talking about is .trg's dont contain the location information, so there is no location importing/exporting.

Top

Post #42     CecilSunkure Mar 25 2010, 6:47 pm

[Avatar]
offlinecontact
Rank: Veteran
Bump bump? How are things going going? Will that update be out anytime soon?

(user posted image)
Top

Post #43     MC˛poiuy_qwert Mar 25 2010, 7:59 pm

[Avatar]
PyMS and ProTRG developer
offlinecontact
Rank: Regular
I'm sorry I completely forgot about this. Good timing on the post though since I should have access to a Windows computer tonight!

Top

Post #44     CecilSunkure Mar 25 2010, 8:03 pm

[Avatar]
offlinecontact
Rank: Veteran
Awesome, glad to know. I should have some time to work on my in the next couple days, and I'd like to try out ProTrg with it.

(user posted image)
Top

Post #45     MC˛poiuy_qwert Mar 26 2010, 1:49 am

[Avatar]
PyMS and ProTRG developer
offlinecontact
Rank: Regular
Ok I finished it up and compiled it on the Windows computer, I just need BWAI's new FTP info to upload the new version. If anyone wants it before hand post/PM me I guess.

Top

Post #46     MC˛poiuy_qwert Mar 27 2010, 2:47 pm

[Avatar]
PyMS and ProTRG developer
offlinecontact
Rank: Regular
ProTRG v1.1 released
Download Windows EXE: ProTRG v1.1 (1.7mb)
Download the Source: ProTRG v1.1 (49kb, requires Python)

Changes:
* 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

Top

Post #47     CecilSunkure Apr 5 2010, 9:11 am

[Avatar]
offlinecontact
Rank: Veteran
When you open reference.txt, what is the keyboard shortcut to collapse the text into a nicer looking view? I cannot remember, and you changed the original post so it doesn't include that information anymore ;C

Can you also add in support for the memory condition in scmdraft?

Okay, well I modified your reference .txt and made a nice .xml file using the #> #< collapsibles:

http://www.mediafire.com/?oyykynyzjmy

Alt + 1 to collapse first level, alt + 2 to collapse second level. Alt + Shift + 1 to uncollapse first level, Alt + Shift + 2 to uncollapse second level.

I also posted here with some information for making the memory condition.
This post was edited 5 times, last edit by CecilSunkure: Apr 5 2010, 9:44 pm.  Reason given: typo

(user posted image)
Top

Post #48     CecilSunkure Apr 7 2010, 1:37 pm

[Avatar]
offlinecontact
Rank: Veteran
Here is a new source file with the memory condition in it for you poiuy, along with a new reference.xml.

http://www.mediafire.com/?xjk3xdrzrzo

I changed the class definition of a LONG integer as -4294967295 < x > 4294967295.
This post was edited 2 times, last edit by CecilSunkure: Apr 7 2010, 3:38 pm.

(user posted image)
Top

Post #49     MC˛poiuy_qwert Apr 7 2010, 3:28 pm

[Avatar]
PyMS and ProTRG developer
offlinecontact
Rank: Regular
Quote from CecilSunkure?
Can you also add in support for the memory condition in scmdraft?
Yep, easily.

Quote from CecilSunkure?
Okay, well I modified your reference .txt and made a nice .xml file using the #> #< collapsibles
Good idea with making it collapseable, I'll add that.

Quote from CecilSunkure?
I also posted here with some information for making the memory condition
Yep, i'll reply there.

Quote from CecilSunkure?
Here is a new source file with the memory condition in it for you poiuy, along with a new reference.xml. http://www.mediafire.com/?xjk3xdrzrzo
I'll check it out when i get home,

Top

Post #50     CecilSunkure Apr 7 2010, 5:15 pm

[Avatar]
offlinecontact
Rank: Veteran
Okay, none of my code I'm writing in ProTRG is working and I'm not sure why. Not even previous code that I wrote that used to compile perfectly fine. What happens is that things I define before calling a function aren't being considered defined. I can't even define a constant like MAX_INDEX and then reference it from within a function. Code like this:

Code

MAX_INDEX = 1699

def test_Index(i):
    if i > MAX_INDEX:
        print('Error; the max iteration count is %s' % (MAX_INDEX))

test_Index(3)


Will raise the error "NameError: global name 'MAX_INDEX' is not defined".

If you delete the constant MAX_INDEX and just hardcode 1699 into the function test_Index, then the error "NameError: global name 'test_Index' is not defined" will be raised.

This has been happening since the last release of ProTRG :O

Why would the function test_Index be called before the rest of the code is run..?
This post was edited 2 times, last edit by CecilSunkure: Apr 7 2010, 5:25 pm.

(user posted image)
Top

Post #51     Echo Apr 7 2010, 5:21 pm

[Avatar]
Welcome to the Silent Echo Network
offlinecontact
Rank: Veteran
(user posted image)

I don't know what's wrong

I put this in F6
Quote
cd "$(CURRENT_DIRECTORY)"
NPP_SAVE
"E:\ProTRG_EXE\ProTRG\ProTRG.exe" "$(FULL_CURRENT_PATH)"
NPP_CLOSE "scmd_$(NAME_PART).txt"
NPP_OPEN "scmd_$(NAME_PART).txt"

Top

Post #52     CecilSunkure Apr 7 2010, 5:27 pm

[Avatar]
offlinecontact
Rank: Veteran
I couldn't get protrg to work correctly on a flashdrive. You might want to put it in your C: drive. Also, I'd need to see your protrg file to see what's wrong with your code.

(user posted image)
Top

Post #53     Echo Apr 7 2010, 5:31 pm

[Avatar]
Welcome to the Silent Echo Network
offlinecontact
Rank: Veteran
Which file? Exe?

Top

Post #54     CecilSunkure Apr 7 2010, 5:32 pm

[Avatar]
offlinecontact
Rank: Veteran
No the one you are writing your triggers in to compile with protrg.

(user posted image)
Top

Post #55     Echo Apr 7 2010, 5:37 pm

[Avatar]
Welcome to the Silent Echo Network
offlinecontact
Rank: Veteran
What is it called? Would it be either scmd_change.txt or scmd_scmd_change.txt?

Quote from scmd_change.txt
//------------------------------------------------------\\
// Generated by ProTRG v1.1 on Wed Apr 07 13:12:01 2010 \\
//------------------------------------------------------\\


Traceback (most recent call last):
File "<string>", line 1
Notepad++ v5.6.2 new features and fixed bugs (from v5.6.1) :
^
SyntaxError: invalid syntax

Quote from scmd_scmd_change.txt
//------------------------------------------------------\\
// Generated by ProTRG v1.1 on Wed Apr 07 13:13:46 2010 \\
//------------------------------------------------------\\


Traceback (most recent call last):
File "<string>", line 1
//------------------------------------------------------\\
^
SyntaxError: invalid syntax

Top

Post #56     CecilSunkure Apr 7 2010, 5:49 pm

[Avatar]
offlinecontact
Rank: Veteran
Okay so create a new .txt or .protrg file then open it up in notepad++. This is the file you will type code into to compile. The compiled (output triggers that are in scmdraft format) are in the scmd_FileName file.

It looks like you tried to compile the output file :P

Here is an example of writing a hyper trigger in the protrg input file (the file you first open):

Code

for loop in range(3)
    HyperTrigger = Trigger(1)
    Preserve = PreserveTrigger()
    wait = Wait(0)
    Always(add=HyperTrigger)
    for i in range (63):
        HyperTrigger.add(wait)
    HyperTrigger.add(Preserve)


Here is another way:

Code

Hyper = Trigger(1)
Always(add=Hyper)
for i in range(63):
    Wait(0, add=Hyper)
PreserveTrigger(add=Hyper)

(user posted image)
Top

Post #57     MC˛poiuy_qwert Apr 19 2010, 11:25 pm

[Avatar]
PyMS and ProTRG developer
offlinecontact
Rank: Regular
Quote from CecilSunkure;)
Okay, none of my code I'm writing in ProTRG is working and I'm not sure why. Not even previous code that I wrote that used to compile perfectly fine. What happens is that things I define before calling a function aren't being considered defined. I can't even define a constant like MAX_INDEX and then reference it from within a function. Code like this:

Code

MAX_INDEX = 1699

def test_Index(i):
    if i > MAX_INDEX:
        print('Error; the max iteration count is %s' % (MAX_INDEX))

test_Index(3)


Will raise the error "NameError: global name 'MAX_INDEX' is not defined".

If you delete the constant MAX_INDEX and just hardcode 1699 into the function test_Index, then the error "NameError: global name 'test_Index' is not defined" will be raised.

This has been happening since the last release of ProTRG :O

Why would the function test_Index be called before the rest of the code is run..?
I don't think that has ever been valid, or if you are right I don't know how it worked before. What you need to do is use the global keyword inside the function like:

Code

MAX_INDEX = 1699

def test_Index(i):
    global MAX_INDEX
    if i > MAX_INDEX:
        print('Error; the max iteration count is %s' % (MAX_INDEX))

test_Index(3)

Top

Post #58     CecilSunkure Apr 20 2010, 12:58 am

[Avatar]
offlinecontact
Rank: Veteran
That's odd.. I wonder why. You don't need to do that when writing .py files and compiling them, so why would you need to for ProTrg?

[Edit]Oh I guess you do. Weird. I never noticed before.. ;C
This post was edited 1 time, last edit by CecilSunkure: Apr 20 2010, 5:15 am.

(user posted image)
Top

Post #59     xAngelSpiritx May 7 2010, 10:30 pm

[Avatar]
Erryday I'm lurkerin'
offlinecontact
Rank: Regular
The link is dead.
(btw, what happened to bwai?)

(user posted image)
L>PERSON TO PLAY SC1 MODS WITH @@@@@@@@
Top

Post #60     CecilSunkure May 8 2010, 1:13 am

[Avatar]
offlinecontact
Rank: Veteran
What link? I can upload something if you need.

(user posted image)
Top
0 members in this topic (italic members are currently writing a reply): None
+ guest(s)


[04:22 am]
Dem0n -- also get on skype XD
[04:21 am]
Dem0n -- I'm curently eating pepper jack cheese :O
[04:18 am]
lil-Inferno -- Only Swiss cheese is holy
[04:18 am]
Dem0n -- WUT EAT]\
[04:17 am]
Dem0n -- SO HUNGRYT
[03:09 am]
Wing Zero -- fair enough
[03:08 am]
Wing Zero -- ...
Please log in to shout.