Game Development Community

Datablock manipulation

by Jyan Smithy · in Technical Issues · 07/29/2006 (6:38 pm) · 4 replies

Hey. I've been trying to figure out for a few weeks now how to manipulate my PlayerBody datablock. I want to make it so that each player's speed is different than each others. In reading some things it sounded like the datablocks were just templates and anything made from them just made copies and I could manipulate those copies individualy. But reading other things it just seems like all the objects created with the datablock share it and any changes the datablock recieves.

Is there a way to manipulate runForce from the PlayerBody datablock for individual players? Or do I have to rebuild them differently outside a datablock? If I have to change it then how would I start doing that?

Any help would be greatly appreciated, thanks in advance =)

#1
07/29/2006 (7:32 pm)
I think what you might need to do is something like this:

new PlayerBody(individualDatablock: abstractDatablock) {
  ...
};

I think that's the correct order to specify inheritence, but it might be backwards.
#2
07/29/2006 (7:38 pm)
So that will create a new playerbody using a copy of the exisiting datablock and let me change them all individually?
#3
07/30/2006 (10:11 am)
Should do, yeah. Give it a try and see if it works for you.
#4
08/01/2006 (1:38 pm)
Ok thanks =) I'll try to play with that.