Staredit Network > Forums > SC1 Mapping Tools > Topic: ProTRG v1.1
ProTRG v1.1
Jan 10 2010, 11:13 pm
By: poiuy_qwert
Pages: < 1 2 3 4 5 >
 

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

PyMS and ProTRG developer

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.




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



Bump bump? How are things going going? Will that update be out anytime soon?



None.

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

PyMS and ProTRG developer

I'm sorry I completely forgot about this. Good timing on the post though since I should have access to a Windows computer tonight!




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



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.



None.

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

PyMS and ProTRG developer

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.




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

PyMS and ProTRG developer

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




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



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.

Post has been edited 5 time(s), last time on Apr 5 2010, 9:44 pm by CecilSunkure. Reason: typo



None.

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



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.

Post has been edited 2 time(s), last time on Apr 7 2010, 3:38 pm by CecilSunkure.



None.

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

PyMS and ProTRG developer

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,




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



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

Post has been edited 2 time(s), last time on Apr 7 2010, 5:25 pm by CecilSunkure.



None.

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





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"




None.

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



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.



None.

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



Which file? Exe?



None.

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



No the one you are writing your triggers in to compile with protrg.



None.

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



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




None.

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



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)




None.

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

PyMS and ProTRG developer

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)





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



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

Post has been edited 1 time(s), last time on Apr 20 2010, 5:15 am by CecilSunkure.



None.

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

eternal lurker

The link is dead.
(btw, what happened to bwai?)



None.

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



What link? I can upload something if you need.



None.

Options
Pages: < 1 2 3 4 5 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:17 pm]
Pr0nogo -- u
[02:35 pm]
lil-Inferno -- u
[02:02 pm]
Corbo -- No
[01:28 pm]
razorback9423 -- Um, is this shoutbox active?
[2019-9-14. : 11:18 am]
razorback9423 -- C.I.S. Conversion Mod will have a campaign, and the first part is coming this September.
[2019-9-13. : 12:03 am]
Wing Zero -- Memes
[2019-9-12. : 8:36 pm]
KrayZee -- I'm curious what internet archaeologists will find in Maplantis
[2019-9-12. : 5:17 pm]
MTiger156 -- Moral of the story - don't end up like Friendster
[2019-9-12. : 3:53 am]
Pr0nogo -- Voyager7456
Voyager7456 shouted: kill you opponent
Zoan
Zoan shouted: this map was boring as far as I remember lol
Please log in to shout.


Members Online: Roy, BeatMeistro, Doodan, ozellochoa