HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Making a Preprocessor

10-12-2009, 07:27 AM#1
Mooglefrooglian
Alright, I was introduced to Python this weekend and really like it. Just as a project to myself, I thought I'd create a little pyJass preprocessor (in python, just because. I'll just have to handle MPQ'ing it up with C++ and StormLib though).

While Vex has kindly given his source code, I just have to ask:

How exactly are maps set up to be optimized? From what I can see, JH takes war3map.j, processes, and stuffs it back in.

And yet, when you reload the map, you see none of the things. So therefore one has to assume that the map script is held in war3map.j and ALSO other files within the map. I'm interested in knowing: does doing ANYTHING to war3map.j affect written triggers? IE can I delete it and reload the map and still have the triggers, just the map can't run? What other files contain the trigger data?

Thanks in advance for any help, and sorry if this is in the wrong forum. It seems like the right place, though.
10-12-2009, 08:03 AM#2
Earth-Fury
Quote:
Originally Posted by Mooglefrooglian
Alright, I was introduced to Python this weekend and really like it. Just as a project to myself, I thought I'd create a little pyJass preprocessor (in python, just because. I'll just have to handle MPQ'ing it up with C++ and StormLib though).

While Vex has kindly given his source code, I just have to ask:

How exactly are maps set up to be optimized? From what I can see, JH takes war3map.j, processes, and stuffs it back in.

And yet, when you reload the map, you see none of the things. So therefore one has to assume that the map script is held in war3map.j and ALSO other files within the map. I'm interested in knowing: does doing ANYTHING to war3map.j affect written triggers? IE can I delete it and reload the map and still have the triggers, just the map can't run? What other files contain the trigger data?

Thanks in advance for any help, and sorry if this is in the wrong forum. It seems like the right place, though.

http://www.wc3c.net/showthread.php?t=66327

"triggers" (either a GUI trigger, or a section of JASS the editor so confusingly calls a trigger) are stored in some of the files within a map's MPQ. When you save the map, the editor generates functions to place all the preplaced units, set up some shit for the game, and merges the triggers from the other data files all in to war3map.j.

The way JH works is by simply working on war3map.j after the editor has done all that work for you.

And just to be clear: Do whatever the fuck you want to war3map.j. The editor can and will generate a new one that simply replaces the old one every save. (Thus why JH needs to be run on a map saved with the editor, even if the code hasn't at all changed.)
10-12-2009, 07:12 PM#3
Mooglefrooglian
Thank's a lot. If you ever need anything, ask.

Edit: Finished for most intents and purposes.

Collapse JASS:
function Trig_T_Actions takes nothing returns nothing
    if(true):
        BJDebugMsg("ROAR")
endfunction

//===========================================================================
function InitTrig_T takes nothing returns nothing:
    set gg_trg_T = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_T, 5 )
    call TriggerAddAction( gg_trg_T, function Trig_T_Actions )

Compiles and runs succesfully, as does pretty much anything you put a colon after (assuming you put the syntax correct - I'm not checking any words other than if).

My question is now: are there any PREFIXES I have to worry about in JASS? I've got "private" and "static" covered, as well as "public" and "debug".. Are there any others?
10-31-2009, 09:29 PM#4
thelifelessone
Your making a preprocessor in Python, to add Python like syntax to JASS?
AWESOME. I'm learning Python, and if this gets finished, it could help me learn more about the syntax. :D
11-01-2009, 01:18 AM#5
Vexorian
Slightly OT but I am making a language mod that has this indent-based stuff from python and other things.
http://www.wc3c.net/pastebint.php?t=...ffe5f45e46a1ed
11-01-2009, 02:27 AM#6
thelifelessone
That's pretty cool. I'm not a fan of ":" (makes me feel like I'm reading a text document rather than code. In a bad way), but it still looks pretty cool.