user defined data

View previous topic View next topic Go down

user defined data

Post  spoboyle on Thu Jun 18, 2009 9:52 am

hi guys

i want to be able to add my own data to objects within blender, export them and then load/parse them within the sio2 engine. apparently tutorial 9 contains these details but i have been through it thoroughly and can't find anything. is it there and i am just very tired and need to try again tomorrow or was it left out for some reason? if so can someone possibly give me a place to start looking into it myself

thanks

spoboyle

Posts : 12
Join date : 2009-04-08
Age : 36
Location : manchester, uk

View user profile

Back to top Go down

Re: user defined data

Post  uprise78 on Thu Jun 18, 2009 12:11 pm

User defined variables go in the Logic panel. Just click Add Property.

uprise78

Posts : 228
Join date : 2008-10-31

View user profile

Back to top Go down

Re: user defined data

Post  sio2interactive on Thu Jun 18, 2009 10:20 pm

and check tutorial09 to see how you can retrieve them back...

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: user defined data

Post  spoboyle on Tue Jun 23, 2009 4:51 am

I have been through tutorial 9 and managed to make a start. Within the custom_parser i use the void pointer 'userdata' to store a user defined property to be used later. this works fine.

unsigned char custom_parser( char *_root, char *_tok, char *_val )
{
....
float *temp;
sio2StringScanf( _val, "%f", temp);
sio2->_SIO2object->userdata = temp;
....
}

however when i come to read this value out of 'userdata' later on the value has changed is no longer correct.

am i right in thinking 'userdata' can be used in this way ? or does anyone have any ideas what is causing the value of 'userdata' to change?

spoboyle

Posts : 12
Join date : 2009-04-08
Age : 36
Location : manchester, uk

View user profile

Back to top Go down

Re: user defined data

Post  sio2interactive on Tue Jun 23, 2009 8:30 am

Yes but the way you are using the float * is innacurate since it's an uninitiized local variable and will be probably replaced by the memory manager which would explain the change of value...

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 37
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: user defined data

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum