Game Development Community

Desperate help needed with variables

by Tom · in Torque Game Engine · 09/03/2006 (9:43 am) · 4 replies

I have added a variable called neControlMovement in PlayerData::PlayerData(), i also added it everywhere else i needed it to be in player.cc and player.h

now in gameConnectionMove.cc, i need this value because depending on what it is set to, (true or false) the movement is different for each case.

i included the player.h file, but i get an undeclared identifier in my gameConnectionMove.cc file whereever i have:

if(newControlMovement)
   {

how can i do it so that depending on the value in the player data block, an extra function is or is not executed???

#1
09/03/2006 (1:11 pm)
Plz, someone, i really need this to work, but i have not enough experience to fully understand the way this could work or how the enigne works, i just started with c++,

plz someone,help a guy in need
#2
09/03/2006 (1:12 pm)
Wow, its only 4hr? it feel like an eternity with all of my tries and attempts that keep brinnign up errors!
#3
09/03/2006 (4:36 pm)
If you're working in game connection, the control object is stored in mControlObject, so you could call it with mControlObject->newControlMovement to get your variable. Though you probably will want some checks to make sure the control object is a player. Be very careful messing with source code if you don't know very well what you're doing, and keep backups often in case you break something.
#4
09/03/2006 (5:02 pm)
Thanks for the advice, i always keep back-ups before this i did a lot of flash based scripting, and once i did something that basically corrupted all of my work, since that day i always keep backups. :)

for the mControlObject, how would i set then the variable in script, like i mean where in what cs file would i set the newControlMovement to true or false?

also, since this also requires changes in player.h/.cc, how could i make a variable thats reads from the player data block, but is avaiable to the game Connection Move.cc file?

*this is what im looking for, my first post seems to be a bit confusing now that i read over it:S