FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Creating new instances programmatically

2 posters

Go down

Creating new instances programmatically Empty Creating new instances programmatically

Post  josgraha Sat Feb 07, 2009 11:13 pm

Hey sorry if this is a dumb question but i'm still a noob. I was wondering if there was a way to create instances of an object that's been exported in a sio2 scene at runtime. An example would be to create new billboards to simulate flying over an area or to create instances of an enemy mesh. This would be where the position of the enemy may be determined randomly instead of it's position in relation to the scene. Hope this makes sense.

josgraha

Posts : 19
Join date : 2008-12-09

Back to top Go down

Creating new instances programmatically Empty Re: Creating new instances programmatically

Post  sio2interactive Sat Feb 07, 2009 11:46 pm

It's already implemented, you can basically duplicate whatever you want including physic objects... the only exception is that you cannot duplicate soft bodies cuz they need to have their own proper vertices buffer in order to update the simulation.

You can find an example in tutorial06_1, where Im using a tripple tap to duplicate the current selected object.

Cheers,
sio2interactive
sio2interactive

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

http://sio2interactive.com

Back to top Go down

Creating new instances programmatically Empty Re: Creating new instances programmatically

Post  josgraha Sun Feb 08, 2009 12:41 am

Sorry I didn't mean in blender, I meant when the scene is running on the device. I know you have some naming convention thing to do trick SiO2 when creating instances inside Blender. I think what I am looking for is sio2ObjectDuplicate and maybe there is a Lua peer function. I was thinking (earlier today) that if I wanted to create a bunch of enemies I would need to clone them at runtime and add one 'master' enemy and spawn off a bunch of children when the scene is running based on game events. Adding objects in blender is kinda nice when you have a finite scene to think about but in the case of this game there could N number of enemies based on how far you have progressed through the game.

josgraha

Posts : 19
Join date : 2008-12-09

Back to top Go down

Creating new instances programmatically Empty Re: Creating new instances programmatically

Post  sio2interactive Sun Feb 08, 2009 12:47 am

Heuuuuuu ya man... sio2ObjectDuplicate is exactly what you are looking for... Check tutorial06_1 for more info...
sio2interactive
sio2interactive

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

http://sio2interactive.com

Back to top Go down

Creating new instances programmatically Empty Re: Creating new instances programmatically

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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