|
|
« 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 >_>
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)
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
|
|
|
|
|
|
|
« 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
|
|
|
|
|
|
|
« 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
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??
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
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
|
|
|
|
|
|
|
« 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
|
|
|
|
|
|
|
« 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
|
|
|
|
|
|
|
« 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
|
|
|
|
|
|
|
|
« Reply #22 on: January 10, 2012, 05:38:32 PM » |
|
|
|
« Last Edit: January 10, 2012, 05:52:25 PM by BlackJax96 »
|
Logged
|
|
|
|
|
|
|
« Reply #23 on: January 10, 2012, 05:49:29 PM » |
|
In short.... it just says which byte to look at to decipher.
|
|
|
Logged
|
|
|
|
|
|
|
|
|
« 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
|
|
|
|
|
|
|
« 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
|
|
|
|
|
|
|
« 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
|
|
|
|
|
|
|