XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Thu Dec 13, 2018 9:47 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Heaven of the three kingdoms
PostPosted: Tue Jan 19, 2010 3:34 am 
Offline
Moderator
User avatar

Joined: Sun May 18, 2008 3:01 pm
Posts: 2503
Has thanked: 57 times
Have thanks: 1248 times
Here is a max script to import these models I only tested it on this model I attached here so if it does not work on other models let me know.
Image

Max script save into a text document and give it the extension .ms
Code:
if (heapSize < 20000000) then
   heapSize = 40000000 -- allow ~ 40 MB instead of just 7.5 MB. Prevents "Runtime Error: Out of scripter memory"

fname = GetOpenFileName caption:"Open Clare3d Model File" types:"Clare3d Model File(*.c3m)|*.c3m"
f = fopen fname "rb"   --open file in read only format
p = getFilenamePath fname


fseek f 0x20 #seek_set
Count1 = readlong f
Null1 = readlong f
Count2 = readlong f
Null2 = readlong f
Null3 = readlong f
Null4 = readlong f
Count3 = readlong f
MeshNumber = readlong f
VertCount = readlong f
FaceCount = readlong f

fn readword fstream = (
return (readshort fstream #unsigned)
)
VertexOffset = ftell f
fseek f (0x20 * VertCount)#seek_cur
FaceOffset = ftell f
fseek f (0x2 * FaceCount)#seek_cur
TableOffset = ftell f

for aa = 1 to MeshNumber do (
Vert_array = #()    --define arrays for verts, normals, UV and Faces
Normal_array = #()
UV_array = #()
Face_array = #()
Mesh_array = #() 
fseek f TableOffset #seek_set
fseek f 0x44 #seek_cur
VertOffsetAdd = readlong f
FaceOffsetAdd = readlong f
VertCountAdd = readlong f
FaceCountAdd = readlong f
float1 = readfloat f
float2 = readfloat f
float3 = readfloat f
Null1 = readlong f
Null2 = readlong f
DiffuseTexture = readstring f
skipbytes = 0x20 - DiffuseTexture.count - 1
fseek f skipbytes #seek_cur
fseek f 0x20 #seek_cur
append Mesh_array VertOffsetAdd
append Mesh_array FaceOffsetAdd
append Mesh_array VertCountAdd
append Mesh_array FaceCountAdd
append Mesh_array DiffuseTexture
TableOffset = ftell f

fseek f ((Mesh_array[1] * 0x20) + VertexOffset)#seek_set
for i = 1 to Mesh_array[3] Do (
vx = readfloat f     --read xyz coordinates
vy = readfloat f
vz = readfloat f
append Vert_array [vx,vy,vz] --save verts to Vert_array
        --since UV in Max are in point3 format, so we add 0 for z value
nx = readlong f    --read Normal ??
ny = readlong f
nz = readlong f
append Normal_array [nx,ny,nz] --save normals to Normal_array
tu = readfloat f     --read UV float value
tv = (readfloat f) * -1
append UV_array [tu,tv,0]  --save UVs to UV_array
)
fseek f ((Mesh_array[2] * 0x2) + FaceOffset)#seek_set
for i = 1 to Mesh_array[4] / 3 Do (

f1 = (readword f) + 1   --read face indices, games are start form 0, but Max start from 1
f2 = (readword f) + 1   --so we add 1 to each index
f3 = (readword f) + 1
append Face_array [f1,f2,f3] --save faces to Face_array
)
msh = mesh vertices:Vert_array faces:Face_array
msh.numTVerts = UV_array.count
buildTVFaces msh
msh.material = meditMaterials[aa]
meditMaterials[aa].name = Mesh_array[5]
meditMaterials[aa].diffuseMap = Bitmaptexture fileName:(p + Mesh_array[5] + ".dds")
meditMaterials[aa].opacityMap = copy meditMaterials[aa].diffuseMap
meditMaterials[aa].diffuseMap.alphaSource = 2
meditMaterials[aa].opacityMap.monoOutput = 1
meditMaterials[aa].opacityMapEnable = on

for j = 1 to UV_array.count     do setTVert  msh j UV_array[j]
for j = 1 to Face_array.count   do setTVFace msh j Face_array[j]
for j = 1 to Normal_array.count do setNormal msh j Normal_array[j]
)
actionMan.executeAction 0 "40021"  -- Selection: Select All
modPanel.addModToSelection (Normalmodifier ()) ui:on
$Object01.modifiers[#Normal].flip = on
actionMan.executeAction 0 "311"  -- Tools: Zoom Extents All Selected
clearSelection()
actionMan.executeAction 0 "63508"  -- Views: Standard Display with Maps
fclose f     --close file

http://three.hanbiton.com/Home/Home.aspx


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Last edited by chrrox on Tue Jan 19, 2010 2:01 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Heaven of the three kingdoms
PostPosted: Tue Jan 19, 2010 2:00 pm 
Offline
Moderator
User avatar

Joined: Sun May 18, 2008 3:01 pm
Posts: 2503
Has thanked: 57 times
Have thanks: 1248 times
script has been updated corrected a small bug with texture name length.


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: Heaven of the three kingdoms
PostPosted: Sat Jun 14, 2014 3:27 am 
Offline
beginner

Joined: Thu May 01, 2014 2:12 pm
Posts: 20
Has thanked: 1 time
Have thanks: 0 time
Hello, I extract The heaven of three kingdoms file is not c3m format, isn't it The same game?

Translation of English, I'm sorry

This is my unzip the files:

http://www.4shared.com/rar/qRGL0UuKba/npc.html

it is .gmd,gsi,gut,gutx.


Top
 Profile  
 
 Post subject: Re: Heaven of the three kingdoms
PostPosted: Tue Jun 17, 2014 3:27 pm 
Offline
n00b

Joined: Mon Jun 09, 2014 7:28 pm
Posts: 18
Has thanked: 1 time
Have thanks: 0 time
sorry, on the link for download Client are much errors, you need an Korea Pass for registering, but 1% of europe people has that, chroox can you send us an link to download the Client for unpacking that ?

or can you upload on mega or other upload company!

Nice greetings and thanks for help


Top
 Profile  
 
 Post subject: Re: Heaven of the three kingdoms
PostPosted: Tue Jun 17, 2014 11:35 pm 
Offline
double-veteran
double-veteran
User avatar

Joined: Sun Jul 05, 2009 2:03 am
Posts: 640
Has thanked: 71 times
Have thanks: 35 times
how unpack game files, is possible provide it? many thanks for support.


Top
 Profile  
 
 Post subject: Re: Heaven of the three kingdoms
PostPosted: Fri Jun 20, 2014 3:03 am 
Offline
beginner

Joined: Thu May 01, 2014 2:12 pm
Posts: 20
Has thanked: 1 time
Have thanks: 0 time
Image

I here only one client connection in 2011, not the latest

client:

http://games.sina.com.cn/z/three/download.shtml

Unzip the files here, the author is fatduck

http://gameresearch.haotui.com/thread-398-1-1.html

Translation of English, I'm sorry


Top
 Profile  
 
 Post subject: Re: Heaven of the three kingdoms
PostPosted: Tue Jun 24, 2014 9:37 am 
Offline
beginner

Joined: Thu May 01, 2014 2:12 pm
Posts: 20
Has thanked: 1 time
Have thanks: 0 time
Anyone can crack a model?


Top
 Profile  
 
 Post subject: Re: Heaven of the three kingdoms
PostPosted: Tue Jul 22, 2014 11:03 am 
Offline
mega-veteran
mega-veteran

Joined: Sun Apr 06, 2014 8:06 pm
Posts: 178
Has thanked: 216 times
Have thanks: 6 times
chrrox wrote:
Here is a max script to import these models I only tested it on this model I attached here so if it does not work on other models let me know.
Image

Max script save into a text document and give it the extension .ms
Code:
if (heapSize < 20000000) then
   heapSize = 40000000 -- allow ~ 40 MB instead of just 7.5 MB. Prevents "Runtime Error: Out of scripter memory"

fname = GetOpenFileName caption:"Open Clare3d Model File" types:"Clare3d Model File(*.c3m)|*.c3m"
f = fopen fname "rb"   --open file in read only format
p = getFilenamePath fname


fseek f 0x20 #seek_set
Count1 = readlong f
Null1 = readlong f
Count2 = readlong f
Null2 = readlong f
Null3 = readlong f
Null4 = readlong f
Count3 = readlong f
MeshNumber = readlong f
VertCount = readlong f
FaceCount = readlong f

fn readword fstream = (
return (readshort fstream #unsigned)
)
VertexOffset = ftell f
fseek f (0x20 * VertCount)#seek_cur
FaceOffset = ftell f
fseek f (0x2 * FaceCount)#seek_cur
TableOffset = ftell f

for aa = 1 to MeshNumber do (
Vert_array = #()    --define arrays for verts, normals, UV and Faces
Normal_array = #()
UV_array = #()
Face_array = #()
Mesh_array = #() 
fseek f TableOffset #seek_set
fseek f 0x44 #seek_cur
VertOffsetAdd = readlong f
FaceOffsetAdd = readlong f
VertCountAdd = readlong f
FaceCountAdd = readlong f
float1 = readfloat f
float2 = readfloat f
float3 = readfloat f
Null1 = readlong f
Null2 = readlong f
DiffuseTexture = readstring f
skipbytes = 0x20 - DiffuseTexture.count - 1
fseek f skipbytes #seek_cur
fseek f 0x20 #seek_cur
append Mesh_array VertOffsetAdd
append Mesh_array FaceOffsetAdd
append Mesh_array VertCountAdd
append Mesh_array FaceCountAdd
append Mesh_array DiffuseTexture
TableOffset = ftell f

fseek f ((Mesh_array[1] * 0x20) + VertexOffset)#seek_set
for i = 1 to Mesh_array[3] Do (
vx = readfloat f     --read xyz coordinates
vy = readfloat f
vz = readfloat f
append Vert_array [vx,vy,vz] --save verts to Vert_array
        --since UV in Max are in point3 format, so we add 0 for z value
nx = readlong f    --read Normal ??
ny = readlong f
nz = readlong f
append Normal_array [nx,ny,nz] --save normals to Normal_array
tu = readfloat f     --read UV float value
tv = (readfloat f) * -1
append UV_array [tu,tv,0]  --save UVs to UV_array
)
fseek f ((Mesh_array[2] * 0x2) + FaceOffset)#seek_set
for i = 1 to Mesh_array[4] / 3 Do (

f1 = (readword f) + 1   --read face indices, games are start form 0, but Max start from 1
f2 = (readword f) + 1   --so we add 1 to each index
f3 = (readword f) + 1
append Face_array [f1,f2,f3] --save faces to Face_array
)
msh = mesh vertices:Vert_array faces:Face_array
msh.numTVerts = UV_array.count
buildTVFaces msh
msh.material = meditMaterials[aa]
meditMaterials[aa].name = Mesh_array[5]
meditMaterials[aa].diffuseMap = Bitmaptexture fileName:(p + Mesh_array[5] + ".dds")
meditMaterials[aa].opacityMap = copy meditMaterials[aa].diffuseMap
meditMaterials[aa].diffuseMap.alphaSource = 2
meditMaterials[aa].opacityMap.monoOutput = 1
meditMaterials[aa].opacityMapEnable = on

for j = 1 to UV_array.count     do setTVert  msh j UV_array[j]
for j = 1 to Face_array.count   do setTVFace msh j Face_array[j]
for j = 1 to Normal_array.count do setNormal msh j Normal_array[j]
)
actionMan.executeAction 0 "40021"  -- Selection: Select All
modPanel.addModToSelection (Normalmodifier ()) ui:on
$Object01.modifiers[#Normal].flip = on
actionMan.executeAction 0 "311"  -- Tools: Zoom Extents All Selected
clearSelection()
actionMan.executeAction 0 "63508"  -- Views: Standard Display with Maps
fclose f     --close file

http://three.hanbiton.com/Home/Home.aspx
Hi chrrox, I have clients that do not fit the script, can you give a client download link, thanks


Top
 Profile  
 
 Post subject: Re: Heaven of the three kingdoms
PostPosted: Mon Dec 08, 2014 8:18 am 
Offline
mega-veteran
mega-veteran

Joined: Wed May 05, 2010 8:21 pm
Posts: 285
Location: Poland Głogów
Has thanked: 18 times
Have thanks: 560 times
Hi

Here is blender version of chrrox maxscript and support animation too.
It requires Blender version 249 and Python 26.

Steps:
1.unpack importer
2.run Blender249.blend
3.in Blender Text Window press alt+p and select gmd file
3.for animation select gam file

Game: viewtopic.php?p=95613#p95613


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: Heaven of the three kingdoms
PostPosted: Wed Dec 10, 2014 7:04 pm 
Offline
mega-veteran
mega-veteran

Joined: Sun Apr 06, 2014 8:06 pm
Posts: 178
Has thanked: 216 times
Have thanks: 6 times
Szkaradek123 wrote:
Hi

Here is blender version of chrrox maxscript and support animation too.
It requires Blender version 249 and Python 26.

Steps:
1.unpack importer
2.run Blender249.blend
3.in Blender Text Window press alt+p and select gmd file
3.for animation select gam file

Game: viewtopic.php?p=95613#p95613
Good news, thank you, Szkaradek123, the script is very good, we import model GMD files, but note that not all of the GMD is a model file, thanks again, Szkaradek123


Top
 Profile  
 
 Post subject: Re: Heaven of the three kingdoms
PostPosted: Thu Dec 11, 2014 1:55 am 
Offline
veteran

Joined: Mon Sep 22, 2014 1:23 am
Posts: 112
Has thanked: 49 times
Have thanks: 8 times
Here is the quickbms for the game, so you don't have to register on random chinese site:

Code:
# Game: 三国之天
# Package: pfs
# by Fatduck Jun 2014
# script for QuickBMS http://quickbms.aluigi.org

idstring "XGFILESYSTEM\0"

get RESEND asize
savepos RESPOS
do
goto RESPOS
get ukn0 long
get RESTYPE long
getdstring RESNAME 0x100
get CSIZE long
get USIZE long
get ukn00 long
get NEXTOFS long
get DATAFLAG long
savepos RESPOS
if DATAFLAG == 1
clog RESNAME RESPOS CSIZE USIZE
endif
math RESPOS += CSIZE
while RESPOS < RESEND


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: aoilysa, ispwest and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group