Print Inventory?

michaelsahn
I'd like to turn off the display that shows the map, inventory, etc. But I'd still like to use an inventory. Instead, I'd like to print the player's inventory whenever the player moves to a room.

Therefore:

1. Game display of inventory, map, etc. is off.
2. Player picks up object XXXXX. It moves to player's inventory.
3. Player moves to another room.
4. Text prints: "Player is carrying "XXXXX."
5. Player can use the inventory item by clicking on it, showing applicable verbs.

Is there a way of doing this?

Thanks again -

Mike

HegemonKhan
This (the displayment of a list, such as your Inventory) is all I can help with:

----------------------

links:

http://quest5.net/wiki/DisplayList
http://quest5.net/wiki/ScopeInventory

------------------

<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<attr name="changedparent" type="script">
DisplayList (ScopeInventory (), 0_or_1) // I think
</attr>
</object>


OR

<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<attr name="changedparent" type="script">
x=0
foreach (item_x, ScopeInventory()) {
x=x+1
msg (x + ". " + item_x)
}
</attr>
</object>

Pertex
I changed HKs script a bit to display the room description and the verb list of the objects:

      <changedparent type="script">
ShowRoomDescription()
x = 0
foreach (item_x, ScopeInventory()) {
x = x+1
msg (x + ". {object:" + GetDisplayAlias(item_x) +"}")
}
</changedparent>


Generelly it is not a good idea to use the changedparent script. You are overwriting the existing changedparent function which handles some scripts and attributes (eg enter schripts or map attributes).
I would use a turnscript and check there, if the player has moved to another room

HegemonKhan
ah good to know, thanks Pertex, I didn't realize that there was built-in coding for the changedparent, so definately don't use this, and do as Pertex said, using a Turnscript + check, instead.

(The script block is the same, and a check for whether you changed your location, but put it all inside of a Turnscript instead)

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums