RM2K3, RANDOM PICTURE X/Y COORDS

Posts

Pages: 1
Okay, for anyone who has play FFX-2...<_<...>_>
One of the subgames was a lightning tower reflex exercise where a random button would pop up randomly on the screen. You had to react fast to it and press the correct button.
My issues however is figuring out how to make it randomly place a picture ANYWHERE on the screen. (within reason) I have a 64x64 image with the buttons (different image for each keystroke button) I want the player to press correctly as they appear on screen. My problem is that they don't appear at all in my coding when I test it. So how can I get the images/pictures to randomly pop up in a different location every time on screen?

So far, I have it doing it this way:
Var Oper: (Dig Picture X) Set, Rnd (25-295)
Var Oper: (Dig Picture Y) Set, Rnd (25-225)
Show Picture: 1, Dig_Down, (V Dig Picture X, V Dig Picture Y)

Yet...nothing shows, why?
Instead of using 25 - 295, try using how many tiles across it is. So, 2 - 30 instead. It should show up then.
I need more information. You could have some other process that's erasing picture one. Your picture might be fully transparent. Check the basic stuff first. Your events may not even be triggered. Right before your show picture event, add a message box that displays the X and Y variables, and maybe add the exact same message box immediately after the show picture event. There is a disconnect somewhere in your events, because I can definitely get a picture to pop up at random grids using the three events you posted (along with a 3.0 second wait in between each cycle).
might it not also be the size of your picture? If you are using a 320x240 sized picture with the arrow/sign in the middle and it is randomly set at, say, 200 x 200 it may not show up on screen.
benos
My mind is full of fuck.
624
Usually lowering one of them does make them end up on the other side the screen.
Depending if you have a character portrait. lol dreamwalker delayed so hard, I DON'T KNOW. Demo not coming anytime soon. Just a placement when it does.

84 x 120






The picture is not fully transparent. The event does run like it should, because I can do the button pushing aspect of it (despite not knowing the button to push) The erase picture event does not occur until after you press a button since it is waiting for you to do so. @Liberty: Switching it to a smaller set of x/y coords doesn't fix things. And it is indeed a 64x64 image, its not a large one.
The funny thing is, I used this key input method for my fishing mini-game, which had a specific set of picture coordinates (160,120) and it turned out just fine. Not sure why its giving me so much trouble now to display pictures...
Your event isn't working like it should if the picture isn't being displayed. Insert debug messages after every line to determine the cause. For example:

Message Box (wait): "Randomizing (Dig Picture X) and (Dig Picture Y)
Var Oper: (Dig Picture X) Set, Rnd (25-295)
Var Oper: (Dig Picture Y) Set, Rnd (25-225)
Message Box (wait): "Dig Picture X = (Dig Picture X), Dig Picture Y = (Dig Picture Y)"
Message Box (wait): "Displaying Dig_Down picture"
Show Picture: 1, Dig_Down, (V Dig Picture X, V Dig Picture Y)
Message Box (wait): "Dig_Down picture displayed"
Message Box (wait): "Waiting for keypress"
Etc.

If what your message box displays isn't matching what you're seeing, that is where your disconnect is happening. This is how I debug complex systems in RM2K3.

Edit: Looking at your image, it could possibly be your keypress variable check. When the variable isn't 1 it is immediately erasing the picture... There isn't anything that makes it wait. One thing you can do is set a loop that checks to see if the player has pushed a button. Basically, right after you Show Picture 1, set a loop that checks a switch called "ButtonPress" or something similar. If ButtonPress=ON then break the loop. Then, whatever common event has your key input event, have it turn ButtonPress ON whenever it triggers. This is just one potential solution, without seeing the rest of your eventing. It isn't ideal but it is an effective band-aid (I prefer to keep my events running one line at a time since it is easier to de-conflict them, rather than having things run parallel to each other).
Okay, but at the start of this event (which is an autostart) the key input processing function has the 'wait until key pressed' option is activated. Does this not force it to wait before going through with the erasing picture? or am I wrong to assume this?
I didn't realize your keypress event was at the top. If that is the case, it won't even attempt to display the picture until you push a button. Are you erasing the picture further down the event upon a successful input? If so, you are basically pressing a button, displaying a picture, checking which button was pressed and, if it failed: erasing it. If it succeeded: erasing it. All in an instant. And considering the input is made before a visual prompts you which button to press... yeah. You want to prompt the player for input -after- the picture is displayed.
Yep, just figured that out just as you finished typing your response. SO...I put the displaying graphic portion all the way up top above the Key Input processing, then using the all-purpose variable twice. Once before key input to display the type of button to be pushed. And again below the key input to figure out which button you actually pressed. It works perfectly now! Thanks!
Pages: 1