Problems with new type of PlayerData datablock
by Juan Lemus · in Torque 3D Professional · 04/13/2010 (11:04 am) · 0 replies
Hi guys! I’m having a problem implementing a new kind of PlayerData. The thing is I made some changes to player.h and player.cpp so that my main character could move and act like I wanted. The problem is that it’s messing the AI and now I want for the AI to behave like it did before I made the changes. I rename the original player code to player2.cpp and player2.h. I rename Player() and PlayerData() to Player2() and PlayerData2() and made the necessary changes so that AIplayer and AIClient inherit form player2.h. The problem is that my AI code is not spawning the AI player. I think it has to do with the AI player Datablock. If I use the original:
datablock PlayerData(DefaultPlayer : DefaultPlayerData)
It will not spawn the player and it will tell me that it can’t spawn obj null. But if I use:
datablock PlayerData2(DefaultPlayer : DefaultPlayerData)
T3D will completely crash. I’m implementing it this way:
IMPLEMENT_CO_DATABLOCK_V1(PlayerData2);
PlayerData2::PlayerData2()
{
…
}
Am I implementing correctly PlayerData2? Or what’s the correct way of implementing a new type of datablock so that my AI player can use the functions from Player2?
datablock PlayerData(DefaultPlayer : DefaultPlayerData)
It will not spawn the player and it will tell me that it can’t spawn obj null. But if I use:
datablock PlayerData2(DefaultPlayer : DefaultPlayerData)
T3D will completely crash. I’m implementing it this way:
IMPLEMENT_CO_DATABLOCK_V1(PlayerData2);
PlayerData2::PlayerData2()
{
…
}
Am I implementing correctly PlayerData2? Or what’s the correct way of implementing a new type of datablock so that my AI player can use the functions from Player2?
About the author
I am the chief of the team in Lion Works studio, in Guatemala , Central America.