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.
[03:27 am]
m.0.n.3.y -- Maybe because it's an EUD map?
[03:27 am]
m.0.n.3.y -- Can't upload maps to the DB. Error says "The action you have performed caused an Error". Any word?
[07:46 am]
RIVE -- :wob:
[2024-4-22. : 6:48 pm]
Ultraviolet -- :wob:
[2024-4-21. : 1:32 pm]
Oh_Man -- I will
[2024-4-20. : 11:29 pm]
Zoan -- Oh_Man
Oh_Man shouted: yeah i'm tryin to go through all the greatest hits and get the runs up on youtube so my senile ass can appreciate them more readily
You should do my Delirus map too; it's a little cocky to say but I still think it's actually just a good game lol
[2024-4-20. : 8:20 pm]
Ultraviolet -- Goons were functioning like stalkers, I think a valk was made into a banshee, all sorts of cool shit
[2024-4-20. : 8:20 pm]
Ultraviolet -- Oh wait, no I saw something else. It was more melee style, and guys were doing warpgate shit and morphing lings into banelings (Infested terran graphics)
[2024-4-20. : 8:18 pm]
Ultraviolet -- Oh_Man
Oh_Man shouted: lol SC2 in SC1: https://youtu.be/pChWu_eRQZI
oh ya I saw that when Armo posted it on Discord, pretty crazy
[2024-4-20. : 8:09 pm]
Vrael -- thats less than half of what I thought I'd need, better figure out how to open SCMDraft on windows 11
Please log in to shout.


Members Online: CarpetCleaningWokin, Roy