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

sparky
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:

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

biped:
flying velocity

vehicle:
speed absolute
speed forward
speed backward
slide absolute
slide left
slide right
speed slide maximum
turn absolute
turn left
turn right
crouch
jump
walk
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
hover
thrust
engine hack
wingtip contrail new

object:
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
alive
compass

weapon:
heat
primary ammunition
secondary ammunition
primary rate of fire
secondary rate of fire
ready
primary ejection port
secondary ejection port
overheated
primary charged
secondary charged
illumination
age
integrated light
primary firing
secondary firing
primary firing on
secondary firing on

item:


projectile:
range remaining
time remaining
tracer

device:
power
change in power
position
change in position
locked
delay


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:

cyborg_mp.biped
(object)
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
attachments
flashlight_cyborg.light
marker "flashlight"
primary scale A out
functions
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
unit
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: Sat October 19, 2019 5:20 PM 109 ms.
A Halo Maps Website