godot-escoria / escoria-issues

Central Escoria issue tracker
3 stars 0 forks source link

Using items not picked up with "Use from inventory only" shouldn't do anything or should be actionable #151

Open balloonpopper opened 2 years ago

balloonpopper commented 2 years ago

Describe the bug If you try and use the wrench in room 5 and haven't picked it up, the player still walks over to it.

To Reproduce Steps to reproduce the behavior:

  1. Play room 5
  2. Click use then on the wrench

Expected behavior Either

Versions

Additional context Two errors are printed

 2022-3-3T91441 (W) Warnings in file ESCActionManager.activate: Invalid action on item
Trying to run use on object r5_wrench, but item must be in inventory.

 2022-3-3T91441 (W) Warnings in file ESCActionManager.activate: Invalid action
Event for action use on object r5_wrench not found.

I think the second one's text is wrong. This is the same error I get if I pick up the wrench then try to use it on the correct item without having set up "combine when selected item in". I think these should result in different error texts.

BHSDuncan commented 2 years ago

Another idea might be to disallow the selection of the item in such cases so it can't be clicked on in the first place (a la Monkey Island).

@StraToN @dploeger which of the above ideas do you think fits best?

dploeger commented 2 years ago

Well actually, I'd say: all of the above? 😂

Escoria was always built to allow all possibilities so maybe actually implement all features. I could think about a preference with default replies or an item parameter to not allow using the item if it's not in the inventory to an event that's fired for that.

BHSDuncan commented 2 years ago

For now, the first two options can be accomplished via the UI (the first one is almost trivial to do, with the second requiring more GDScript).

This ties into the ticket requesting generic responses for unimplemented events in that I believe we need a way to call back into ESC via GDScript that's as easy as possible for people to understand. That's a larger ask, and will require more discussion, which is pending.

StraToN commented 2 years ago

Coding game logic in UI's game.gd is indeed possible, and is the only way at the moment. I find this ugly as well. Definitely something we'll want to deal with, but not sure we should have it for 4.0 before we find a good "fits all solution".

An item with "Use from inventory only" should not be used alone. I mean, in an object like wrench in room05, a simple :use event makes no sense as the object cannot be used alone.

For that precise case, I would log a warning upon ESC compilation when an ESC script contains a :use event with no target, although this item has "Use from inventory only" = true. NB: a :use item2 event in that ESC script means that another item (item2) can be use ON this item.

Also I remember that Monkey Island 1 does this when "using item 1 on item 2" when item1 is still on the floor:

This action order was true anywhere in Monkey Island 1 so I assume this was a choice for the whole game. Do we want this in Escoria? Or do we want to manage exceptions? WDYT?

In the 1st case: gamedev can code that logic once for all in UI's game.gd script. In the 2nd case: this is more complicated and we'll need to discuss a good way. Let's discuss :)