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

Inventory in one line doesn't mention worn items #508

Open
hnejfnvjojgrogjwm opened this issue Oct 12, 2022 · 4 comments
Open

Inventory in one line doesn't mention worn items #508

hnejfnvjojgrogjwm opened this issue Oct 12, 2022 · 4 comments

Comments

@hnejfnvjojgrogjwm
Copy link

If the game shows the inventory all in one line, there is no information regarding worn items.
I use the one line inventory because there are many objects in my game and not too many lines of text to display as the graphic area is quite big.
The player can't know if is wearing certain items or not because that information is missing.
Moreover, having the worn items on a separated line would be amazing. Something like:

You have an apple, an orange, and a bicycle.
You are wearing: a clown nose and a hat.

@joshgoebel
Copy link

joshgoebel commented Oct 15, 2022

IIRC it's possible to implement these type of customizations yourself, of course.

@hnejfnvjojgrogjwm
Copy link
Author

I wish I knew how. Anyway, I think this is a feature that should work on Adventuron by default.

@joshgoebel
Copy link

https://github.com/joshgoebel/island_adventure/blob/main/island.adv#L3097

This is for the release/stable version, not the BETA... but it shows you the broad strokes.

@ainslec
Copy link
Owner

ainslec commented Oct 16, 2022

I'm not going to "fix" this right now as the workaround will suffice for now, I'll leave this open and try to generalize some solution in the theme.

Josh's solution is good.

Here is another one just using iterators and the append and print commands.


start_at = my_location

locations {
   my_location : location "You are in a room.";
}

objects {
   
   wallet : object "a wallet" at = "inventory" ;
   pen : object "a pen" at = "inventory" ;
   coins : object "some coins" at = "inventory" ;
   hat : object "a hat" at = "inventory" initially_worn = "true" ;
   coat : object "your coat" at = "inventory" initially_worn = "true" ;
   
}

on_command {
   
   : match "inventory _"  {
   
   
      : append "You are carring ";
      
      : if (count "_inventory_notworn" > 0) {
         : iterate "_inventory_notworn"  {
            : if (is_final_iteration()) {
               : append " and ";
            }
            : else_if (!is_first_iteration()) {
               : append ", ";
            }
            : append (d(item()));
         }
         : print ".";
      }
      : else {
         : print "You are holding nothing.";
      }
      
      : append "You are wearing ";
      : if (count "_inventory_worn" > 0) {
         : iterate "_inventory_worn"  {
            : if (is_final_iteration()) {
               : append " and ";
            }
            : else_if (!is_first_iteration()) {
               : append ", ";
            }
            : append (d(item()));
         }
         : print ".";
      }
      : else {
         : print "You are wearing nothing (oh-dear!).";
      }
   }
   
}



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants