Those are not actual lines of code, just a rough summary to give you an idea what the code does. The code itself is kinda messy and most of the variable names are in czech, but in case you want to see it anyway, here it is:
Code: ags
The integers are first transfered to floats, and only the final result is rounded, so it really does result in 13
.
My speed is also calculated right - I let the script display key values on every new frame, so I can check for this type of mistakes. There probably are some discrepancies in my code, but I'm pretty sure anything like that is not the (main) problem.
Do you have any idea why the "AdjustSpeedWithScaling" option is behaving as my screenshots show? You said that you couldn't replicate it, and if it was how it's supposed to work, I think more people would complain about it. So I'm guessing it must be something specific for my game, but I have no idea what.
function repeatedly_execute() {
if (player.Moving == true) {
rozdil_x = player.x-s1;
rozdil_y = player.y-s2;
newframe = player.Frame;
if (rozdil_x!=0 || rozdil_y!=0 || newframe-oldframe!=0) {moved = true;} else moved = false;
oldframe = player.Frame;
if (moved == true) {
rozdil_x_pomer = (IntToFloat(rozdil_x)/(IntToFloat(player.WalkSpeedX)*2.0))*IntToFloat(rychlost_moje_x);
player.x = s1 + FloatToInt(rozdil_x_pomer, eRoundNearest);
if (info_display == true) Display("rozdil_x_pomer = (rozdil_x (%d) / 2*player.WalkSpeedX (%d))*rychlost_moje_x (%d) = %f = %d[[s1: %d x: %d", rozdil_x, 2*player.WalkSpeedX, rychlost_moje_x, rozdil_x_pomer, FloatToInt(rozdil_x_pomer, eRoundNearest), s1, player.x);
cLisa.x = player.x;
cLisa.y = player.y;
cLisa.Loop = player.Loop;
cLisa.Frame = player.Frame;
rychlost_moje_x = FloatToInt(0.14*IntToFloat(player.Scaling), eRoundNearest);
}
s1=player.x;
s2=player.y;
}
if (player.Moving == false) {
rychlost_moje_x = FloatToInt(0.14*IntToFloat(player.Scaling), eRoundNearest);
cLisa.x = player.x;
cLisa.y = player.y;
cLisa.Loop = player.Loop;
cLisa.Frame = player.Frame;
}
}
The integers are first transfered to floats, and only the final result is rounded, so it really does result in 13

My speed is also calculated right - I let the script display key values on every new frame, so I can check for this type of mistakes. There probably are some discrepancies in my code, but I'm pretty sure anything like that is not the (main) problem.
Do you have any idea why the "AdjustSpeedWithScaling" option is behaving as my screenshots show? You said that you couldn't replicate it, and if it was how it's supposed to work, I think more people would complain about it. So I'm guessing it must be something specific for my game, but I have no idea what.