@caethyril I'm still lost on this haha. I'm not sure how to get my image to move from Y axis 270 to Y axis 350 and have it stored in a variable. When I try it, my image moves randomly between those points.
Which destroys the smooth transition of the move image command.
I'm not sure what you mean by "moves randomly"...it starts jumping around the screen and stuff? Move Picture ought to make the picture start moving in a straight line to the target point, over the specified number of frames.
😅 But yes, the whole reel thing is pretty complex unless you want to do it frame-by-frame, because the default commands don't give you picture cropping abilities. More on this later~
For the variable thing: it's easiest to perform the picture and variable operations completely separately. Set the picture moving, then have the variable update inside the "input check" loop. The
position of your reel picture can be thought of as representing a
time; the variable gets updated every frame (i.e.
time) to represent the reel's current
position. Probably sounds complicated, but it's not that bad!
🙏
For example, in that li'l "timedInput" demo I linked in my
first response, I add 4 to the "angle" variable each frame, because the dial is rotating at a speed of 4 degrees per frame. Analogously, let's say your reels move at 8 px per frame (480 px/second), then you'd simply add 8 to the variable each frame so it matches what the pictures are telling the player. I.e. the variable will always correspond to the current "position" of the reel, then when you get player input and exit the loop, you can simply check that variable to see "where" the input was received and see whether that classifies as a Miss, Hit, or Yeah result.
😤
Let alone have it done for the other 2 images so that they look like actual reels, where the next image can be seen coming down.
Yea, I think the reel thing will need a plugin unless you're OK with presenting it in a different way. I found a "crop picture" plugin by Aloe Guvner over
here; if you don't have (or want) Yanfly's
Plugin Commands Switches & Variables plugin (or equivalent) then I think you could use a script call each frame to update the display area to match the variable value, e.g. something like this?
Spoiler: Script command (untested)
Code:
var id = 1; // picture ID
// top-left coordinates of display area from "reel" picture
var x = 0;
var y = $gameVariables.value(4);
// width/height of reel display (fixed)
var width = 250;
var height = 120;
$gameScreen.picture(id).setCrop(x, y, width, height);
You'd need a picture with 4 "rows" (e.g. Miss, Hit, Yeah, Miss) so it'll wrap correctly from top to bottom. You can use the
Mod operator of Control Variables in order to get the remainder after dividing by a number, that way you can ensure your y-value always stays between 0 and "3 reel heights". For instance, 17 Mod 5 returns 2, because 17/5 = 3 remainder 2. It's the same principle as used in telling the time, e.g. 5 hours after 11 am is 4 pm: 16 mod 12. The "update variable each frame" part of your event might then look like this, assuming your reels are each 120 px high:
Code:
◆Comment:Increase by "reel speed per frame"
◆Control Variables:#0004 Input += 8
◆Comment:Wrap around to zero if value exceeds three reel heights
◆Control Variables:#0004 Input %= 360
I.e. each frame, +8 to the variable, then mod 360 to ensure it doesn't go "off the bottom" of the image. You'll probably want to replace those numbers to match your desired speed and image height.
😮💨
Hope all that helps, at least a bit~
😂