Game Development Community

Timer Shoots behavior not cloning properly

by Scott Burns · in Torque Game Builder · 07/15/2007 (11:24 am) · 8 replies

Grumble, the first pass at this got ate.

I've got a spawn area which is spawning enemy ships that are supposed to fly toward a fixed point and fire projectiles. I'm using the Timer Shoots behavior on them, but it doesn't seem to be cloning properly. The ships spawn and move toward their fixed point, but the cloned ships don't fire. In fact, the projectiles that are being fired are coming from where the ship that is being cloned is at in the level builder.

So, anyone got any ideas as to what's going on or what I've overlooked?

#1
07/15/2007 (12:18 pm)
I was about to post a similar bug before I saw this post.

I created this test level to experiment:
1. create a t2dSceneObject and assign to it the SpawnArea behavior
2. create a sprite and assign it as the object to be cloned in #1. Add the Template behavior to the sprite.
3. assign various behaviors to the object in #2
The test level was created as a level within the BehaviorPlayground project that came with TGB.

What I found
- MoveToward is being cloned
- RandomVelocity isn't being cloned
- FaceObject is being cloned
- MouseOver Grow is being cloned

Curiously, velocity isn't being properly cloned either. Here's another experiment I did:
1. create a t2dSceneObject and assign to it the SpawnArea behavior
2. create a sprite and assign it as the object to be cloned in #1. Add the Template behavior to the sprite.
3. assign a velocity to the object
4. assign the MouseOver Grow behavior to the object

What happens is that new objects that are spawned don't get the velocity I assigned. But when I mouseover the new objects, they start moving with the right velocity.

I'm not sure if this is a bug with cloneWithBehaviors() or a bug of the SpawnArea behavior. I think some behaviors aren't being properly cloned.

FWIW: I'm using the final 1.5 release on PPC OS X 10.4.9

PS. Shouldn't we have a forum dedicated to Behaviors?
#2
07/15/2007 (12:43 pm)
That's interesting that you're having problems with Move Toward because in the same level I have asteroids spawning from an area that are supposed to move toward the same fixed point as the ships, but for some reason they're not moving at all.

The Timer Shoots problem was present in the Beta, but the bug with the Asteroids is new in the 1.5 release.

So it would seem the two are related.

Oh, and I'm using the 1.5 release on Windows.
#3
07/15/2007 (4:56 pm)
I've got the MoveTo behavior also not moving once spawned from a sceneobject with template on.

Weirdly, it only seems to be happening on the first sceneobject, other types of sceneobject seem to be functioning as expected.
#4
07/15/2007 (10:27 pm)
@Scott: The asteroids problem has been there for me through the whole beta and I adressed it before somewhere. When I play the asteroids level the asteroids spawn but don't move.. I can tell because if I shoot in their general direction I see some particles of explosions.

I tried both on my IBM ThinkPad R50e and my desktop(Windows XP SP2, C2D E6600, GF8800 GTS).

Seems a lot of new bugs made it past QA. :/
#5
07/23/2007 (6:17 pm)
I just loaded up 1.5 for the first time and I'm seeing the same problem as you guys. I have an enemy object that I apply the "Move Toward" behavior to (target is the player ship). A SceneObject is setup with the "Spawn Area" behavior and spawns the aforementioned enemy. When the enemies spawn they don't move because the behavior isn't copied in the clone call.
#6
07/25/2007 (9:17 am)
This one is kinda funny. @Oliver - I'm sure they fixed it in beta 3 as my asteroids move fine in b3.

Tested it on the latest 1.5.1 and I get the same kinda of problem with cloned objects.

The asteroids playground is a good example as the spawned objects don't move in 1.5.1. I tested this out on an project I was playing around with in beta 3 and got pretty much the same result. The RandomVelocityBehavior::onAddToScene seemed to be running fine as u can echo in it when it an new object is spawned. The call to %this.owner.setAngularVelocity didn't seem to do any thing. This worked perfectly for me in beta 3.

Been waiting on this release for ages now and to be honest am a little disappointed at the bugs that seem to have come back. I'm still getting crash on close as well :(
#7
08/03/2007 (1:25 pm)
I just came across this thread a moment ago. Looks like it may fix all our problems, or at least some of them. I'll be giving it a shot when I get home.
#8
08/03/2007 (9:07 pm)
Yeah... that thread should fix all yer problems :)
Hopefully, they'll fix the cloneWithBehaviors function in the next point release.