AmMitch

Villager
Member
Joined
Dec 10, 2020
Messages
6
Reaction score
6
First Language
English
Primarily Uses
RMMV
Hey All!

My inventory screen is a separate map to which the player is transferred and returned- creating an 'opening' and 'closing' effect. For now I'm using 'tab' as the key that will transfer the player (open/close the inventory screen.) I've got everything working fine with the transfer and the return with one frustrating exception- for some reason the *very first* time tab is pressed, nothing happens. On the second keypress it works perfectly and with no delay/lag, and from then on any subsequent times it works perfectly as well- including returning from the Inventory screen map using the same call. I've tried swapping between Input.isTiggered and Input.isPressed, and they both operate the same way precisely, meaning they work as intended every other time except the very first time.

It seemed likely to me that one of the other events on the map might be causing this initial delay, so I also tried it from an entirely clean map (event-free) to test it, and it still behaves exactly the same way. First time tab is pressed nothing happens, then every other time it works fine. It needs to run parallel (for the record it does the same thing set to autorun even though the player can't move otherwise) but I tried switching around the priority, and it acts the same way.

Anyone had any similar issues, or have any thoughts? I know it's very likely I could be missing something simple, so I appreciate your patience in advance if that is the case!! Thanks so much, all, for your time/help!!
 

Attachments

  • Script Call Capture.PNG
    Script Call Capture.PNG
    104.8 KB · Views: 8
  • Capture Player Return.PNG
    Capture Player Return.PNG
    87.5 KB · Views: 8
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
36,278
Reaction score
9,702
First Language
German
Primarily Uses
RMMV
I think you should completely restructure the event, because as it is it has a very big disadvantage:

you would need a map event to transfer the player to the inventory on every map, and that is very error prone.


the better way to do this would be to have a common event running as that wouldhandle every map.
however as said that will require some restructuring because it would also run on the inventory map as well.

I would use it with a switch for "player on inventory ON/OFF" and a conditional branch inside the keycheck to see if the player should be trnasferred to inventory (if off) or to the last stored position (if on).

This change in the structure alone might solve your problem, because currently you are using two different scripts for the key check, scripts that have a different behaviour.

so make the changes, test again and report back here with the changed events if there are still problems.
 

AmMitch

Villager
Member
Joined
Dec 10, 2020
Messages
6
Reaction score
6
First Language
English
Primarily Uses
RMMV
I think you should completely restructure the event, because as it is it has a very big disadvantage:

you would need a map event to transfer the player to the inventory on every map, and that is very error prone.


the better way to do this would be to have a common event running as that wouldhandle every map.
however as said that will require some restructuring because it would also run on the inventory map as well.

I would use it with a switch for "player on inventory ON/OFF" and a conditional branch inside the keycheck to see if the player should be trnasferred to inventory (if off) or to the last stored position (if on).

This change in the structure alone might solve your problem, because currently you are using two different scripts for the key check, scripts that have a different behaviour.

so make the changes, test again and report back here with the changed events if there are still problems.

This, is such an amazing idea!! And makes a TON of sense. This is my first game, and although I've come very far with it, sometimes it takes me a while to deduce the smartest way to go about things- which I'm sure is true of all programming!

Thank you so much for this incredibly helpful response, I feel instinctively I will be successful with this method- but I will definitely let you know.

:)
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,673
Reaction score
2,760
First Language
EN
Primarily Uses
RMMZ
Also, "tab" might be an odd case given its usual functionality (moving focus through elements of the document). There's no default gamepad button mapped to that input, either...it'd be nice to allow players to use a gamepad/controller if they like~

I'd consider one of these, since I don't think they're used on the map by default (?):
  • "pageup" - represents Q, PageUp, or gamepad LB; or
  • "pagedown" - represents W, PageDn, or gamepad RB.
However, in those cases you can just use the built-in checks, no scripting required.
 

AmMitch

Villager
Member
Joined
Dec 10, 2020
Messages
6
Reaction score
6
First Language
English
Primarily Uses
RMMV
Also, "tab" might be an odd case given its usual functionality (moving focus through elements of the document). There's no default gamepad button mapped to that input, either...it'd be nice to allow players to use a gamepad/controller if they like~

I'd consider one of these, since I don't think they're used on the map by default:
  • "pageup" - represents Q, PageUp, or gamepad LB; or
  • "pagedown" - represents W, PageDn, or gamepad RB.
However, in those cases you can just use the built-in checks, no scripting required.
This is absolutely an option and was 100% my fallback. I just really like the idea of using tab, but in the end of course functionality will be the priority. Thanks so much for your help! :D
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
2,828
Reaction score
2,170
First Language
Portuguese - Br
Primarily Uses
RMMZ
[edit] too slow! xD

Hi there!
I did try it on a clean project here, and indeed there is this issue with the TAB button.
But when I switched it to "ok" instead of "tab" it worked fine.
So maybe it's better if you use one of the keys that are already mapped on the conditional branch?
1652975606069.png
 

AmMitch

Villager
Member
Joined
Dec 10, 2020
Messages
6
Reaction score
6
First Language
English
Primarily Uses
RMMV
[edit] too slow! xD

Hi there!
I did try it on a clean project here, and indeed there is this issue with the TAB button.
But when I switched it to "ok" instead of "tab" it worked fine.
So maybe it's better if you use one of the keys that are already mapped on the conditional branch?
View attachment 226785
Definitely an option- thank you so much for your help!! :D
 

AmMitch

Villager
Member
Joined
Dec 10, 2020
Messages
6
Reaction score
6
First Language
English
Primarily Uses
RMMV
I think you should completely restructure the event, because as it is it has a very big disadvantage:

you would need a map event to transfer the player to the inventory on every map, and that is very error prone.


the better way to do this would be to have a common event running as that wouldhandle every map.
however as said that will require some restructuring because it would also run on the inventory map as well.

I would use it with a switch for "player on inventory ON/OFF" and a conditional branch inside the keycheck to see if the player should be trnasferred to inventory (if off) or to the last stored position (if on).

This change in the structure alone might solve your problem, because currently you are using two different scripts for the key check, scripts that have a different behaviour.

so make the changes, test again and report back here with the changed events if there are still problems.

It works!!!!! (Of course!) Many, many thanks!
 

Latest Threads

Latest Profile Posts

Messing around with fragment shaders (filters). This thing is HUGE and I'm surprised almost no one makes good use of. Even the number of plugins that do this stuff are limited.
ScreenShot_6_28_2022_3_2_40.png

There's 7 main areas in the game that are all connected. This train get's you from an underground lab to the center of someone's subconscious. inside the train you can talk to some of the passengers. but going to the top of it, there's battles.
Speedrunning all character portraits just so they all have the same quality. Not sure if this was a good idea, but now I'm almost done.
We now have a gameplay video!
DrBuni wrote on Akiritas's profile.
That is a cute Link picture, reminds me of the Samurai Jack artstyle.

Forum statistics

Threads
123,151
Messages
1,154,416
Members
161,498
Latest member
lennonmchugh01
Top