I have received this error ("Array can't be coerced into a float.") while working on my project. Here is the piece of script call that is causing it:
$game_variables[24] = ($game_variables[7] *
0.4) + ($game_variables[6] * 0.3) +
($game_variables[5] * 0.3)+($game_variables
[4])
When that script runs, it produces the error.(It is a common event and I have narrowed it down to this bit in red.)
What I believe the problem is, is that previously I must calculate something else from the same variable with this piece of script call:
$game_variables[4] = ($game_variables[7] *
0.5) + ($game_variables[6] * 0.3) +
($game_variables[5] * 0.2)
As you can see it sets the Variable[4] which is causing the error to occur. I believe it is because the part above which is done prior causes it to be a decimal. Is there anyway I can round it back to the nearest whole number after a calculation?
I know this isn't something most people have encountered, but any help would be appreciated!
$game_variables[24] = ($game_variables[7] *
0.4) + ($game_variables[6] * 0.3) +
($game_variables[5] * 0.3)+($game_variables
[4])
When that script runs, it produces the error.(It is a common event and I have narrowed it down to this bit in red.)
What I believe the problem is, is that previously I must calculate something else from the same variable with this piece of script call:
$game_variables[4] = ($game_variables[7] *
0.5) + ($game_variables[6] * 0.3) +
($game_variables[5] * 0.2)
As you can see it sets the Variable[4] which is causing the error to occur. I believe it is because the part above which is done prior causes it to be a decimal. Is there anyway I can round it back to the nearest whole number after a calculation?
I know this isn't something most people have encountered, but any help would be appreciated!