[E2 Library] HoloBoneCore
Description
Library used to create holoparent bones
The term "holoparent bone" essentially means a prop that is parented to a holo, this allows modifications to the position and angle using default holo functions (holoPos, holoAng), the main advantage of this would be disabled physics, most fin planes for example use similar tech, propellers being parented to holos to prevent "spazzing" out, but you can use it for anything really, no need to rely on setang chips for controlling plane's control surfaces for example
How to Use
Functions:
hbc_offsetHoloIndexBy(Value)
hbc_showBones(Visible)
hbc_setBoneVisualData(MDL_Path:string, MAT_Path:string, CLR:vector, SCL:vector)
entity:hbc_holoBone(Parent:entity,Pos:vector,Angle:angle,PosOffset:vector,AngOffset:angle)
entity:hbc_holoBone(Parent:entity,Pos:vector,Angle:angle)
offsetHoloIndexBy will offset the holo index in the these functions after that line, i.e if you create a holo before hand that is not used for parents etc (simply holoCreate(1) for example), you would provide that function the amount of holos created prior to this point
showBones makes the bones created after running it, be visible and use predefined model, material, color and scale (see next function for those)
setBoneVisualData simply sets the preferred model, material, color and scale, note you need to make it visible with the showBones function for it to show up
This:holoBone (offset variant) this function creates a holo, positions it to "This" entity, the prop you want to parent to the holo, pos and angle define where the holo moves after that, offsets are used for parenting the prop with an offset from the holo (i.e pos offset being vec(0,0,100) makes the holo be 100 units above relative to the prop before it's parented to the holo)
This:holoBone (without offsets) this is a simplified version of the one above, does not take any offsets, so the prop is parented from it's origin
Usage example:
@inputs Prop:entity
@persist BoneID:number
if(dupefinished()){reset()} # <- This makes sure the code is refreshed after pasting it in a dupe
if(first()){
#include "Nakilibs/HoloBoneCore"
Prop:deparent() # <- This makes sure the prop does not get removed in case the holo is created late (props that have incorrect parents are removed normally)
BoneID = Prop:hbc_holoBone(entity(),entity():toWorld(vec(0,0,50)),entity():angles())
}
from there, simply use holoPos(BoneID,vector) to move the prop for example
for a more complex usage, consider using a table for the bone indexes, i.e Bones:table instead of BoneID:number and BoneID = ... would be Bones["bone name",number] = ...
Tags
Rate this Build
Discussion (0)
Sign in to join the discussion
holobonecore.txt
Uploader
Nakkitsunami
👤 User