problem at script 3ds max, plz enter if you can help
4 replies, posted
Hi guys
(I'm new here so i don't know if that is the right section or no,so if that is not the right section plz move it )
I have script for c9 game to extrat the bones but this script is too old
there's problem here => fseek f (0x107 - bonename.count)#seek_cur
i must change that offset ,because the game has updated her files
I tried with old files from this game and the script had worked perfectly
but idk how i can get aright offset
you can try with this file here => ph0000.rar
if (heapSize < 20000000) then
(
heapSize = 200000000 -- allow ~ 40 MB instead of just 7.5 MB. Prevents "Runtime Error: Out of scripter memory"
)
fname = GetOpenFileName caption:"Open c9 Model File" types:"c9 Model File(*.r3cb)|*.r3cb"
f = fopen fname "rb" --open file in read only format
fn PrintOffset Var =(
local Var = Var
print ("This is the offset 0x" + (bit.intAsHex Var) as string)
Var
)
fn PrintCount Var = (
local Var = Var
print ("This is the Count 0x" + (bit.intAsHex Var) as string)
Var
)
fn Readword fstream = (
return readshort fstream #unsigned
)
fn ReadFixedString bstream fixedLen =(
local str = ""
for i = 1 to fixedLen do(
str += bit.intAsChar (ReadByte bstream #unsigned)
)
str
)
BNArr = #()
bonecount = readlong f
for a = 1 to bonecount do (
bonename = readstring f
fseek f (0x107 - bonename.count)#seek_cur
boneid2 = readlong f
boneparent = readlong f + 1
BoneID = (a + 1)
m11 = readfloat f; m12 = readfloat f; m13 = readfloat f; m14 = readfloat f
m21 = readfloat f; m22 = readfloat f; m23 = readfloat f; m24 = readfloat f
m31 = readfloat f; m32 = readfloat f; m33 = readfloat f; m34 = readfloat f
m41 = readfloat f; m42 = readfloat f; m43 = readfloat f; m44 = readfloat f
tfm = matrix3 [m11,m12,m13] [m21,m22,m23] [m31,m32,m33] [m41,m42,m43]
m11 = readfloat f; m12 = readfloat f; m13 = readfloat f; m14 = readfloat f
m21 = readfloat f; m22 = readfloat f; m23 = readfloat f; m24 = readfloat f
m31 = readfloat f; m32 = readfloat f; m33 = readfloat f; m34 = readfloat f
m41 = readfloat f; m42 = readfloat f; m43 = readfloat f; m44 = readfloat f
tfm2 = matrix3 [m11,m12,m13] [m21,m22,m23] [m31,m32,m33] [m41,m42,m43]
newBone = bonesys.createbone \
tfm.row4 \
(tfm.row4 + 0.01 * (normalize tfm.row1)) \
(normalize tfm.row3)
newBone.name = BoneName
newBone.width = 0.3
newBone.height = 0.3
newBone.transform = tfm2
newBone.wirecolor = yellow
newbone.showlinks = true
newBone.setBoneEnable false 0
newBone.pos.controller = TCB_position ()
newBone.rotation.controller = TCB_rotation ()
print bonename
print boneid2
print boneparent
if (BoneID == 3) then
newBone.parent = BNArr[1]
if (boneparent != 0) then
newBone.parent = BNArr[boneparent]
append BNArr newBone
fseek f 0x24#seek_cur
nullcount = readlong f
fseek f (0x4 * nullcount)#seek_cur
)
select $'Scene Root'
rotate $ (angleaxis 90.0 [1,0,0])
rotate $ (angleaxis 180.0[0,0,1])
fclose f
anyone can help?
guys i can pay for that
just send msg to me if you want help me and i will give you money :|
Script fixed
script fix.ms
big thx
fixed
Sorry, you need to Log In to post a reply to this thread.