How do we assign events just for clone?

Game Editor comments and discussion.

How do we assign events just for clone?

Postby Aztec » Mon Jun 20, 2011 3:51 pm

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.
Aztec
 
Posts: 4
Joined: Wed Jun 15, 2011 11:20 pm
Score: 0 Give a positive score

Re: How do we assign events just for clone?

Postby skydereign » Mon Jun 20, 2011 5:07 pm

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
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: How do we assign events just for clone?

Postby savvy » Tue Jun 21, 2011 11:33 am

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.
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: How do we assign events just for clone?

Postby Clokio » Wed Jun 22, 2011 12:56 am

Can you tell more about actor variables, how to create them. How to use them.
:mrgreen:
Clokio
 
Posts: 229
Joined: Tue May 17, 2011 2:18 pm
Score: 32 Give a positive score

Re: How do we assign events just for clone?

Postby skydereign » Wed Jun 22, 2011 1:02 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest