Page 1 of 1

How do we assign events just for clone?

PostPosted: Mon Jun 20, 2011 3:51 pm
by Aztec
Hi,

I've been using Game-editor for some time, but I just can't seem to figure out how to assign events to an individual clone. I want a specific door to open, and that door is part of the whole "door" actor group. Thus when I open a door, all doors open. I could create individual door actors, not clones, but that is impractical.

Also, I am wondering how to make checkpoints, or save points. It goes back down to the clone problem again. I want to assign a specific variable to a specific clone. Then, if the player changes variables to other actors after the checkpoint, and dies, I want everything after the checkpoint to be reverted to it's original state.

Thanks.

Re: How do we assign events just for clone?

PostPosted: Mon Jun 20, 2011 5:07 pm
by skydereign
Instead of specifying "actorName", you can specify "actorName.0", replacing 0 with whatever cloneindex you want. The problem with this way is that the code isn't dynamic. If you are in some form of collision (for example you want to open the door because you have a key) in the collision code gameEditor will support the use of "Collide Actor". So using that, only the single actor will change.

The checkpoint system is more complex. If you use spawning actors it makes it a lot easier, but first you should get the actual checkpoint system working. This topic covers checkpoints pretty well.
http://game-editor.com/forum/viewtopic.php?f=4&t=8744&p=66448&hilit=checkpoint#p66448

Re: How do we assign events just for clone?

PostPosted: Tue Jun 21, 2011 11:33 am
by savvy
also, do you know about actor variables? if not. it is a variable which is different to every actor, clones also. so if the door(s) are controlled using touch or clicking them or something, you could use actor variables to do so.

Re: How do we assign events just for clone?

PostPosted: Wed Jun 22, 2011 12:56 am
by Clokio
Can you tell more about actor variables, how to create them. How to use them.
:mrgreen:

Re: How do we assign events just for clone?

PostPosted: Wed Jun 22, 2011 1:02 am
by skydereign
Here's a quick version as I'm about to go to class. An actor variable is a variable type that every actor has one. So, every clone has its own copy of every actor variables. Some built in actor variables are x, y, xvelocity, yvelocity, and the list goes on.

To create them go to the script window, click Variables, Add, then where it says Global, set it to Actor variable. Then when you add the variable it will be an actor variable.

Using them is a bit harder if you don't know about Actor*s but you can look up the getclone functions. You can also just use them how you have been using x, y, and the other actor variables.