Staredit Network > Forums > SC1 Mapping Tools > Topic: ProTrig @include function
ProTrig @include function
Aug 10 2010, 7:09 am
By: goobie  

Aug 10 2010, 7:09 am goobie Post #1



I'd like to make a .protrg file which implements common triggers as functions, so that I don't have to write them out for every map.

Here is my current .protrg file
Code
def hyper(x, y):
   
    HyperTrig = Trigger(x, add=False)
   
    Always()
    for Timer in range(63):
        Wait(0)
    PreserveTrigger()
   
    for i in range(y):
        HyperTrig.addTrigger()
       


Now I try using @include to import the Hyper function into another .protrg file
Code
@include ProTrigFunctions.protrg

hyper(8,3)


And this is the resulting file
Code
//------------------------------------------------------\\
// Generated by ProTRG v1.1 on Tue Aug 10 00:53:18 2010 \\
//------------------------------------------------------\\


Traceback (most recent call last):
 File "ProTRG.py", line 1571, in <module>
 File "ProTRG.py", line 1531, in main
IndexError: list index out of range


I've tried saving ProTrigFunctions.protrg in the Notepad++ directory, and also tried listing the full file extension in @include, but this didn't work either.



There's got to be something more to life than being really, really, ridiculously good looking...

Aug 10 2010, 11:25 am Cinolt Post #2



I reported the same problem but no fix has been made; for now you just have to copy and paste it all into one file. I've written a protrg script that has all the functions I would think a mapper would need here.



None.

Aug 10 2010, 2:45 pm CecilSunkure Post #3



You can use the include keyword and import from a .py module instead of using the @include function. Just save your separate protrg file as a .py file, and keep your protrg code within it.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:37 am]
tokatta007 -- I love my everdrive. Was really cool to test the coop mod on there. Just wish I can polish this last bug! >:(
[02:26 am]
Symmetry -- I really need to get an everdrive. and a TV that doesn't suck for my n64
[01:15 am]
tokatta007 -- Thank you Symmetry. It was about time someone worked on SC64 :)
[2026-8-26. : 2:34 am]
Symmetry -- Power to ya tokatta
[2026-8-26. : 2:34 am]
Symmetry -- Jeez someone's modding SC64? I've never even hear of anyone trying
[2026-8-26. : 2:27 am]
Symmetry -- if you're looking to upload a map put it on scmscx and link it here. the dldb is... inconsistent
[2026-8-25. : 12:51 pm]
Zakerozi -- Lel... This guy is probably a Zoomer :D :D :D
[2026-8-25. : 9:57 am]
NudeRaider -- dydwk474
dydwk474 shouted: HOW DO YOU EVEN UPLOAD FILE HERE THATS BULLCOWAP THE WEBSITE DUMB
mostly magic, but also doing a :wob:-raindance and sacrificing your firstborn. If that sounds like too much effort, just use www.scmscx.com
[2026-8-25. : 9:55 am]
NudeRaider -- Vrael, did you rename your account?
[2026-8-25. : 7:30 am]
dydwk474 -- HOW DO YOU EVEN UPLOAD FILE HERE THATS BULLCOWAP THE WEBSITE DUMB
Please log in to shout.


Members Online: Symmetry, Oh_Man, tokatta007, Heinermann