Game Development Community

[solved]Using StringTableEntry? (C++)

by Johnathan Moore · in Torque 3D Professional · 03/11/2013 (6:58 am) · 2 replies

Hello. I need to know how to get the char* off of this string table thing. I'm getting ShapeBaseImageData::animationPrefix or similar that the engine uses to find animations pertaining to the weapon the Player has equiped.

I need to get it in the usual starting char pointer string form so I can work with it.

Any links to tutorials or reference, or quick fix would be much appreciated. Thanks.

Namespace is a Player child class member function
// Play a coriographed bout
// <myweapon>_choreograph_<targetsweapon>_<"inconclisive" or "fatal">_<RANDofTotal>_<Leader or Reciever>
// e.g. crossbow_choreograph_crossbow_inconclusive_1_leader
getMountedImage(mDataBlock->mWeaponMountPoint)->imageAnimPrefix; //->getCharPointer?

// + _choreograph_
char char_choreograph_[14];
char_choreograph_[1] = 0x5F; char_choreograph_[2] = 0x63; char_choreograph_[3] = 0x68; char_choreograph_[4] = 0x6F;
char_choreograph_[5] = 0x72; char_choreograph_[6] = 0x65; char_choreograph_[7] = 0x6F; char_choreograph_[8] = 0x67;
char_choreograph_[9] = 0x72; char_choreograph_[10] = 0x61; char_choreograph_[11] = 0x70; char_choreograph_[12] = 0x63;
char_choreograph_[13] = 0x5F; char_choreograph_[14] = 0x00;
				
mActionTarget->getMountedImage(mActionTarget->mDataBlock->mWeaponMountPoint)->imageAnimPrefix; //->getCharPointer?
//+ fatal or inconclusive
//+ _RAND
//+ leader or reciever
setActionThread(1,0,0,0,0,0)

#1
03/11/2013 (7:54 am)
Greetings!

StringTableEntry is defined as a const char* (in platform/types.h) so you should be able to use it directly when reading from it.

- Dave
#2
03/11/2013 (8:00 am)
Doh. Thanks David.