Page 1 of 1

clones & ChangeAnimation ...

PostPosted: Thu Jun 26, 2008 10:23 am
by Thanx
Hey folks! :D
I'm having a hard time with my clones and ChangeAnimation. Individually their perfect, bu ewhen you put them together, their tough... Let me tell you what the problem is:

k, I have a board, in GE it's built up with an actor and it has clones. Each clone has many animations to choose from... (86, but that doesn't matter)
Now behind the scenes I have an array, the size of the board, that stores all data required to keep the board going. But let's say there was a change made on the board that also effects the animation of the corresponding clone...

Here's where it get's tricky: since the place where this action happens on the board is expressed with a variable, you cannot say ChangeAnimation("actor.intvariable", "animname" FORWARD); cause there's no such thing as intvariable for an actor, and as we know, cloneindex is read-only...

What's the trick to solve this problem?
PS: I'm trying to do this in a way, so I don't have to use Draw Actor, that's why it is complicated...
Thanx for your help! Thanx :D

Re: clones & ChangeAnimation ...

PostPosted: Thu Jun 26, 2008 10:56 am
by DST
Yeah, you have to send the event to the actor do do the changing.

Generally, a timer is the best way to send an event to many actors at once. If the clones constantly update their array data, you can ask them what it is and base animation off that.

at 30fps a 30ms timer is less than one frame; but that's a timer event for 30 actors = to a draw actor for only one. You'd come out ahead. At 100 ms its 90 vs. 1.

Re: clones & ChangeAnimation ...

PostPosted: Thu Jun 26, 2008 11:16 am
by Thanx
Well, yes, I've been finding the way to use timers, but the problem was, that when I said ChangeAnimation("actor", "animname", FORWARD); then I think it only did it for actor.0, and not for all... :roll:
So for a beginning I started a timer from the Create Actor events, which upgrades all, which is good... But that's only once...
I have to call all, cause I can't call a specific... :roll:
DST wrote:at 30fps a 30ms timer is less than one frame; but that's a timer event for 30 actors = to a draw actor for only one. You'd come out ahead. At 100 ms its 90 vs. 1.


I don't get what you mean there... :? sorry...

Re: clones & ChangeAnimation ...

PostPosted: Thu Jun 26, 2008 12:50 pm
by DST
my point was that a timer sent to all clones is much better for the cpu than a draw actor event.

If you send a timer to actorname, all clones recieve that timer. Once the clones recieve the timer, they decide what to do.

I use lots of 20ms timers as global activation events in my games.