Float or Double Variable as an Actor Variable?

Non-platform specific questions.

Float or Double Variable as an Actor Variable?

Postby happyjustbecause » Thu Jun 07, 2012 5:03 pm

I want to have a float or double variable rather than an integer used for my enemies hp, to be able to have decimals, but I need it to be an actor variable. Can I do this? Is it already not a global variable? If I can't use float or double for this, what can I use?
For small creatures such as we the vastness is bearable only through love.
-Carl Sagan

Night Knight Development Thread
User avatar
happyjustbecause
 
Posts: 267
Joined: Tue Jul 26, 2011 3:10 pm
Location: Frazier Park, Ca
Score: 15 Give a positive score

Re: Float or Double Variable as an Actor Variable?

Postby skydereign » Thu Jun 07, 2012 5:04 pm

Yes you can. Set the variable type to real (same thing as double), and make it an actor variable.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Float or Double Variable as an Actor Variable?

Postby happyjustbecause » Thu Jun 07, 2012 5:09 pm

Oh, I didn't realize or I forgot that that's what a "real" variable is, okay thank you!
For small creatures such as we the vastness is bearable only through love.
-Carl Sagan

Night Knight Development Thread
User avatar
happyjustbecause
 
Posts: 267
Joined: Tue Jul 26, 2011 3:10 pm
Location: Frazier Park, Ca
Score: 15 Give a positive score

Re: Float or Double Variable as an Actor Variable?

Postby SuperSonic » Thu Jun 07, 2012 7:22 pm

Out of curiosity, what is the difference between float and double? :P
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: Float or Double Variable as an Actor Variable?

Postby skydereign » Thu Jun 07, 2012 9:57 pm

It is really just the size. A float is usually 4 bytes, while a double is 8. This means much larger range for the double.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Float or Double Variable as an Actor Variable?

Postby SuperSonic » Fri Jun 08, 2012 12:43 am

Are there any behavioral differences? Or is it just size? :)
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron