Home Gallery Resources The Team Rules chat Login Register
Poll
Question: 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

Pages:  1 [2] 3
Author Topic: blender mdl0 importer (reboot)  (Read 17521 times)
0 Members and 1 Guest are viewing this topic.
DarkPikachu
Angel Kitten
***
Offline Offline

Posts: 3069


complexity == fun

  • Awards Super Saiyan Topic Heart Container KCMM Veteran Tutorial Writer

  • View Profile Awards
    « Reply #15 on: January 10, 2012, 02:19:50 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 >_>

    Quote
    And 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)


    Quote
    Also, 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...
    Logged


    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.

    Xiggah
    Supreme Kitten
    ********
    Offline Offline

    Posts: 648

  • Awards Super Saiyan Topic Heart Container

  • View Profile WWW Awards
    « Reply #16 on: January 10, 2012, 02:49:36 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?
    Logged


    DarkPikachu
    Angel Kitten
    ***
    Offline Offline

    Posts: 3069


    complexity == fun

  • Awards Super Saiyan Topic Heart Container KCMM Veteran Tutorial Writer

  • View Profile Awards
    « Reply #17 on: January 10, 2012, 03:43:32 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

    Quote
    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 think I understand,
    but most of this still goes over my head >_>

    I take it the "Entry" is the 'FFFF' GID??
    Quote
    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?
    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 Smiley

    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
    Logged


    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.

    TheShyGuy
    Holy Kitten
    *
    Offline Offline

    Posts: 1003


  • Awards Super Saiyan Topic KCMM Veteran Heart Container Dedicated Hacker

  • View Profile Awards
    « Reply #18 on: January 10, 2012, 04: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.
    Logged

    Xiggah
    Supreme Kitten
    ********
    Offline Offline

    Posts: 648

  • Awards Super Saiyan Topic Heart Container

  • View Profile WWW Awards
    « Reply #19 on: January 10, 2012, 04:45:45 PM »


    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].
    Logged


    DarkPikachu
    Angel Kitten
    ***
    Offline Offline

    Posts: 3069


    complexity == fun

  • Awards Super Saiyan Topic Heart Container KCMM Veteran Tutorial Writer

  • View Profile Awards
    « Reply #20 on: January 10, 2012, 04:50:25 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??
    « Last Edit: January 10, 2012, 05:01:54 PM by Tcll » Logged


    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.

    DarkPikachu
    Angel Kitten
    ***
    Offline Offline

    Posts: 3069


    complexity == fun

  • Awards Super Saiyan Topic Heart Container KCMM Veteran Tutorial Writer

  • View Profile Awards
    « Reply #21 on: January 10, 2012, 05:08:52 PM »


    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 Tongue
    Logged


    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.

    BlackJax96
    Brawl Mod God
    Moderator
    ****
    Offline Offline

    Posts: 4612


  • Awards KCMM Veteran Sniper King for a Day Featured

  • View Profile Awards
    « Reply #22 on: January 10, 2012, 05:38:32 PM »


    Was I called?

    Think of * as like a reference to an offset in a hex editor.
    Let's say you have

    struct Data
    {
       int whatever1;
       int whatever2;
    }

    Data* exampleVar;

    Think of * as like an array (Data[]) but with no absolute end.
    The size of the Data struct is 8 bytes (two 4-byte ints. Int is a struct of 4 bytes), so when you use "exampleVar++" then the offset will progress 8 bytes forward.

    If you want to assign "exampleVar" to a variable that isn't a pointer, you need to say
    Data exampleVar2 = *exampleVar;

    because exampleVar is simply an offset, not an actual variable. Adding * changes it into a variable.

    You can also read the current value and progress forward afterwards with *exampleVar++;

    If you want to assign a value within exampleVar, you need to use "exampleVar->whatever1" because you're assigning directly into the memory with a pointer.

    Now let's say you have
    Data exampleVar3;

    In order to set the variables inside exampleVar3, you can just use "exampleVar3.whatever1" because it's not being accessed through a pointer.

    But what if you're using a loop?
    int[] variables = new int[2];
    for (int i = 0; i < 2; i++)
    {
       if (i == 0)
          variables[i ] = exampleVar3.whatever1;
       else
          variables[i ] = exampleVar3.whatever2;
    }

    It works, but it's not as efficient as
    int[] variables = new int[2];
    for (int i = 0; i < 2; i++)
    {
       variables[i ] = ((int*)&exampleVar3)[i ];
    }

    Which does the exact same thing. (I put a space in [i ] or else it made the text italic lol)

    &exampleVar3 is the "offset" of exampleVar3 in the memory.
    (int*) changes that offset into an "array" of 4-byte integer values.
    [i ] is the indexer that accesses the integers in that array in memory (it progresses every 4 bytes, the size of int).

    If you already have Data* exampleVar, then you can use the indexer without getting the address.
    exampleVar[i ]
    « Last Edit: January 10, 2012, 05:52:25 PM by BlackJax96 » Logged

    Xiggah
    Supreme Kitten
    ********
    Offline Offline

    Posts: 648

  • Awards Super Saiyan Topic Heart Container

  • View Profile WWW Awards
    « Reply #23 on: January 10, 2012, 05:49:29 PM »


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


    DarkPikachu
    Angel Kitten
    ***
    Offline Offline

    Posts: 3069


    complexity == fun

  • Awards Super Saiyan Topic Heart Container KCMM Veteran Tutorial Writer

  • View Profile Awards
    « Reply #24 on: January 10, 2012, 06:20:32 PM »


    thanx BJ Smiley

    this'll help a bit Tongue

    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
    « Last Edit: January 10, 2012, 06:53:00 PM by Tcll » Logged


    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.

    DarkPikachu
    Angel Kitten
    ***
    Offline Offline

    Posts: 3069


    complexity == fun

  • Awards Super Saiyan Topic Heart Container KCMM Veteran Tutorial Writer

  • View Profile Awards
    « Reply #25 on: January 11, 2012, 05:52:02 AM »


    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) Tongue


    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)
    Logged


    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.

    Xiggah
    Supreme Kitten
    ********
    Offline Offline

    Posts: 648

  • Awards Super Saiyan Topic Heart Container

  • View Profile WWW Awards
    « Reply #26 on: January 11, 2012, 03: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.
    Logged


    DarkPikachu
    Angel Kitten
    ***
    Offline Offline

    Posts: 3069


    complexity == fun

  • Awards Super Saiyan Topic Heart Container KCMM Veteran Tutorial Writer

  • View Profile Awards
    « Reply #27 on: January 11, 2012, 04:08:23 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) -.-*
    Logged


    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.

    Xiggah
    Supreme Kitten
    ********
    Offline Offline

    Posts: 648

  • Awards Super Saiyan Topic Heart Container

  • View Profile WWW Awards
    « Reply #28 on: January 11, 2012, 05:19:17 PM »


    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.
    Logged


    DarkPikachu
    Angel Kitten
    ***
    Offline Offline

    Posts: 3069


    complexity == fun

  • Awards Super Saiyan Topic Heart Container KCMM Veteran Tutorial Writer

  • View Profile Awards
    « Reply #29 on: January 11, 2012, 05:37:56 PM »


    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... Tongue
    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) Tongue

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

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


    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.

    Pages:  1 [2] 3
    Print
    Jump to: