A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE Technical / Map Design »Functions

Author Topic: Functions (1 messages, Page 1 of 1)
Moderators: Dennis

Joined: Jun 27, 2009

Jesus is a friend to the vindictive sociopath

Posted: May 16, 2019 11:40 PM    Msg. 1 of 1       
Object-based tag groups contain four customizable functions: A, B, C, and D.

Each object-based tag group contains unique variables available to use with functions. Here are those variables listed by tag group:

driver seat power
gunner seat power
aiming change
mouth aperture
integrated light power
can blink
shield sapping

flying velocity

speed absolute
speed forward
speed backward
slide absolute
slide left
slide right
speed slide maximum
turn absolute
turn left
turn right
velocity air
velocity water
velocity ground
velocity forward
velocity left
velocity up
left tread position
right tread position
left tread velocity
right tread velocity
front left tire position
front right tire position
back left tire position
back right tire position
front left tire velocity
front right tire velocity
back left tire velocity
back right tire velocity
wingtip contrail
engine hack
wingtip contrail new

body vitality
shield vitality
recent body damage
recent shield damage
random constant
umbrella shield vitality
shield stun
recent umbrella shield vitality
umbrella shield stun
region #00 damage
region #01 damage
region #02 damage
region #03 damage
region #04 damage
region #05 damage
region #06 damage
region #07 damage

primary ammunition
secondary ammunition
primary rate of fire
secondary rate of fire
primary ejection port
secondary ejection port
primary charged
secondary charged
integrated light
primary firing
secondary firing
primary firing on
secondary firing on


range remaining
time remaining

change in power
change in position

You can use up to four of these variables at a time by assigning them the variable names A in, B in, C in, and D in. Function letters and variable letters are unassociated. Each function may use all four variables.

Use Guerilla to customize functions in the object-based tag by adding one block, for every function you want to customize, to FUNCTIONS. The function blocks are defined alphabetically, A to D. Each function uses its metadata values to calculate a result, returned by corresponding letter names A out, B out, C out, and D out; function A returns A out, function B returns B out, function C returns C out, and function D returns D out.

In sum: A, B, C, D are functions. A in, B in, C in, D in are independent function-accessible variables that can be assigned pointers to the available built-in variables of its related tag groups. A out, B out, C out, D out are the return values corresponding to functions A, B, C, D.

To use an example, here are the metadata settings related to functions in the cyborg_mp.biped tag:

modifier shader shield hit.shader_transparent_plasma
intensity source B out
offset source B out
export to functions
A in recent shield damage
B in shield vitality
marker "flashlight"
primary scale A out
A out (usage: integrated light power)
scale function by C in
B out (usage: shield glow source)
scale function by A in
change colors
A (light blue colors, blend in hsv)
darken by B out
scale by B in
B (white and black)
scale by C out
C in integrated light power

First, let's look for the assigned "in" variables. Under the (unlabeled) object tag group section, variables are assigned under "export to functions". Two object variables are assigned: A in = "recent shield damage"; B in = "shield vitality". Further down, under the (labeled) unit tag group section, we see that only one unit variable is used: C in = "integrated light power". Further down, under the (labeled) biped tag group section, its only available variable, "flying velocity" is not used, although it could have been used by D in... if the biped were intended to fly.

Second, look at the object tag group FUNCTIONS section, and at function A. For legibility, function A is labeled under "usage" after the name of its only used variable, C in, "integrated light power". Configuration includes function = one; scale function by = C in; map to = linear. "Scale function by" is a multiplier that is set to use the "integrated light power" variable C in. So as function A runs (each tick, I'm guessing), it will multiply 1 (function = one) times the integrated light power float value 0.0 to 1.0 (scale function by = C in) linearly (map to = linear). So when we use function A's return value elsewhere as A out, such as with the "primary scale" of a light attachment, it will supply float values between 0 and 1.0 according to the unit's integrated light power. We couldn't simply use the integrated light power variable, C in, with the light attachment, because the attachments block only accepts function "out" results.

Use this approach to work with functions: Go through and note which A to D "in" variables are assigned. Read from, and add to, FUNCTIONS. Add a function whenever you want to use a variable, or some other calculations, to affect a resulting value. Then assign the function's "out" result wherever it is accessible within the context of that tag.
Edited by sparky on May 17, 2019 at 05:52 PM


Previous Older Thread    Next newer Thread

Time: Wed January 22, 2020 7:32 AM 156 ms.
A Halo Maps Website