Need an export script

Post questions about game models here, or help out others!
Post Reply
Ronny
ultra-n00b
Posts: 8
Joined: Fri Jun 09, 2017 3:33 pm
Has thanked: 3 times

Need an export script

Post by Ronny » Sat Jun 10, 2017 8:09 am

Hello I am a newbie

I am very much fond of playing pc games.I do play a game kings bounty crossworlds,From these game i want an Import and Export maxscript for 3dsmax,To import models from Kings Bounty Crossworlds as well as export my Models in Kings Bounty model format.Here is a link of the sample files.

http://www108.zippyshare.com/v/QPFmeSyO/file.html

User avatar
Acewell
VIP member
VIP member
Posts: 1328
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2683 times
Been thanked: 844 times

Kings Bounty Crossworlds

Post by Acewell » Sat Jun 10, 2017 9:20 am

well there is import for *.bma models in "3d Object Converter" but it is shareware :]
http://zenhax.com/viewtopic.php?p=21690#p21690

i think it will be difficult to find someone to write a model import & export script for any 3d program

you can use Hex2obj for free :D
cyclop.bma
cyclop_bma.png
You do not have the required permissions to view the files attached to this post.

Ronny
ultra-n00b
Posts: 8
Joined: Fri Jun 09, 2017 3:33 pm
Has thanked: 3 times

Re: Need an export script

Post by Ronny » Sat Jun 10, 2017 9:47 am

I have found a video where anyone can create a Python Script for noesis but it requires a lot of hex editing.For creating the python script the correct offsets of the vertex count,Face Count,Triangle buffer and Vert buffer are required,But the problem is i have no knowledge about hex editor or hex editing.

Here is the vide: https://www.youtube.com/watch?v=DaUpvM5Rv_Y&t=3355s

Ronny
ultra-n00b
Posts: 8
Joined: Fri Jun 09, 2017 3:33 pm
Has thanked: 3 times

Re: Need an export script

Post by Ronny » Sat Jun 10, 2017 12:26 pm

Please anyone mark the offsets of the vertex count,Face Count,Vert Buffer and Triangle Buffer within the model file in a hex editor and send me The screenshots of the marked ones so that it would be easy enough for me.

User avatar
Acewell
VIP member
VIP member
Posts: 1328
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2683 times
Been thanked: 844 times

Kings Bounty Crossworlds

Post by Acewell » Sun Jun 11, 2017 2:52 am

what model file? the offsets and counts for the sample i posted before are clearly shown in the image. :)
it wouldn't be practical for anyone to feed you offsets and counts because they change from one model to the next.
you are on a good way by that tutorial video link and will learn this stuff in no time, make mariokart64n proud! :D

mariokart64n
ultra-veteran
ultra-veteran
Posts: 567
Joined: Sun Jun 05, 2005 12:00 pm
Location: Ontario, Canada
Has thanked: 34 times
Been thanked: 204 times

Re: Need an export script

Post by mariokart64n » Sun Jun 11, 2017 4:13 pm

I looked at the format and I would have to say this is a good format for someone that wanted to learn all this stuff

Anyway I did a mockup maxscript here:

Code: Select all

/* ----------------------------------------------------------
	MAXSCRIPT
		Description:
			Mockup import script to import kings bounty crossworlds bma
			models.
		Written:
			mariokart64n (June 11, 2017)
		
		Notes:
			format is seems to work by stacking blocks, each block has a
			4 byte id code to identify what the block is. the maxscript was
			only written to debug some structure ideas when picking apart
			the file format. it is not written to properly read the way the
			blocks are dynamically presented. So this scripted worked
			on the few samples I was provided, but most likely will not work
			on the entire game and its files.
			
			Blocks need to be better documented before a export feature
			can be considered. The good news is that in the samples I had
			there was probably around 8 blocks, so thats not too bad ;)

*/ ----------------------------------------------------------
clearlistener()

-- f  = fopen "L:\\kings bounty crossworlds resources\\models\\elf.bma" "rb"
-- f  = fopen "L:\\kings bounty crossworlds resources\\models\\druid.bma" "rb"
f = fopen (GetOpenFileName caption:"Select any File" types: "bma files (*.bma)|*.bma|All files (*.*)|*.*|") "rb"

fn readstringbylen f = (
	str_len = readlong f #unsigned
	str = ""
	for ii = 1 to str_len do (str+=bit.IntAsChar(readbyte f #unsigned))
	str
	)

fseek f 11 #seek_set -- 41140000
if readbyte f == 32 then (
	fseek f 8 #seek_cur
	)
else (
	fseek f 4 #seek_cur
	)
bone_count = readlong f #unsigned

for i = 1 to bone_count do (
	print (readstringbylen f)
	fseek f 113 #seek_cur
	)
if readlong f #unsigned == 0x0005535B then (
	mat_count = readlong f #unsigned
	for i = 1 to mat_count do (
		format "Mat Name: %\n" (readstringbylen f)
		fseek f 0x3E #seek_cur
		str_len = 0
		while str_len < 256 do (
			str_len = readlong f #unsigned
			if str_len < 256 do (
				fseek f -4 #seek_cur
				format "\tProp: %\n" (readstringbylen f) -- type
				readbyte f #unsigned -- 0
				case (readbyte f #unsigned) of ( -- type
					2:(fseek f 3 #seek_cur;readfloat f)
					4:(fseek f 19 #seek_cur)
					5:(fseek f 83 #seek_cur)
					6:(fseek f 3 #seek_cur;format "\t\tTex Name: %\n"  (readstringbylen f);readbyte f) -- tex name
					)
				)
			)
		if str_len == 0x02238ECB then (
			format "MeshInfo @ 0x%\n" (bit.IntAsHex((ftell f-4) as integer))
			table_count = readlong f #unsigned
			fseek f (36*table_count) #seek_cur
			)
		else (
			print "mesh table block not here?"
			)
		vertArray = #()
		faceArray = #()
		if readlong f #unsigned == 0x01119C6B then (
			format "Vertices @ 0x%\n" (bit.IntAsHex((ftell f-4) as integer))
			vertex_count = readlong f #unsigned
			for i = 1 to vertex_count do (
				append vertArray [(readshort f)/327.675, (readshort f)/327.675, (readshort f)/327.675]
				vertArray[vertArray.count] = [vertArray[vertArray.count][1],vertArray[vertArray.count][3],vertArray[vertArray.count][2]]
				fseek f 18 #seek_cur
				)
			)
		else (
			print "vertex buffer not here?"
			)
		if readlong f #unsigned == 0x000141FB then (
			format "Faces @ 0x%\n" (bit.IntAsHex((ftell f-4) as integer))
			face_count = readlong f #unsigned
			for i = 1 to face_count/3 do (
				append faceArray ([readshort f, readshort f, readshort f]+1)
				)
			delete $*
			msh = mesh vertices:vertArray faces:faceArray
			)
		else (
			print "face buffer not here?"
			)
		)
	)
else (
	print "found different block after bones"
	)

format "Current Address @ 0x%\n" (bit.IntAsHex((ftell f) as integer))
fclose f
Maxscript and other finished work I've done can be found on my DeviantArt account

Ronny
ultra-n00b
Posts: 8
Joined: Fri Jun 09, 2017 3:33 pm
Has thanked: 3 times

Re: Need an export script

Post by Ronny » Sun Jun 11, 2017 5:49 pm

Thanks for your kind help mariokart,But in This topic i also need an export script to Export my models in Kings Bounty Crossworlds .bma format.

Ronny
ultra-n00b
Posts: 8
Joined: Fri Jun 09, 2017 3:33 pm
Has thanked: 3 times

Re: Need an export script

Post by Ronny » Mon Jun 12, 2017 2:02 pm

Please provide me a noesis python script so that i can import as well as export models from Kings Bounty.

Post Reply