Game Development Community

Wrong scripting type for stateEmitterNode

by Gary Haussmann · in Torque Game Engine · 12/15/2004 (5:38 pm) · 4 replies

I'm using the TGE1.3 codebase and I think I have found a one-liner typo of sorts.

I would like to specify the emitter node for my sword instead of using the default muzzlepoint node. To do this, I figured I could use something like

stateEmitterNode[3] = "damageStart";

or whatever in my weapon image datablock. However, in void ShapeBaseImageData::initPersistFields (in shapeimage.cc) I see this:

addField("stateEmitterNode", TypeS32, Offset(stateEmitterNode, ShapeBaseImageData), MaxStates);

Which suggests I need to specify the node by number. I've tried to specify a node number but the engine crashes when I do so. I also noticed that the stateEmitterNode array is defined as a "const char *" in ShapeBaseImageData, so it seems like a simple change of the above line to

addField("stateEmitterNode", TypeString, Offset(stateEmitterNode, ShapeBaseImageData), MaxStates);

is appropriate. I've tried it and it works. I can provide script files and such to demo the error, if that is really needed.

Thanks,
Gary

#1
12/20/2004 (2:14 pm)
Hmm, seems like a legit bug. I've added this to my todo list.
#2
03/14/2005 (11:20 pm)
Ok, fixed. Thank you Gary!
#3
07/04/2009 (9:32 pm)
Wow this bug is still present in TGEA 1.8.1!
#4
07/06/2009 (7:06 am)

Seems like the change somehow got lost along the way.

Fixed in Torque 3D.