Simple but useful: Active Actors

Hey everyone!
Here is a little thing I'm doing, called SBU (Simple but useful), and I'm going to be doing quite a lot of these. They're simple functions that allow for a quick help and shortn' things down a bit, so say you have a bunch of stuff you use often, this is what thats for! 
Sorry if I'm not making any sense I'm super tired >.>
Anyways, this one is "Active Actors", it enables you too activate or de-activate a player via variable. So say if your walking and you want a cutscene to go, all you'd do is this:
and wadda bing the "player" actor becomes unable to do commands xD This is useful for those who are using Draw Actor to handle the players movement.
How to use:
Make an actor variable called "enabled", thats it xD Then in Draw Actor, do this:
Now for the actual script:
Simple right? but yet so useful xD


Sorry if I'm not making any sense I'm super tired >.>
Anyways, this one is "Active Actors", it enables you too activate or de-activate a player via variable. So say if your walking and you want a cutscene to go, all you'd do is this:
- Code: Select all
active(0, "player");
and wadda bing the "player" actor becomes unable to do commands xD This is useful for those who are using Draw Actor to handle the players movement.
How to use:
Make an actor variable called "enabled", thats it xD Then in Draw Actor, do this:
- Code: Select all
if (enabled) {
your code here to be ran when enabled is on
}
Now for the actual script:
- Code: Select all
void active(int value, char *actor) {
Actor *act = getclone(actor);
act->enabled=value;
}
Simple right? but yet so useful xD