Bootleg (but useful! :D) way to tell if an object is active

Talk about making games.

Bootleg (but useful! :D) way to tell if an object is active

Postby Hblade » Thu May 16, 2013 9:34 pm

Make a variable, (example f) and then on mouse down of w/e actor, simply do this:
Code: Select all
f=(int)name;


BAM bootleg way xD results will be a long string like this:
result.png
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Bootleg (but useful! :D) way to tell if an object is act

Postby skydereign » Thu May 16, 2013 10:11 pm

Don't do this. Any actor that can trigger code is by definition active, so if you can click an actor, it is already active. Also, casting a const char* to an int is a bad way of doing this. If you want to check if an actor exists, check if its cloneindex is valid. Invalid actors have a cloneindex of -1, and checking for that doesn't require any weird casting.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Bootleg (but useful! :D) way to tell if an object is act

Postby Hblade » Thu May 16, 2013 10:29 pm

Ahh ok
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest