Creating player without Dragon Template
by Steve Gathercole · in TGB Platformer Kit · 03/23/2008 (8:09 am) · 9 replies
Hi,
I'm a bit of a newbie, so must be missing something simple..
If I try to setup the actor without using the Dragon Template i.e
"Actor Behavior"
"Actor Animation Behavior"
"Player Controller"
I don't seem tobe able to enter anything in the fields of the Actor Animation Behavior , the rollouts only let me select 'None' and I cant type anthing in..
Steve
I'm a bit of a newbie, so must be missing something simple..
If I try to setup the actor without using the Dragon Template i.e
"Actor Behavior"
"Actor Animation Behavior"
"Player Controller"
I don't seem tobe able to enter anything in the fields of the Actor Animation Behavior , the rollouts only let me select 'None' and I cant type anthing in..
Steve
#2
Should have know it was me :-)
I have been making my own sprites ready to use with your kit for my own develeopment, whilst making the sprites, (which gets a bit tedius at times), I was trying different things out with the Kit, and wondered why the animations were not selectable.
I have now plonked a few of my own animations in and yes your are correct they are now selectable via the rollout.
I just find datablocks a bit confusing so was trying the 'other' route..
Many thanks, and great work by the way..
Steve
03/24/2008 (3:15 am)
Philip,Should have know it was me :-)
I have been making my own sprites ready to use with your kit for my own develeopment, whilst making the sprites, (which gets a bit tedius at times), I was trying different things out with the Kit, and wondered why the animations were not selectable.
I have now plonked a few of my own animations in and yes your are correct they are now selectable via the rollout.
I just find datablocks a bit confusing so was trying the 'other' route..
Many thanks, and great work by the way..
Steve
#3
I'm having trouble using the spawn point behavior. I've set up a datablock (in gamescripts) as follows:
datablock t2dSceneObjectDatablock(RobotTemplate)
{
Class = "PlayerClass";
size = "17 17";
Layer = "1";
_Behavior0 = "ActorBehavior";
_Behavior1 = "ControllerBehavior";
_Behavior2 = "ActorAnimationBehavior DatablockPrefix robot ScaleVolume 0";
};
and when I run the game no player appears even though I can control and "invisible" PC. Also, I had to add the line to the bottom of the datablock in order to get it to show up in the Target drop down list:
$managedDatablockSet.add(RobotTemplate);
Does anyone know why Dragon, Pepper and Drill show up 3 times in the target list?
04/13/2008 (6:08 pm)
I've made a few animations with some sprite sheets as well and if I make a player via adding Actor, Controller and Animation Manager behaviors, setting the datablock prefix to "robot" (my animations are robotIdleAnimation, etc) Everything seems to work correctly.I'm having trouble using the spawn point behavior. I've set up a datablock (in gamescripts) as follows:
datablock t2dSceneObjectDatablock(RobotTemplate)
{
Class = "PlayerClass";
size = "17 17";
Layer = "1";
_Behavior0 = "ActorBehavior";
_Behavior1 = "ControllerBehavior";
_Behavior2 = "ActorAnimationBehavior DatablockPrefix robot ScaleVolume 0";
};
and when I run the game no player appears even though I can control and "invisible" PC. Also, I had to add the line to the bottom of the datablock in order to get it to show up in the Target drop down list:
$managedDatablockSet.add(RobotTemplate);
Does anyone know why Dragon, Pepper and Drill show up 3 times in the target list?
#4
04/13/2008 (7:45 pm)
I checked the other post "Tips when you're making custom templates" and the formatting of the post wrecked the tabs but I have a tab between each word in the behavior strings. Mine still didn't work.
#5
They might show up 3 times on the list because they are in the managed set multiple times. Just open up the datablocks.cs file in the managed folder and search through it for the duplicates and remove them.
You could also add this line of code for each of the templates:
Does the console give out any errors when you launch the game? Have you made sure that you have datablocks named "RobotIdleAnimation", "RobotSpawnAnimation" etc in your project?
04/14/2008 (4:05 am)
Tip: Use [code ][/code ] tags around code to make them easier to read.They might show up 3 times on the list because they are in the managed set multiple times. Just open up the datablocks.cs file in the managed folder and search through it for the duplicates and remove them.
You could also add this line of code for each of the templates:
if (isObject(DragonTemplate)) DragonTemplate.safeDelete(); $managedDatablockSet.add(DragonTemplate);
Does the console give out any errors when you launch the game? Have you made sure that you have datablocks named "RobotIdleAnimation", "RobotSpawnAnimation" etc in your project?
#6
anyway... you SURE you have tabs? Can't use spaces at all. Try this:
i'm having the issues where the idle anim doesn't show up until I move, but that didn't happen initially, it happened when I changed something (not sure why).
what are you using as the editor for the .cs files? I'm using editpadLite. very cool & it's free (for non-commercial use).
Also... TGB *MAY* be case sensative so you may wany "robot" to be "Robot" instead.
Re: Phillip OShea
hey, that managed folder is why i get a TON of datablock templates. There's ~10 copies of each template in my managed/datablocks.cs file. Darn!
04/14/2008 (1:38 pm)
You don't have a polygon collision set in there.anyway... you SURE you have tabs? Can't use spaces at all. Try this:
datablock t2dSceneObjectDatablock(RobotTemplate)
{
Class = "PlayerClass";
size = "17 17";
Layer = "1";
_Behavior0 = "ActorBehavior";
_Behavior1 = "ControllerBehavior";
_Behavior2 = "ActorAnimationBehavior DatablockPrefix robot ScaleVolume 0";
};i'm having the issues where the idle anim doesn't show up until I move, but that didn't happen initially, it happened when I changed something (not sure why).
what are you using as the editor for the .cs files? I'm using editpadLite. very cool & it's free (for non-commercial use).
Also... TGB *MAY* be case sensative so you may wany "robot" to be "Robot" instead.
Re: Phillip OShea
hey, that managed folder is why i get a TON of datablock templates. There's ~10 copies of each template in my managed/datablocks.cs file. Darn!
#7

Anyways, I cleaned up my managed list as well and now...

Thanks again.
04/16/2008 (12:23 am)
Thanks for the help Phillip, Stephen. I followed your instructions and still had issues until I discovered that Torsion was replacing all TABs with spaces. WHY would you do that? TAB should mean TAB unless I tell you to do something else!
Anyways, I cleaned up my managed list as well and now...

Thanks again.
#8
04/16/2008 (3:35 am)
Awesome work!
#9
04/16/2008 (10:02 am)
Woot woot! :)
Associate Phillip O'Shea
Violent Tulip
If you run through the demo level tutorial on TDN (found here) it explains how to use the animation manager properly. What you *should* be able to do is just type in "Dragon" in the DatablockPrefix field in that same rollout. This will automatically use all of the dragon animations for that character.
If you are using your own animations for the player, I am puzzled why they aren't showing up in that rollout.
Let me know what your situation is.