Game Development Community

How to change datablock value in game? (newbie)

by MARIA SALAZAR · in Technical Issues · 07/21/2008 (2:12 pm) · 5 replies

I have this datablock
datablock PlayerData(PlayerBody)
{
doubleJumpEnabled = false;


Is there any command to change doubleJumpEnabled to true ?

Thank you

#1
07/21/2008 (2:33 pm)
Datablocks are static and shared with all objects that use them so I would guess no. I could be wrong, however.

I would recommend changing a value on the player object itself rather than the datablock.
#2
07/21/2008 (3:01 pm)
Yeah, you can change it, but changing it would effect everybody using that datablock. I think you could just do PlayerBody.doubleJumpEnabled = true;

If you wanted to make it per-player, you would have to change that from being a datablock value to a Player value.
#3
07/22/2008 (1:17 am)
Thank you Ben and Nathan. Actually, I will use this datablock for my main character only. but for my knowledge
can you guide me how to do like what you suggest. I don't know how to change datablock value to a player value. Do I have to mod the engine?
#4
07/23/2008 (1:40 am)
I don't know whether it like this: %player.getDataBlock().doubleJumpEnabled = true;
#5
07/23/2008 (6:29 am)
Or it might be PlayerBody.doubleJumpEnabled = true; I'm not sure which is right here though.