Quote: "Ohhh Plystire...Lol J/K... "
Seems my plan is already working
Quote: "
Why don't you release the source mod so others can use it? Or have you just used the x10 ragdoll, made the video look like x9 and claimed credit? Sorry for being so quick to accuse, but I'm suspicious of everything.
"
The reason I haven't released it was because of how it wasn't useful besides looking at (which can only get so fun). Although the important code is actually already out in the open in another thread on the dbpro boards, but I'm sure most don't visit those boards so I'll post the changes to the fpsc source here.
Now I won't post up the whole thing but if you have a good knowledge of dbpro and the fpsc source I'm sure you could figure out where to put this. Also note you have to download the updated version of the ODE dll I made if you want to use this.
Function to make the ragdoll-
Function makeRagdoll(offX,offY,offZ)
` Head
head=Find Free Object()
Make Object Sphere head,20
Position Object head,offX,200+offY,offZ
Ode Create Dynamic Sphere head
Ode Set Body Mass head,0.5
` Body
body=Find Free Object()
Make Object Box body,25,50,25
Position Object body,offX,160+offY,offZ
Ode Create Dynamic Box body
Ode Set Body Mass body,0.5
` Left Upper Arm
lUarm=Find Free Object()
Make Object Box lUarm,25,12,12
Position Object lUarm,-30+offX,185+offY,offZ
Ode Create Dynamic Box lUarm
Ode Set Body Mass lUarm,0.5
` Left Lower Arm
lLarm=Find Free Object()
Make Object Box lLarm,30,8,8
Position Object lLarm,-60+offX,185+offY,offZ
Ode Create Dynamic Box lLarm
Ode Set Body Mass lLarm,0.5
` Right Upper Arm
rUarm=Find Free Object()
Make Object Box rUarm,25,12,12
Position Object rUarm,30+offX,185+offY,offZ
Ode Create Dynamic Box rUarm
Ode Set Body Mass rUarm,0.5
` Right Lower Arm
rLarm=Find Free Object()
Make Object Box rLarm,30,8,8
Position Object rLarm,60+offX,185+offY,offZ
Ode Create Dynamic Box rLarm
Ode Set Body Mass rLarm,0.5
` Left Upper Leg
lUleg=Find Free Object()
Make Object Box lUleg,12,30,12
Position Object lUleg,-10+offX,115+offY,offZ
Ode Create Dynamic Box lUleg
Ode Set Body Mass lUleg,0.5
` Left Lower Leg
lLleg=Find Free Object()
Make Object Box lLleg,8,30,8
Position Object lLleg,-10+offX,80+offY,offZ
Ode Create Dynamic Box lLleg
Ode Set Body Mass lLleg,0.5
` Right Upper Leg
rUleg=Find Free Object()
Make Object Box rUleg,12,30,12
Position Object rUleg,10+offX,115+offY,offZ
Ode Create Dynamic Box rUleg
Ode Set Body Mass rUleg,0.5
` Right Lower Leg
rLleg=Find Free Object()
Make Object Box rLleg,8,30,8
Position Object rLleg,10+offX,80+offY,offZ
Ode Create Dynamic Box rLleg
Ode Set Body Mass rLleg,0.5
`
` Attach Joints
jG=ODE Find Free Joint Group()
Ode Create Joint Group jG
` Attach Head to Body
i=ODE Find Free Joint()
Ode Create Ball Joint i,jG
Ode Attach Joint i,head,body
Ode Set Ball Anchor i,offX,195+offY,offZ
` Attach Upper Arms to Body
i=ODE Find Free Joint()
Ode Create Ball Joint i,jG
Ode Attach Joint i,body,lUarm
Ode Set Ball Anchor i,-15+offX,185+offY,offZ
i=ODE Find Free Joint()
Ode Create Ball Joint i,jG
Ode Attach Joint i,body,rUarm
Ode Set Ball Anchor i,15+offX,185+offY,offZ
` Attach Lower Arms to Body
i=ODE Find Free Joint()
Ode Create Hinge Joint i,jG
Ode Attach Joint i,lUarm,lLarm
Ode Set Hinge Anchor i,-48+offX,185+offY,offZ
Ode set Hinge Axis i,0,1,0
i=ODE Find Free Joint()
Ode Create Hinge Joint i,jG
Ode Attach Joint i,rUarm,rLarm
Ode Set Hinge Anchor i,48+offX,185+offY,offZ
Ode set Hinge Axis i,0,1,0
` Attach Upper Legs to Body
i=ODE Find Free Joint()
Ode Create Ball Joint i,jG
Ode Attach Joint i,body,lUleg
Ode Set Ball Anchor i,-10+offX,135+offY,offZ
i=ODE Find Free Joint()
Ode Create Ball Joint i,jG
Ode Attach Joint i,body,rUleg
Ode Set Ball Anchor i,10+offX,135+offY,offZ
` Attach Lower Legs to Body
i=ODE Find Free Joint()
Ode Create Hinge Joint i,jG
Ode Attach Joint i,lUleg,lLleg
Ode Set Hinge Anchor i,-10+offX,100+offY,offZ
Ode set Hinge Axis i,1,0,0
i=ODE Find Free Joint()
Ode Create Hinge Joint i,jG
Ode Attach Joint i,rUleg,rLleg
Ode Set Hinge Anchor i,10+offX,100+offY,offZ
Ode set Hinge Axis i,1,0,0
EndFunction
You'll have to create a new action command with this stuff (I'm assuming you know where to put teh codez)...
#constant AIACTMAKERAGDOLL 1300
#constant AIACTLAST 1400
actword$(AIACTMAKERAGDOLL)="makeragdoll"
And the command...you'll notice I used the position of obj to put the ragdoll so you would have to put down an entity and use the command in the appear script. This was only because I have a limited knowledge of the FPSC Source and it was the quickest way I could find at the time. I am sure there is a much better way.
Edit: Ok I decided to look to see how you could do this with just a marker. And changed the code from looking at the object position to the entity position, which works better.
case AIACTMAKERAGDOLL:
makeRagdoll(entityelement(e).x,entityelement(e).y,entityelement(e).z)
endcase
I only released this because it was already freely available, I don't expect anyone to actually use this.
Edit: And the reason I said to ask your favorite modders was a little bit as a joke and because having to mod the ODE wrapper for dbpro and then to edit the FPSC source to mod my additions in there and then to write scripts to test them and show as examples would be a big pain. That's like programming in three different languages (I don't know if you consider the fpi scripting language as programming though
)
But thats my first accusation since being here, have I proven myself yet