TGB 1.7.6 and PSK 1.2 (Solved - TargetObject issue fixed)
by TBruce · in TGB Platformer Kit · 02/03/2012 (10:12 pm) · 2 replies
I have TGB 1.7.6 Pro and PSK 1.2 Pro. I have merged all the PSK changes/additions (comparing TGB 1.7.5/1.7.6 ans PSK 1.2) and rebuilt everything.
I am currently going through the Demo Level tutorial but keep running into issues. I have read through all the posts regarding the same issues that I am encountering but I am still having problems.
The main issues that I am having are regarding the spawn behavior. The tutorial states that I should change the "TargetType" field to "pskActor". Only "pskActor2D" and "pskActor3D" are available, I select "pskActor2D". It then states to change the "TargetObject" field to "DragonActorTemplate" (note: I have added the necessary code to datablocks.cs). All that is available is "None". So I select the "DragonActorTemplate" under scripting instead (not sure if correct). This sets the Class ans Super Class as well as adding the ActorType "Dragon" in the dynamic fields.
But when I run the tutorial the player never spawns.
If I try running from within Torsion I get the following errors:
game/data/shapes/players/BoomBot/BoomBot.cs (0): preload failed for BoomBotDts: Load sequence game/data/shapes/players/animations/player_root.dsq root failed for game/data/shapes/players/BoomBot/BoomBot.dts.
and
game/gameScripts/PlayerMethods.cs (14): Unknown command onAddtoScene.
game/gameScripts/DrillMethods.cs (10): Unknown command onAddtoScene.
game/gameScripts/PlayerMethods.cs (216): Unknown command setActiveWeapon.
Any help resolving this issue is greatly appreciated.
I am currently going through the Demo Level tutorial but keep running into issues. I have read through all the posts regarding the same issues that I am encountering but I am still having problems.
The main issues that I am having are regarding the spawn behavior. The tutorial states that I should change the "TargetType" field to "pskActor". Only "pskActor2D" and "pskActor3D" are available, I select "pskActor2D". It then states to change the "TargetObject" field to "DragonActorTemplate" (note: I have added the necessary code to datablocks.cs). All that is available is "None". So I select the "DragonActorTemplate" under scripting instead (not sure if correct). This sets the Class ans Super Class as well as adding the ActorType "Dragon" in the dynamic fields.
But when I run the tutorial the player never spawns.
If I try running from within Torsion I get the following errors:
game/data/shapes/players/BoomBot/BoomBot.cs (0): preload failed for BoomBotDts: Load sequence game/data/shapes/players/animations/player_root.dsq root failed for game/data/shapes/players/BoomBot/BoomBot.dts.
and
game/gameScripts/PlayerMethods.cs (14): Unknown command onAddtoScene.
game/gameScripts/DrillMethods.cs (10): Unknown command onAddtoScene.
game/gameScripts/PlayerMethods.cs (216): Unknown command setActiveWeapon.
Any help resolving this issue is greatly appreciated.
#2
The problem is that the TargetObject field within the SpawnPointBehavior is never set in the editor, all that is available is "None", so the object is never spawed (this can be seen in pskSpawnPoint::onAddToScene). If you manually set TargetObject in the level file then the spawn works correctly but when you reload your level the TargetObject is reset back to "None" and the next time that you save your level this TargetObject will be removed.
The fix is to make the following change in the SpawnPointBehavior.cs behavior file:
%template.addBehaviorField(TargetObject, "Spawn this object (uses datablocks)", OBJECT, "", t2dSceneObjectDatablock );
to
%template.addBehaviorField(TargetObject, "Spawn this object (uses datablocks)", DEFAULT);
You then only need to manually enter your template name into the TargetObject field.
02/04/2012 (6:14 pm)
Solution found.The problem is that the TargetObject field within the SpawnPointBehavior is never set in the editor, all that is available is "None", so the object is never spawed (this can be seen in pskSpawnPoint::onAddToScene). If you manually set TargetObject in the level file then the spawn works correctly but when you reload your level the TargetObject is reset back to "None" and the next time that you save your level this TargetObject will be removed.
The fix is to make the following change in the SpawnPointBehavior.cs behavior file:
%template.addBehaviorField(TargetObject, "Spawn this object (uses datablocks)", OBJECT, "", t2dSceneObjectDatablock );
to
%template.addBehaviorField(TargetObject, "Spawn this object (uses datablocks)", DEFAULT);
You then only need to manually enter your template name into the TargetObject field.
Torque Owner TBruce
Default Studio Name