Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Items on multiple pages

9 years ago

How can I make items appear on multiple pages? Do I have to make more than one item, or can I make the same item appear multiple times?

Items on multiple pages

9 years ago
Why? What are you trying to do?

Items on multiple pages

9 years ago

I am making a game with weapons and armor that are not supposed to be specific. For example, there are wood swords, stone swords, copper swords, etc. I don't want to have only one of each sword, but I don't want to make a whole bunch of each item.

Items on multiple pages

9 years ago
You dont want only 1 as in they should be able to carry more than one of the same, or as in they should be able to find it in different places?

Items on multiple pages

9 years ago

Both.

Items on multiple pages

9 years ago
You can use on page variable tricks on item descriptions (like what Quiller says below). So you can have one item in inventory, then a variable that counts how many of them you have.

Honestly, it's better to just give players items using $ITEMSTATE rather than having them pick them up though. It saves time and gives you more control.

Items on multiple pages

9 years ago

Would it be easier to add an item variable, and assign an item to each number? Then I could have a normal item called inventory that shows what I have. Would that work?

Items on multiple pages

9 years ago
If you use only one variable, then you could only have one type of item at a time. On the other hand, you could make a variable for every type of item and then make an item that just lists what the player has in their inventory, but then you need to script an entire customized inventory from scratch.

It's a lot of work, but it's also a lot more flexible than the in-game inventory system, so it's up to you really.

You can use custom links if you really want the player to be able to pick stuff up (which is what I used here to give the player skills and items).

Check out Zikara's guide to making a custom inventory if you want to go that route. It shows you how to do a lot of the things you need.

Items on multiple pages

9 years ago

That seems like a lot of work, but I'll try. Thank you, this was very helpful (even though the images on your testing game wouldn't show up for me).

Items on multiple pages

9 years ago

It's really a lot easier if you just make multiples of that item.

But if you want really items to be able to stack, like (Wood Sword x 5), then you could always make the wooden sword $ITEMSTATE1, mark the item as undroppable, and then add a new variable called %WOODSWORD or something. Everytime the player picks up a new wood sword, include the script:
%WOODSWORD := %WOODSWORD + 1

If they lose one of those swords, include the script:
%WOODSWORD := %WOODSWORD - 1

Then on your global page script, have this piece of code:

IF %WOODSWORD > 0 THEN
$ITEMSTATE1 := 1
ELSE
$ITEMSTATE1 := 0

Then in the item description, you can have something along the lines of:
"You have %%WOODSWORD%% wood swords"
and it will display how many the player has.