PDA

View Full Version : [APP] HSPP - Halo Script Preprocessor



Kornman00
December 9th, 2012, 09:57 PM
Download here (http://code.google.com/p/open-sauce/downloads/detail?name=hspp_v1.7z)

HSPP is a C-like preprocessor for .hsc files based on GPP (http://en.nothingisreal.com/wiki/GPP)

Usage: hspp [infile] [outfile]

Example: hspp a10.hs a10.hsc
It doesn't care what the file extensions are. However, I recommend using ".hs" for files which contain preprocessor directives so that the HEK doesn't get a taste of them. Then use ".hsc" for your output files, for obvious reasons.

A full list of supported macros can be found here (http://files.nothingisreal.com/software/gpp/gpp.html) under the "META-MACROS" heading.


The plan is to fully integrate this into the next release of OpenSauce so that it's all transparent. Because of this, I won't be supporting hspp.exe after today so that work on OS isn't interrupted. Until then, feel free to use this to preprocess your scripts before compiling them with Sapien!


Example setup:
include.hs


(script stub unit player1
(unit (list_get (players) 1))
)


example.hs


#define DEFINE_VECTOR(name) \
(global real #1_x 0) \
(global real #1_y 0) \
(global real #1_z 0)

#ifdef DEBUG
; ************************************************** ***************
; * DEBUG BUILD *
; ************************************************** ***************
#else
; ************************************************** ***************
; * RELEASE BUILD *
; ************************************************** ***************
#endif

(script stub unit player0
(unit (list_get (players) 0))
)

#include "include.hs"

;(global real temp_x 0)
;(global real temp_y 0)
;(global real temp_z 0)
DEFINE_VECTOR(temp)



hspp example.hs example.hsc

example.hsc





; ************************************************** ***************
; * RELEASE BUILD *
; ************************************************** ***************


(script stub unit player0
(unit (list_get (players) 0))
)

(script stub unit player1
(unit (list_get (players) 1))
)

;(global real temp_x 0)
;(global real temp_y 0)
;(global real temp_z 0)
(global real temp_x 0) (global real temp_y 0) (global real temp_z 0)