blender mdl0 importer (reboot)

Started by DarkPikachu, January 08, 2012, 07:20:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

should I start up on my mdl0 importer again??

YES! it would really help out!
no thanx, I'm good with 3DS
eh... I don't really care
Quote from: Xiggah on January 10, 2012, 08:57:34 PM
I'm surprised you know the Brawlbox source code structure but not how to read it.
there's only a handful of things I don't understand with C-types

the main one being pointers >_>

QuoteAnd yes, it looks like it records the ID and the previous and next values. 
yes, but how is it used??
(that's exactly where I'm confused)


QuoteAlso, what if the error is in your python coding?
do you mean my coding style or what I've coded??

the way I've been doing it is using a FOR and keeping an index of everything...

[spoiler]Quote: Friedslick6
you have been through a lot of hassle. I've watched every topic you posted on this, and most of them seemed to disintegrate gradually.
But the coolest part was that you didn't stop working on it despite that.

Quote: Internet Explorer
you're doing more with your life right now than probably most other people around you. You're a valuable asset to the Smash community. So yeah, you should be proud.

quote: Greg
You do have a gift which I've seen many developers use to their advantage. You can become a great coder, and with all of those ideas I think you can really build something great.

Quote from: Tcll on January 10, 2012, 09:19:50 PM
there's only a handful of things I don't understand with C-types

the main one being pointers >_>
yes, but how is it used??
(that's exactly where I'm confused)

do you mean my coding style or what I've coded??

the way I've been doing it is using a FOR and keeping an index of everything...

I need to learn these definitions if I want to help program Brawlbox.... by pointers, do you mean the "pointing to the right offset"?

As for how their used, I think that would be best for BJ to explain. I can guess, but my guess isn't any better than BlackJax's explanation. Previous and Entry seem to be used for building the index, while current is used for the if/then arguements.

I meant your coding: We often overlook simple programming errors and look elsewhere for the answer. Perhaps your supposed to detect the loop back and stop, and the rest of your program is still fine?

Quote from: Xiggah on January 10, 2012, 09:49:36 PM
I need to learn these definitions if I want to help program Brawlbox.... by pointers, do you mean the "pointing to the right offset"?

IDK...
all I know is they're called pointers

a pointer (for what I know) is somewhat like a var...

List = *group
or
if List -> group

* is the pointer definition (I think)
and -> means 'points to'

again... all C-type codes confuse me DX

QuoteAs for how their used, I think that would be best for BJ to explain. I can guess, but my guess isn't any better than BlackJax's explanation. Previous and Entry seem to be used for building the index, while current is used for the if/then arguements.
I think I understand,
but most of this still goes over my head >_>

I take it the "Entry" is the 'FFFF' GID??
QuoteI meant your coding: We often overlook simple programming errors and look elsewhere for the answer. Perhaps your supposed to detect the loop back and stop, and the rest of your program is still fine?
oh...
I havn't started programming yet XDD

I'm asking just to make sure I can get it right,
instead of having to do it, and then go back and change it like I do with my other 2 things >_>

no there's no errors...
just immature code...
that's all :)

and I think I get what you mean...
instead of the index being:
1
2
3
4
(like how I'm currently reading it)

the right way is:
1
3
4
2

[spoiler]Quote: Friedslick6
you have been through a lot of hassle. I've watched every topic you posted on this, and most of them seemed to disintegrate gradually.
But the coolest part was that you didn't stop working on it despite that.

Quote: Internet Explorer
you're doing more with your life right now than probably most other people around you. You're a valuable asset to the Smash community. So yeah, you should be proud.

quote: Greg
You do have a gift which I've seen many developers use to their advantage. You can become a great coder, and with all of those ideas I think you can really build something great.

i know a little bit about the bone tree of mdl0s but i can help if you need. Im not sure 100% about what your talking about when you say that you run into an improper loop of bones.

Also, pointers just point to the same data in memory. The only way to have multiple reference of a value is to have pointers(im not 100% since i dont usually use pointers). So :

int val_1 = 5;
int val_2 = val_1;//val_2 == 5

val_2 = 2;
//val_1's value is still 5, val_2's value is 2;

int val_1 = 5;
int* val_2 = val_1;// not sure if its : int*val_2 = &val_1, but thats not really the point
val_2 = 10;

//val_1 also is 10 now. Since val_2 points to the same value in memory as val_1. Simply doing val_2 = val_1 will just copy val_1's value, but not the same place in memory.

Im on mobile, so no looking at code for me. The pointer data youre talking about points to the index array. In terms of python coding, instead of previous->array, you might use array[previous].

January 10, 2012, 11:50:25 PM #20 Last Edit: January 11, 2012, 12:01:54 AM by Tcll
Quote from: TheShyGuy on January 10, 2012, 11:10:35 PM
i know a little bit about the bone tree of mdl0s but i can help if you need. Im not sure 100% about what your talking about when you say that you run into an improper loop of bones.

Also, pointers just point to the same data in memory. The only way to have multiple reference of a value is to have pointers(im not 100% since i dont usually use pointers). So :

int val_1 = 5;
int val_2 = val_1;//val_2 == 5

val_2 = 2;
//val_1's value is still 5, val_2's value is 2;

int val_1 = 5;
int* val_2 = val_1;// not sure if its : int*val_2 = &val_1, but thats not really the point
val_2 = 10;

//val_1 also is 10 now. Since val_2 points to the same value in memory as val_1. Simply doing val_2 = val_1 will just copy val_1's value, but not the same place in memory.

hmm, so it's basically the same as:

val3 = 10
val1,val2 = [val3]*2 #[val3,val3]

and about the bone thing...

take a look at Pika's resource group for bones >_>
and just try to follow the prev and next ID's,

tell me what happens when you get to the first GID group of '04'
just try not to get lost XDD

and KK, I'll try that...

EDIT:
wait...
use the previous as an array index??

I thought 'previous' was an array >_>

w/e...
what I'm learning now bamf's my test code...

back to the drawing board for me DX


if I was to paste bits of the code here,
could I get some help on converting it??

[spoiler]Quote: Friedslick6
you have been through a lot of hassle. I've watched every topic you posted on this, and most of them seemed to disintegrate gradually.
But the coolest part was that you didn't stop working on it despite that.

Quote: Internet Explorer
you're doing more with your life right now than probably most other people around you. You're a valuable asset to the Smash community. So yeah, you should be proud.

quote: Greg
You do have a gift which I've seen many developers use to their advantage. You can become a great coder, and with all of those ideas I think you can really build something great.

hey TSG...

int *val2 = &val1

that would make sense
(basically you're saying int(val2 and val1) so when val2 is set, val1 also gets set)

that would be incorrect in python terms but of course...

you underment what I stood :P

[spoiler]Quote: Friedslick6
you have been through a lot of hassle. I've watched every topic you posted on this, and most of them seemed to disintegrate gradually.
But the coolest part was that you didn't stop working on it despite that.

Quote: Internet Explorer
you're doing more with your life right now than probably most other people around you. You're a valuable asset to the Smash community. So yeah, you should be proud.

quote: Greg
You do have a gift which I've seen many developers use to their advantage. You can become a great coder, and with all of those ideas I think you can really build something great.

January 11, 2012, 12:38:32 AM #22 Last Edit: January 11, 2012, 12:52:25 AM by BlackJax96
Was I called?

Sorry but you are not allowed to view spoiler contents.

In short.... it just says which byte to look at to decipher.

January 11, 2012, 01:20:32 AM #24 Last Edit: January 11, 2012, 01:53:00 AM by Tcll
thanx BJ :)

this'll help a bit :P

I'll get a better look at it tomorrow

EDIT:
lol
I feel exactly like I did when Pharrox was trying to teach me about the links XDD

[spoiler]Quote: Friedslick6
you have been through a lot of hassle. I've watched every topic you posted on this, and most of them seemed to disintegrate gradually.
But the coolest part was that you didn't stop working on it despite that.

Quote: Internet Explorer
you're doing more with your life right now than probably most other people around you. You're a valuable asset to the Smash community. So yeah, you should be proud.

quote: Greg
You do have a gift which I've seen many developers use to their advantage. You can become a great coder, and with all of those ideas I think you can really build something great.

KK...
so I know of a few tricks now with that,
but mind if I ask for small code conversions here and there??

or more like, just explain what it does... >_>
(not conversions) :P


all I need right now is 1 line:
ResourceEntry* list = &group->_first

is there a simpler way to write that??
(not sure what does what first with this way of being written)

[spoiler]Quote: Friedslick6
you have been through a lot of hassle. I've watched every topic you posted on this, and most of them seemed to disintegrate gradually.
But the coolest part was that you didn't stop working on it despite that.

Quote: Internet Explorer
you're doing more with your life right now than probably most other people around you. You're a valuable asset to the Smash community. So yeah, you should be proud.

quote: Greg
You do have a gift which I've seen many developers use to their advantage. You can become a great coder, and with all of those ideas I think you can really build something great.

I forgot to say that I can convert code well, as long as it can be explained. Now if I'm reading BJ's code snippet correctly, ResourceEntry* list = &group->_first looks like a basic array setup. ResourceEntry list is an array/list with an offset pointing towards group, and the value of group is the value of _first.

Quote from: Xiggah on January 11, 2012, 10:49:21 PM
I forgot to say that I can convert code well, as long as it can be explained. Now if I'm reading BJ's code snippet correctly, ResourceEntry* list = &group->_first looks like a basic array setup. ResourceEntry list is an array/list with an offset pointing towards group, and the value of group is the value of _first.
UUGH I hate not being able to copy/paste
(really wish I had a laptop) >_<

anyways...
look at 'struct ResourceGroup' in Brlib/SSBB/Types/common.cs

sry I took so long to reply...
was looking at YT vids for matrix inversion without a determinant
(it can only be a square matrix sadly) -.-*

[spoiler]Quote: Friedslick6
you have been through a lot of hassle. I've watched every topic you posted on this, and most of them seemed to disintegrate gradually.
But the coolest part was that you didn't stop working on it despite that.

Quote: Internet Explorer
you're doing more with your life right now than probably most other people around you. You're a valuable asset to the Smash community. So yeah, you should be proud.

quote: Greg
You do have a gift which I've seen many developers use to their advantage. You can become a great coder, and with all of those ideas I think you can really build something great.

You mean this...?

public ResourceEntry* First { get { return (ResourceEntry*)(Address + 0x18); } }

It looks like First is an array containing the value of Address (Void Array of an offset pointing to THIS?) and 0x18. I can't tell if I read the whole code properly.

Quote from: Xiggah on January 12, 2012, 12:19:17 AM
You mean this...?

public ResourceEntry* First { get { return (ResourceEntry*)(Address + 0x18); } }

It looks like First is an array containing the value of Address (Void Array of an offset pointing to THIS?) and 0x18. I can't tell if I read the whole code properly.
oh IK what that does... :P
it gets the list values while skipping the resource group header (0x08) and the null offset (0x10)
(had it explained to me once or twice) :P

I'm still confused as to how it works though XDD

>_>
<_<
I've prbly got that wrong don't I??

[spoiler]Quote: Friedslick6
you have been through a lot of hassle. I've watched every topic you posted on this, and most of them seemed to disintegrate gradually.
But the coolest part was that you didn't stop working on it despite that.

Quote: Internet Explorer
you're doing more with your life right now than probably most other people around you. You're a valuable asset to the Smash community. So yeah, you should be proud.

quote: Greg
You do have a gift which I've seen many developers use to their advantage. You can become a great coder, and with all of those ideas I think you can really build something great.