Tutorial 31: Sticking Entities to Each Other



STICKFROM=[name],[parent_surface],[child_track],[child_surface]
STICKTO=[name],[child_surface],[parent_track],[parent_surface]
UNSTICK=[name]

You can attach anything to anything. Like a gun to boots hand. I have even seen Boots, attached to Stiletto, who was attached to Grumpos staff… the mind reels!

You can use either the special model surfaces (like fx_1, hand_r, glue_a, etc) or those special surface triangles (#457, etc) that can be viewed in Particleman (out of engine) or trihigh (in engine).

STICKFROM=[name],[parent_surface],[child_track],[child_surface]

Newscript
On cubic 1 place boots
Newent=character_boots;floor=1

On cubic 2 place automap
Newenr=ob_automap

On cubic 1 put a cmd node at 2.0 secs
Stickfrom=f101,hand_r,2,#22

F101 is a name/id, for you to keep track of.
Hand_r is the parent surface ON BOOTS that will attach to the automap
2 is referencing the automap which is on cubic track 2, which is how the command picks the entity. (JOEY: this could be explained better)
#22 is the surface on the automap that you desire to attach to boots hand.

Play the script. Notice how the automap sways with boots animation idle, You can play some boots aniation and the automap will follow.

Try changing the surfaces.
Stickfrom=f101,#137,2,#16

STICKTO=[name],[child_surface],[parent_track],[parent_surface]

On cubic 3 place rho
Newent=character_rho;floor=1

On cubic 3 put a cmd node at 4.0 secs
Stickto=f102,hand_r,1,hand_l
(that is an L not a 1)

This will attach Rho’s right hand to Boots left hand.

F102 is the name / id
Hand_r is the child surface on Rho
1 is the track that boots is on, determining the destination that Rho will go to.
Hand_l is the parent surface on Boots

Play this

On cubic 1 put a node at 10.0 secs
Unstick=f102

F102 is Rho attachment

On cubic 1 put a node at 12.0 secs
Unstick=f101