Help - Search - Members - Calendar
Full Version: XP - Interactive Objects and Sprite Changing
RPG RPG Revolution Forums > Scripting > Event Emporium
kowbrainz
This would be a lot easier to explain if my screen capture program was working right now, but...

Basically I'm trying to create objects in a scene which the player can sit on. So if the player approaches a couch, they can hit the action button and they'll turn away from it, then sit down.

Here's my event commands so far, for sitting down and standing up respectively:





Some bugs:

  1. If you hold the button to sit down, you’ll get back up again straight away
  2. When you get up, the character moves an extra space from the couch for some reason (would have been easier to see with a video, might be able to post one later)
  3. If you hold the button after getting up, the player character will continue to “sit up” across the screen until hitting the wall, where they become stuck forever.


Anyone able to help me fix these?
Shaddow
This looks like an interesting problem, sorry I didn't notice the post earlier, but I will take a look at it.

From your screen shots it looks as though you are using XP, is this correct? The eventing in it is a bit different from VX, which is what I have, but I may still be able to fix this, but I'll see if I can't fix it straight away.

One thing I'm seeing, is you have the switch shut off within the move route, which is normally not a problem, but I believe the event is shutting off the switch before it finishes the move route. You may try taking the switch off out of the move route, and then putting in a short wait after the route finishes and then turning off the switch.

I am not 100% sure that will work, but as I can't test it myself, it is the best solution I can see from your screen shots.
kowbrainz
Okay it worked for the most part - I tried what you suggested and it fixed bugs #2 and #3, though the player still gets back up straight away if they're holding the button down. Not a big deal in comparison, but still slightly annoying.

Thanks all the same. smile.gif
Shaddow
Glad to help, I don't think there is really any way of making them not get up right away...unless you put a wait before the move event as well, which might delay it enough to stop it, but still holding down the button will result the same as spamming it.
Jens of Zanicuud
Maybe I'm too late, but I've got a nice idea to solve problem #1.
You could try replacing the condition with the Conditional Branch - Page 4 - Script condition:
CODE
Input.trigger?(Input::C)

I don't know if this will prevent your character from keeping on sitting and resuming it's position, but give it a try, I'm rather confident in this smile.gif
Why should it work? Well...
The default condition is equal to
CODE
Input.press?(Input::C)

which means "if C button is pressed and/or remain pressed, then...".
The .trigger? condition should mean "if C button is pressed once, then...".

Anyway, if you want to make your player sit on that event, you should "stop" your player, since as I can see from your screens, it's able to move even with directional arrows, while sitting...

I hope this can help,

Jens
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.