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,360
Reaction score
9,729
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,695
Reaction score
2,775
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,846
Reaction score
2,178
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 Posts

Latest Profile Posts

Today is my dad's birthday! And he's still going strong in his retirement days!
Ooh a plugin for exactly what I was looking for... DEAD LINK. DEAD LINKS EVERYWHERE.. AAAAAAAAAAAAAAAGH!!!
Current battle gameplay for Shadows of the Earth: The Vrila'an Legend
and yes... still thinking and testing various color schemes for the menu.
Note we have a progress and goals thread. You can use this to post your IGMC progress too: https://forums.rpgmakerweb.com/inde...d-progress-thread.131387/page-17#post-1286063
why is tp weird.
i just want an item that can recover TP dude :rswt2:
But no MV has to be weird.

Forum statistics

Threads
123,387
Messages
1,156,198
Members
161,838
Latest member
kandylove10
Top