Multiple Inventory Items: Difference between revisions
From Sierra Wiki
Jump to navigationJump to search
m 1 revision imported |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<div align="center"><span style="font-size: 22pt">Multiple Inventory Items</span><br /> | <div align="center"><span style="font-size: 22pt">Multiple Inventory Items</span><br /> | ||
''By [[ | ''By [[Andrew Baker|Andrew Baker]]''</div> | ||
| |
Latest revision as of 19:14, 1 April 2025
To give the player the ability to carry around more than one of each particular item, first the name of an item is added as a variable in defines.txt:
#define moss v60
A new logic is called from Logic.000 at the end of every cycle.
call(200);
In the body of the new logic:
Code:
#include defines.txt
if (moss > 0 && !has("moss"))
{
get("moss");
}
if (moss == 0 && has("moss"))
{
drop("moss");
}
For description in the view editor of the inventory:
You have %v60 pieces of moss.
The variable should be prefix with %
to have it print out with the show.obj()
description or to embedded it in a string (i.e. print("You have %60 pieces of moss");
).