riftporn wrote:
To try this:
in \pack_dungeon\init\std\template\char\brain\code\run\puppet0_state.dat (for Dungeon EX, not sure where the file is from)
add
Quote:
SetFocusDirect(false);
set_main_focus(NONE);
loc.sf.type = LOOK;
loc.sf.head = false;
SetFocusType(loc.sf);
SetEyeState(CLOSED);
after loc.state.pose_id = 0;
(This could be made into a new pose of course)
Sadly, the springs in her neck are still stiff, can't they be disabled somehow?
yea i did it a little differently and forgot to mention how
Code:
loc.res = pose_state();
[loc.res] return;
case (state.dyn.me.do.state2)
{
[START1]
{
loc.sp.pose_type = CHAINS;
loc.sp.pose_id = 0;
SetPose(loc.sp);
SetGesture(CHAINS_MOVE);
do_set_timer(30);
state.dyn.me.do.state2 = KNOCKEDOUT;
SetFocusDirect(false);
set_main_focus(NONE);
loc.sf.type = LOOK;
loc.sf.head = false;
SetFocusType(loc.sf);
SetEyeState(CLOSED);
}
[KNOCKEDOUT]
{
loc.ts = GetTs();
[loc.ts < state.dyn.me.do.ts] return;
// Get locked top
loc.go.obj = CHAIN21;
loc.go.par = CHAINS_GET_CHAINED_TOP;
loc.locked0 = GetObject(loc.go);
// Get locked to rig0
loc.go.obj = CHAIN21;
loc.go.par = CHAINS_GET_CHAINED_RIG0;
loc.locked1 = GetObject(loc.go);
// Get locked to rig1
loc.go.obj = CHAIN21;
loc.go.par = CHAINS_GET_CHAINED_RIG1;
loc.locked2 = GetObject(loc.go);
// If legs locked
[loc.locked0 | loc.locked1 | loc.locked2]
{
do_set_timer(5);
talk.s = "Why am in in chains";
state.dyn.me.do.state2 = KNOCKEDOUT2;
SetFocusElem(FACE);
// Reset focus mode
SetFocusMode(NONE);
// Reset focus object
SetFocusObj("#MAIN");
SetEyeState(OPEN);
}
else
{
state.dyn.me.do.state2 = FINISH;
talk.s = "What the hell did you knock me out for";
SetFocusElem(FACE);
// Reset focus mode
SetFocusMode(NONE);
// Reset focus object
SetFocusObj("#MAIN");
SetEyeState(OPEN);
}
}
[KNOCKEDOUT2]
{
loc.ts = GetTs();
[loc.ts < state.dyn.me.do.ts] return;
// Get locked top
loc.go.obj = CHAIN21;
loc.go.par = CHAINS_GET_CHAINED_TOP;
loc.locked0 = GetObject(loc.go);
// Get locked to rig0
loc.go.obj = CHAIN21;
loc.go.par = CHAINS_GET_CHAINED_RIG0;
loc.locked1 = GetObject(loc.go);
// Get locked to rig1
loc.go.obj = CHAIN21;
loc.go.par = CHAINS_GET_CHAINED_RIG1;
loc.locked2 = GetObject(loc.go);
// If legs locked
[!loc.locked0 & !loc.locked1 & !loc.locked2]
{
state.dyn.me.do.state2 = FINISH;
talk.s = "Finally im free from those chains";
}
else
{
do_set_timer(5);
}
}
[FINISH]
{
SetGesture(CHAINS_FALL1);
// Take on fall pose
loc.state.pose_type = CHAINS_FALL;
loc.state.pose_id = 0;
SetPose(loc.state);
do_set_timer(1);
state.dyn.me.do.state2 = FINISH2;
}
[FINISH2]
{
loc.ts = GetTs();
[loc.ts < state.dyn.me.do.ts] return;
SetGesture(NONE);
// Take on quad pose (pivots fall)
loc.state.pose_type = CHAINS_QUAD;
loc.state.pose_id = 0;
SetPose(loc.state);
do_set_timer(1);
state.dyn.me.do.state2 = FINISH3;
}
[FINISH3]
{
loc.ts = GetTs();
[loc.ts < state.dyn.me.do.ts] return;
state.dyn.me.do.state2 = NOTHING;
SetGesture(NONE);
// Reset task
state.dyn.me.do.state = MOVE0;
state.dyn.me.do.state2 = START1;
state.dyn.me.do.state3 = STAND;
}
}
Basically when triggered (mines from on_hit so when ran into)
make them fall over then go to KNOCKOUT state and when they wake up if the chains are in use then go to KNOCKOUT2 and wait until the chains are no longer in use
and reset the head when they wake up
If you don't want them to wake up then remove the state.dyn.me.do.state2 = KNOCKEDOUT; and trigger the FINISH another way
Then in the char_base set find "type = CHAINS_MOVE;"
and set the springs to 0 and they will be completely ragdoll
Hope this helps