Behavior Resources
by Spider · in Torque Game Builder · 07/26/2007 (5:05 pm) · 5 replies
I want to provide my students with a set of behaviors to use for making games. An obvious example would be the ones that are provided with the behaviorPlayground project. What I'm trying to do is be able to start a new project and then add all those behaviorPlayground behaviors at once.
I want to put them in a resource, but that doesn't seem to work right because the loadResource function seems to only be called when the resource is first added. So the behaviors are there when I first add the resource, but then they are gone when I "reload project" from the menu.
Looking on TDN, I see that the way to add behaviors to a project is to drag a ZIP file onto the project. Can I have multiple behaviors in there? Can they be in separate folders like they are in behaviorPlayground? Is the ZIP file method the only way? What exactly does it do?
P.S. Any chance of getting a "Behaviors" section in the forums?
I want to put them in a resource, but that doesn't seem to work right because the loadResource function seems to only be called when the resource is first added. So the behaviors are there when I first add the resource, but then they are gone when I "reload project" from the menu.
Looking on TDN, I see that the way to add behaviors to a project is to drag a ZIP file onto the project. Can I have multiple behaviors in there? Can they be in separate folders like they are in behaviorPlayground? Is the ZIP file method the only way? What exactly does it do?
P.S. Any chance of getting a "Behaviors" section in the forums?
#2
So, I notice that you can drag .cs files onto TGB and they get put in behaviors, and you can drag graphics files and they get put into data/images and have datablocks made. I haven't tried particles or tilemaps, but boy would it be awesome if you could drag those on and have them put in the right place, too. I'll look into it...
07/27/2007 (11:16 am)
I did some research and discovered that you can zip a bunch of behaviors together (folders will be ignored) and they will be placed in the behaviors folder.So, I notice that you can drag .cs files onto TGB and they get put in behaviors, and you can drag graphics files and they get put into data/images and have datablocks made. I haven't tried particles or tilemaps, but boy would it be awesome if you could drag those on and have them put in the right place, too. I'll look into it...
#3
07/30/2007 (11:43 am)
I actually did figure out how to add behaviors in a resource. The workflow is a little funny, because the way to go is to keep your resource folder in the resource folder that's with the TGB tools. Then, because resources are now copied to your project, when you make a change you have to remove the resource from your game then re-add it. I think that's what screwed me up when I tried before.
#4
08/26/2007 (12:42 pm)
Hi i have torque game builder and i have seen behaviorPlayground project but im new to all of this whats the difference between behaviors and components and how do i access behaviors if im using platformer demo can u give me any tips. CHEERS
#5
I don't think the platformer demo has behaviors in it. Currently the best way to add behavior playground behaviors to a project is this:
1) go to the behavior playground project and find the game/behaviors folder.
2) add that whole folder to a zip file
3) drag the zip file into the level editor
08/27/2007 (1:11 pm)
I don't really understand components, so I can't help ya there.I don't think the platformer demo has behaviors in it. Currently the best way to add behavior playground behaviors to a project is this:
1) go to the behavior playground project and find the game/behaviors folder.
2) add that whole folder to a zip file
3) drag the zip file into the level editor
Torque Owner Joe Rossi
Indri Games
I'm not sure where you saw this zipfile thing, all you should have to do is drag the appropriate .cs files containing behavior code into your game/behaviors/etc folder ("etc" being whatever name you want it to be). Maybe you will download these .cs files from a zip. Unzip that and copy it to your game/behaviors folder and it should show up in the editor.