Ok, an Actor* is a pointer to an actor. Not sure if you've ever done this, but if you type something like this...
- Code: Select all
actor.x+=10; // this increases actor's position by 10
You are using an actor struct. These structs are what contain all of an actor's variables, such as x, y, animindex, animpos, and everything else. Well, an Actor* is a pointer to an actor, so it works in a very similar way. Now the function getCloneIdx gets the pointer of a given clone via the getclone function. getclone takes a clonename (name.cloneindex) and retrieves the pointer to the actor, so you can do things to it (in the case of the ged I uploaded all you use it for is to set one of its actor variables to 1).
With that said, all Actor*s are really used for is to interact with individual clones. So you have a lot of bullets, but you want to target a very individual bullet. We can use the cloneindex stored in the bullet_indexes array to get the proper cloneindex, which is passed to the getCloneIdx function.
To actually use an Actor*, you have to use -> instead of the . character.
- Code: Select all
Actor* actor_pointer = getCloneIdx("actor", 4);
actor_pointer->r=0; // sets actor.4's red value equal to 0