Anyone got creative ideas for making a dude sit down?

Bridgeman

Veteran
Veteran
Joined
Aug 10, 2014
Messages
121
Reaction score
18
First Language
Dutch
So I'm trying to fill my game up with lots of little cosmetic interactions... Like sitting down on a chair when you touch one. Made a sprite of a guy sitting down on a chair. Tricky part is making it functional.


See, making the hero sit down is easy enough. Made a chair event, set it to touch trigger, and if the hero touches it he changes to his "sitting down" sprite. The problem is, I can't check if the hero is -not- touching an event. So I can't change his sprite back.


I've thought of two ways I could do this. I could either put the hero's coordinates in variables, and change his sprite to normal when his coordinates do not match those of the chair. Or I could surround the chair with touch events that change the hero sprite back. Both are pretty convoluted for something as simple as sitting down on a chair. 


Maybe I'm thinking too hard about this and there's a simpler way, but I can't come up with one. Anyone have ideas?
 

jwideman

Veteran
Veteran
Joined
Oct 2, 2015
Messages
230
Reaction score
97
First Language
English
Primarily Uses
Why not just detect pushing the movement keys? You'll have to catch other keys if you want them to work, but you can put it the next page of the chair event.
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
Checking button pressing may be better anyway, because surrounding events may be triggered too late. The character would move in his sitting pose for a bit before the event triggers and changes the graphic to the walking sprite. Just have a loop inside the chair event and check for all direction and, if you want, the menu. Since you're using RPG Maker 2000/2003, make sure to have some wait frame(s) inside the loop so the lag is reduced. (I think in MV this isn't an issue anymore.)
 
Last edited by a moderator:

Bridgeman

Veteran
Veteran
Joined
Aug 10, 2014
Messages
121
Reaction score
18
First Language
Dutch
I thought about doing this, tried it out. It looks like I don't even need a loop. I just put a key input and change the hero graphic after that. 


By the way, do you know if you can re-use the same variable for key inputs throughout the game? I'd rather not make a special variable just for this one chair. 
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
As long as you make sure it is reset properly, sure, why not. :) Variables only store a number after all, not more and not less. There is no such thing as global vs. local variables or scope in RPG Maker.
 
Last edited by a moderator:

Bridgeman

Veteran
Veteran
Joined
Aug 10, 2014
Messages
121
Reaction score
18
First Language
Dutch
Okay, found a problem with this method... If you have an action key triggered event right in front of the chair, say, a book on a table, it doesn't work while sitting on a chair. I can't enable the action key button in the chair event, because if I do that than the variable will be set to a number that does not correspond to one of the arrow keys. And then if you move, you stay in the "sitting down" sprite. But if I don't enable the action key, then I can't interact with the book while sitting down, which is dumb. 


This is getting pretty frustrating...
 

jwideman

Veteran
Veteran
Joined
Oct 2, 2015
Messages
230
Reaction score
97
First Language
English
Primarily Uses
Without knowing what you're doing with the variable you mention, it's hard to understand what the problem is.
 

Bridgeman

Veteran
Veteran
Joined
Aug 10, 2014
Messages
121
Reaction score
18
First Language
Dutch
The variable for the key input. When a key is pressed, the number corresponding to that key is stored inside the variable you selected. If I'm sitting on the chair, and I press the enter key, it stores the number "5" in that variable, while the arrow keys correspond to numbers 1-4. Since it's a touch event, it only stores the variable once when a key is pressed, and so if enter is pressed, and you then press the arrow keys, it doesn't store the numbers of the arrow keys in the variable. Which means the sprite doesn't change back. 
 

jwideman

Veteran
Veteran
Joined
Oct 2, 2015
Messages
230
Reaction score
97
First Language
English
Primarily Uses
Can you screenshot your chair event and post it?
 

jwideman

Veteran
Veteran
Joined
Oct 2, 2015
Messages
230
Reaction score
97
First Language
English
Primarily Uses
I'm thinking you can add a branch for the key input to be 5, and put your event interaction code there.
 

Bridgeman

Veteran
Veteran
Joined
Aug 10, 2014
Messages
121
Reaction score
18
First Language
Dutch
If I set the variable back to 0 in the conditional branch that checks if the Enter key is pressed, and I wrap the whole thing in a loop, that actually works. But only if I add the dialog from the event on the table to the chair event itself. Kinda wanted to avoid that, but I guess there's no choice.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,195
Members
137,773
Latest member
Kirakirna
Top