Author Topic: SCI0 - Can you print an variable value in the Item's inventory description?  (Read 683 times)

0 Members and 1 Guest are viewing this topic.

Offline gumby

Re: SCI0 - Can you print an variable value in the Item's inventory description?
« Reply #15 on: February 18, 2021, 09:18:34 AM »
Here's how I do it (there may be different/better ways).  Reference the entire inventory, then update based on the index of the item in the inventory using the constant defined for the inventory item in game.sh.

To set the value:
Code: [Select]
    ((gInv at: INV_TEST_OBJECT) count: 3)

To get the value:
Code: [Select]
    (FormatPrint "count = %d" ((gInv at: INV_TEST_OBJECT) count?))
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Doan Sephim

Re: SCI0 - Can you print an variable value in the Item's inventory description?
« Reply #16 on: February 18, 2021, 09:39:29 AM »
That sounds like a pretty simple way to do it to me! Thanks.
« Last Edit: February 18, 2021, 11:09:30 AM by Doan Sephim »
Artificial Intelligence Competition


SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.11 seconds with 23 queries.