Save-Point

Full Version: Call Script RealNumbers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

I've got another problem with my stuff, please hlep me, I'd appreciate it very very much!

My problem is...

I would like to calculate a number between 1 and 3 and I'm tinkering with the call script command...
I'm calculating these numbers according to the players screen_y coordinate...

I made up this rough code to do the calculating...
y =1+(sx-300)/100
where sy is the screen_y coordinate which I check as a game variable. I put the 300 for a reason, please ignore that...
If I'm in sy=350 it should give me y=1.5.

There is no problem with this calculating the problem I have is that in the call script command I don't know how to make a variable in realnumber format.

It just gives naturalnumber format..

So instead of getting numbers like: 1.42 or 2.31, I either get a 1 or a 2.

Can you help me with this?

Here is the full call script I use after chacking the screen_y and making it to game_varibale 2:

Code:
sy = $game_variables[2]

y =1+(sx-300)/100

print y
y = 1 + (sx-300.0)/100
Thank you. You're awesome!