clones & ChangeAnimation ...

You must understand the Game Editor concepts, before post here.

clones & ChangeAnimation ...

Postby Thanx » Thu Jun 26, 2008 10:23 am

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
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: clones & ChangeAnimation ...

Postby DST » Thu Jun 26, 2008 10:56 am

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.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: clones & ChangeAnimation ...

Postby Thanx » Thu Jun 26, 2008 11:16 am

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...
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: clones & ChangeAnimation ...

Postby DST » Thu Jun 26, 2008 12:50 pm

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.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest