Is this a bug?
by huhorler · in Torque 3D Professional · 01/22/2016 (3:58 am) · 4 replies
The function will never be used.The function must be define before the object created.
the cs file is create when the shapes saved.
singleton TSShapeConstructor(Turret_LegsDAE)
{
baseShape = "./Turret_Legs.DAE";
loadLights = "0";
lodType = "DetectDTS";
};
function Turret_LegsDAE::onLoad(%this)
{
%this.renameSequence("ambient", "timeline");
%this.addSequence("timeline", "root", "110", "111", "1", "0");
%this.addSequence("timeline", "scan", "140", "412", "1", "0");
%this.addSequence("timeline", "throw", "10", "11", "1", "0");
%this.addSequence("timeline", "deploy", "10", "110", "1", "0");
%this.addSequence("timeline", "destroyed", "840", "925", "1", "0");
%this.addSequence("timeline", "light_recoil", "440", "445", "1", "0");
%this.addSequence("timeline", "medium_recoil", "480", "495", "1", "0");
%this.setSequenceCyclic("throw", "0");
%this.setSequenceCyclic("deploy", "0");
%this.setSequenceCyclic("destroyed", "0");
%this.setSequenceCyclic("light_recoil", "0");
%this.setSequenceCyclic("medium_recoil", "0");
%this.setSequenceBlend("light_recoil", "1", "root", "0");
%this.setSequenceBlend("medium_recoil", "1", "root", "0");
%this.setMeshSize("ColCapsule-1 2", "-1");
}
the cs file is create when the shapes saved.
singleton TSShapeConstructor(Turret_LegsDAE)
{
baseShape = "./Turret_Legs.DAE";
loadLights = "0";
lodType = "DetectDTS";
};
function Turret_LegsDAE::onLoad(%this)
{
%this.renameSequence("ambient", "timeline");
%this.addSequence("timeline", "root", "110", "111", "1", "0");
%this.addSequence("timeline", "scan", "140", "412", "1", "0");
%this.addSequence("timeline", "throw", "10", "11", "1", "0");
%this.addSequence("timeline", "deploy", "10", "110", "1", "0");
%this.addSequence("timeline", "destroyed", "840", "925", "1", "0");
%this.addSequence("timeline", "light_recoil", "440", "445", "1", "0");
%this.addSequence("timeline", "medium_recoil", "480", "495", "1", "0");
%this.setSequenceCyclic("throw", "0");
%this.setSequenceCyclic("deploy", "0");
%this.setSequenceCyclic("destroyed", "0");
%this.setSequenceCyclic("light_recoil", "0");
%this.setSequenceCyclic("medium_recoil", "0");
%this.setSequenceBlend("light_recoil", "1", "root", "0");
%this.setSequenceBlend("medium_recoil", "1", "root", "0");
%this.setMeshSize("ColCapsule-1 2", "-1");
}
#2
For an explanation as to how this works see this engine class TSShapeConstructor documentation.
01/22/2016 (6:13 am)
No, that all works correctly as TSShapeConstructor class behaves differently. It is used to control what happens when, in this case, Turret_Legs.DAE is loaded later on in-game: as in is either loaded when game mission/map is loaded with a shape object that references said model file, or when adding a shape object into an already loaded mission/map that references said model file.For an explanation as to how this works see this engine class TSShapeConstructor documentation.
#3
01/24/2016 (5:27 pm)
Turret_Legs.DAE is loaded when the TSShapeConstructor is added.I have tested the onLoaded function is not used because has not compiled.
Torque Owner Richard Ranft
Roostertail Games