Call Script RealNumbers
#1
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
Reply }
#2
y = 1 + (sx-300.0)/100
Reply }
#3
Thank you. You're awesome!
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Script compatibility help Lord Vectra 3 4,552 07-25-2021, 11:42 PM
Last Post: DerVVulfman
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 15,704 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   "Wait" in the script Whisper 13 16,034 04-28-2020, 04:06 PM
Last Post: Whisper
   Skill Cooldown script Fenriswolf 11 16,348 12-10-2019, 11:10 AM
Last Post: Fenriswolf
   Help iwth script (RGSS Player crash) Whisper 3 8,507 06-17-2017, 05:03 PM
Last Post: Whisper
   Help modifying a script Keeroh 7 10,182 06-11-2017, 04:43 PM
Last Post: DerVVulfman
Question  Mog Menu script: help me stop the crazy picture movement during transitions Zachariad 4 9,802 05-31-2017, 05:10 AM
Last Post: Zachariad
   Actor names in Quest Script jreagan406 5 8,612 03-07-2017, 08:06 AM
Last Post: JayRay
   Bizarre issue with Lanzer counter script. Steel Beast 6Beets 2 7,220 10-04-2016, 11:46 AM
Last Post: Steel Beast 6Beets
   Moonpearl script Animated Battlers help!! x(( Starmage 11 15,582 05-21-2016, 05:34 AM
Last Post: Starmage



Users browsing this thread: 2 Guest(s)