Game Development Community

[B5 Bug] TriggerData::onAdd() isn't called, Trigger::onAdd() is

by Eric den Boer · in Torque 3D Professional · 09/28/2009 (6:43 am) · 4 replies

Found an issue where the TriggerData::onAdd() function isn't called - both in script and C++. The instanceName::onAdd() however, is called.

I put two breakpoints on the data and object onAdd() in visual studio and it didn't ever call the datablock onAdd. The object did get called, the same thing is reflected in script. This is pretty annoying.

#1
09/28/2009 (1:01 pm)

Can't confirm TriggerData::onAdd() not being called. Correctly triggers for me and I don't see a reason there why it shouldn't.

As for the script-side onAdd not being called on the datablock, that's the fault of Trigger as it's the responsibility of leaf classes derived from GameBase to do that. If you need this just add:

if (isServerObject())
      scriptOnAdd();

to Trigger::onAdd().
#2
09/28/2009 (1:05 pm)
BTW, the latter thing really is an omission. Going to fix that in the repo.
#3
09/28/2009 (4:18 pm)
Odd stuff. I'll add the C++ code, see what happens.
#4
09/29/2009 (8:38 pm)
Trigger aren't working for me either.