Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple errors with inventory items look and use #153

Closed
balloonpopper opened this issue Mar 3, 2022 · 2 comments · Fixed by godot-escoria/escoria-demo-game#556
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@balloonpopper
Copy link

balloonpopper commented Mar 3, 2022

Describe the bug
Sorry, I know I'm combining bugs here, but I have trouble separating the issues.
Issues :

  • Cant combine pen and paper
  • Player changes direction when looking at the (picked up) pen but stays still
  • Player moves but doesn't change direction when looking at the (picked up) paper
  • Use action stays "stuck" on after clicking on "use paper"

To Reproduce
I've attached a zipfile with my source as I can't figure out what I've set up wrongly with my inventory items to list steps to reproduce it.

  1. Use demo Room 5
  2. Set up pen and paper with use interactions. Both items do not have 1 way interactions selected.
  3. Pen has
:look
say player "It's a pen."
stop

:pickup
# Add the pen to the inventory
inventory_add r5_pen
# Hide the pen graphic in the room
set_active r5_pen false
stop

# This only works if you add "use" as a "Combine when Selected Action in" action
# to both the pen and empty_sheet ESCitems.
:use r5_empty_sheet
# Dont let the player interrupt the sequence
accept_input SKIP
inventory_remove r5_pen
inventory_remove r5_empty_sheet
say player "Hmmm..."
say player "Name..."
say player "Address..."
inventory_add r5_filled_sheet
# Allow player interaction again
accept_input ALL
stop

  1. Paper has
# You can only combine the pen and paperif you add "use" as a "Combine when Selected Action in" action
# to both the pen and empty_sheet ESCitems.
:look
say player "It's an application form for a job as an adventurer."
stop

:pickup
inventory_add i/r5_empty_sheet 
set_active r5_empty_sheet false
stop
  1. Run game. Pick up both objects.
  2. Use pen with paper.
  3. The player will walk to the "paper"'s location and stay facing whichever way they were walking.
  4. This error is printed
 2022-3-3T132225 (W)	Warnings in file ESCActionManager.activate: Invalid action on item
Trying to combine object r5_pen with r5_empty_sheet, but r5_empty_sheet is not in inventory.

Attempting to use the paper with the pen, I get as far as clicking "use" on the "paper". The player walks to the paper's ESClocation and this is printed

 2022-3-3T132053 (W)	Warnings in file ESCActionManager.activate: Invalid action on item
Trying to run use on object r5_empty_sheet, but item must be in inventory.
 	
 2022-3-3T132053 (W)	Warnings in file ESCActionManager.activate: Invalid action
Event for action use on object r5_empty_sheet not found.
  1. The action text still says "use" down the botton, but not "use paper". If I now click the wrench while "use" is still active, it tries to use the paper on the wrench (without saying "use paper on wrench). The error I get is
 2022-3-3T133256 (W)	Warnings in file ESCActionManager.activate: Invalid action on item
Trying to run use on object r5_empty_sheet, but item must be in inventory.
 	
 2022-3-3T133256 (W)	Warnings in file ESCActionManager.activate: Invalid action
Event for action use on object r5_empty_sheet not found.
 	
  1. If I 'look' at the 'pen', the player stays where they are, and says "It's a pen.".
  2. If I look at the paper, the player walks to the paper's ESClocation, and says "It's an application form for a job as an adventurer."

(The player faces the wrong direction sometimes for talk animations, but that's because not all directions are defined)

Expected behavior
The above errors shouldn't happen.

Versions

Additional context

@balloonpopper balloonpopper added the bug Something isn't working label Mar 3, 2022
@dploeger dploeger added this to the 4.0.0 milestone Mar 3, 2022
@StraToN StraToN self-assigned this Mar 3, 2022
@balloonpopper
Copy link
Author

balloonpopper commented Mar 10, 2022

So the detail doesn't get lost, the cause was having the "i/" in

inventory_add i/r5_empty_sheet 

after I changed it from "set_global i/r5_empty_sheet true" to "inventory_add". The command should've been

inventory_add i5_empty_sheet 

This bug is now to look at

  • why having a "i/" in the global name caused all the other problems (walking to the esclocation when trying to use an item, the "use" action being stuck in a 'turned on' state, etc), and
  • to error if you try to add a global so that it ends up with more than one "/" in the name

@StraToN
Copy link

StraToN commented Mar 26, 2022

why having a "i/" in the global name caused all the other problems (walking to the esclocation when trying to use an item, the "use" action being stuck in a 'turned on' state, etc),

This was caused by the fact r5_empty_sheet object was not considered as being in the inventory because of this "i/" erroneous prefix), so that object was still considered as being located on the floor.

to error if you try to add a global so that it ends up with more than one "/" in the name

Fixed in godot-escoria/escoria-demo-game#556

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants