I don't need to test my programs. I have an error-correcting modem.

User:00zX/UScriptIt (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
< User:00zX
Revision as of 05:43, 6 March 2012 by 00zX (Talk | contribs) (Automatic Casts: Example of macro usage we need our auto-caster to go in first before the macros are parsed, some might require afterwards so we end up doing a 2 stage compile.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

UScriptIt

Example of macro usage we need our auto-caster to go in first before the macros are parsed, some might require afterwards so we end up doing a 2 stage compile.

Automatic casts

Macros
`define CheckRet(Obj) if(`Obj == none) return
`define SetToDefault(Obj, Var) `{Obj}.`{Var} = `{Obj}.Default.`{Var}
`define SetVar(Obj, Var) `{Obj}.`{Var} = `{Var}
Usage
`SetVar(`P, CustomGravityScaling);
`P.MaxDoubleJumpHeight = 110;	//87.0
`P.DoubleJumpThreshold = 200.0;	//160.0
`P.FallSpeedThreshold = 150.0;	//125.0
 
/** */
`CheckRet(`MProj()_`{P}(`{P}));
 
`SetVar(`MProj()_`{P}(`{P}), bCanDodge);
`SetVar(`MProj()_`{P}(`{P}), bCanWalldodge);
Output
Pawn.CustomGravityScaling = CustomGravityScaling;
Pawn.MaxDoubleJumpHeight = 110;	//87.0
Pawn.DoubleJumpThreshold = 200.0;	//160.0
Pawn.FallSpeedThreshold = 150.0;	//125.0
 
/** */
if(Plugin_Pawn(Pawn)== none) return;
 
Plugin_Pawn(Pawn).bCanDodge = bCanDodge;
Plugin_Pawn(Pawn).bCanWalldodge = bCanWalldodge;