The Forum is up for sale: XeNTaX Forum looking for new owner

Hot Wheels World Race NGC Script Help

Post questions about game models here, or help out others!
Post Reply
User avatar
reh
veteran
Posts: 101
Joined: Mon Nov 16, 2015 11:18 pm
Has thanked: 57 times
Been thanked: 91 times

Hot Wheels World Race NGC Script Help

Post by reh »

Hello, I hope you are well.
I spent time playing with this script, but I can't seem to get it to work. So the message that appears tells me that the buffer is not correct, but I don't know what to do.

Here is how the model is loaded with Hex2obj:
aeroflash_med.png
You do not have the required permissions to view the files attached to this post.
User avatar
reh
veteran
Posts: 101
Joined: Mon Nov 16, 2015 11:18 pm
Has thanked: 57 times
Been thanked: 91 times

Re: Hot Wheels World Race NGC Script Help

Post by reh »

Here is the script plus some sample files:
Script + rom .zip
Thank you for your help! :wink:
You do not have the required permissions to view the files attached to this post.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4231
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1139 times
Been thanked: 2222 times

Re: Hot Wheels World Race NGC Script Help

Post by shakotay2 »

Hello,
do a correction of one line only, DWORD FIs here, means 4 instead of 2 bytes:
FBuff = bs.readBytes(FCont*3*4)

btw: "FCont"? In english you'd better choose "FCount" or "FCnt" or "FaceCnt", just as a thought. :)
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
reh
veteran
Posts: 101
Joined: Mon Nov 16, 2015 11:18 pm
Has thanked: 57 times
Been thanked: 91 times

Re: Hot Wheels World Race NGC Script Help

Post by reh »

Thank you very much :D , now the script loads the templates, I still need to edit it to load the second mesh, the way I did until it loads the second mesh, but stops loading files that have only one mesh.
shakotay2 wrote: Wed Jul 01, 2020 9:29 am btw: "FCont"? In english you'd better choose "FCount" or "FCnt" or "FaceCnt", just as a thought. :)
Thanks for the tip, I will make changes to the script and then post it here.
Karpati
ultra-veteran
ultra-veteran
Posts: 460
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 9 times
Been thanked: 94 times

Re: Hot Wheels World Race NGC Script Help

Post by Karpati »

reh wrote: Wed Jul 01, 2020 5:06 am Here is the script plus some sample files:
Script + rom .zip
Can you tell me how did you extract the .bah/bad archive files?

Here I attached the converted file in Wavefront .obj format.
You do not have the required permissions to view the files attached to this post.
User avatar
reh
veteran
Posts: 101
Joined: Mon Nov 16, 2015 11:18 pm
Has thanked: 57 times
Been thanked: 91 times

Re: Hot Wheels World Race NGC Script Help

Post by reh »

Karpati wrote: Sat Jul 04, 2020 11:52 am Can you tell me how did you extract the .bah/bad archive files?
I extracted the files with the script found here.

Here is the script for the templates, so far with the files I tested it worked fine.
fmt_HotWheelsWorldRace_rom_shm_NGC.zip
You do not have the required permissions to view the files attached to this post.
User avatar
reh
veteran
Posts: 101
Joined: Mon Nov 16, 2015 11:18 pm
Has thanked: 57 times
Been thanked: 91 times

Re: Hot Wheels World Race NGC Script Help

Post by reh »

Now, my question is how to get the textures? In the link where I found the scripts to extract, they say they are dds files, but the best thing I can do when trying to extract with Texturefinder was the following:
You do not have the required permissions to view the files attached to this post.
User avatar
reh
veteran
Posts: 101
Joined: Mon Nov 16, 2015 11:18 pm
Has thanked: 57 times
Been thanked: 91 times

Re: Hot Wheels World Race NGC Script Help

Post by reh »

If anyone wants to help :) , I'll post some samples here.
Karpati
ultra-veteran
ultra-veteran
Posts: 460
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 9 times
Been thanked: 94 times

Re: Hot Wheels World Race NGC Script Help

Post by Karpati »

I have finished my Hot Wheels: World Race .rom loader module and I have released the following program as web updates:

- 3D Object Converter v7.034 (Windows)

How to get the 3D Object Converter:
Download the 3D Object Converter from http://3doc.i3dconverter.com and install it or download and use the portable version.
After it just use the Help/Check for updates... function to get the v7.034.
User avatar
reh
veteran
Posts: 101
Joined: Mon Nov 16, 2015 11:18 pm
Has thanked: 57 times
Been thanked: 91 times

Re: Hot Wheels World Race NGC Script Help

Post by reh »

I was trying to add the material name, with this code:

Code: Select all

MaterialNames = (bs.readBytes(16).decode("ASCII").rstrip("....ÿÿÿÿ"))
My intention was to ignore the "....ÿÿÿÿ" that appeared after the name, but I am getting this error:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 8: ordinal not in range(128)

How should I ignore these characters?
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4231
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1139 times
Been thanked: 2222 times

Re: Hot Wheels World Race NGC Script Help

Post by shakotay2 »

Without showing the hex bytes you're reading no one can tell.
I assume the problem might be the "..." - rstrip() doesn't use them as wildcards, does it?
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
reh
veteran
Posts: 101
Joined: Mon Nov 16, 2015 11:18 pm
Has thanked: 57 times
Been thanked: 91 times

Re: Hot Wheels World Race NGC Script Help

Post by reh »

shakotay2 wrote: Thu Jul 16, 2020 8:40 am Without showing the hex bytes you're reading no one can tell.
I assume the problem might be the "..." - rstrip() doesn't use them as wildcards, does it?
Would these be:
somethin_med.png
You do not have the required permissions to view the files attached to this post.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4231
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1139 times
Been thanked: 2222 times

Re: Hot Wheels World Race NGC Script Help

Post by shakotay2 »

well, you simply need a function which reads zero-terminated strings, don't you?
Seems you need to create it for yourself - found a base in fmt_Torchlight_mesh.py,
modified:

Code: Select all

def ReadStringZeroT(bs):
	name = b''
	b = bs.readBytes(1)
	while b != b'\x00':
		name+=b
		b = bs.readBytes(1)
	return noeStrFromBytes(name)
use it like so before your for i in range(1): loop

Code: Select all

	bs.seek(0x48)
	print(ReadStringZeroT(bs))
(btw: for some unknown reason while b != 0: doesn't work, why?)
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Acewell
VIP member
VIP member
Posts: 1330
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2710 times
Been thanked: 883 times

Re: Hot Wheels World Race NGC Script Help

Post by Acewell »

Code: Select all

MaterialNames = bs.readString()
should suffice. :D
User avatar
reh
veteran
Posts: 101
Joined: Mon Nov 16, 2015 11:18 pm
Has thanked: 57 times
Been thanked: 91 times

Re: Hot Wheels World Race NGC Script Help

Post by reh »

Thank you very much, I will test these tips :wink:

Edit: The first code that Shakotay posted until it works, but if the model has more than one material, how would I do it?
I tried to put it in a loop, but it didn't work.

How would I use this code?
Acewell wrote: Fri Jul 17, 2020 12:35 am

Code: Select all

MaterialNames = bs.readString()
Post Reply