Inventory settings help


#1

So I’ve made the inventory variable in the stats page but I’m wondering how to put multiple items in there. Is it something as simple as
*set Inventory “bolt action rifle”
*set Inventory “knife”

Also, how would I have the mc unequip an item? Thank you in advance


#2

Like this;


*temp inventory ""
*temp comma false
*if (Emptyinventory)
    *set inventory &"Carries nothing"
    *set comma true
*if (sword)
    *if comma
        *set inventory &", "
    *set inventory &"$!{swordname}"
    *set comma true
*if (necklace)
    *if comma
        *set inventory &", "
    *set inventory &"Golden Necklace"
    *set comma true
Inventory: ${inventory}

So that’s what you put in the choicescript_stats, inventory is a text-variable, Emptyinventory is a boolean set to true as long as you don’t have any items, you have to update it when you give them something. And every item has a boolean to check if they’re true, they can also have a name to display, like you see with the sword, in which case you create another text-variable.

In order to unequip things, you need to offer that choice out in the game, as variables cannot be updated within the stat-screen (something that irks me). To unequip them, just set the boolean of the item to false.

Then when you wanna use the item, just check if the item’s boolean is true.


#3

Yeah that didn’t work, which is probably an error on my end. I swear, I’ll never get the hang of CS. :frowning:


#4

If you did it exactly like I posted then you will require the following varibles in startup;


*create inventory ""
*create Emptyinventory true
*create sword false
*create swordname "sword"
*create necklace false


#5

Ok I finally got it to work. Thanks for bearing with me.


#6

No problem, don’t despair. We’re here to help eachother. :slight_smile:


#7

Annnd now I’m having problems with the fair math for percentage stats. Do I just put the equations in game to fix?


#8

I’m not sure what you mean by that, you generally don’t use equations for fair math I don’t think… At least I’ve never done it.

This is what you do in game;


*set number %+20
*set number %-10

If you want it set to a specific value, then you don’t need to use percentage;


*set number 20
*set number 10

And this is how you display it on the stats screen;


*stat_chart
   percent Number


#9

I did exactly that for the percentage but I kept getting the error “line 20: can’t fairAdd to non-percentile value 0”


#10

What did you write on startup, how does that variable look exactly?


#11

I think you need to set it to 1, instead of 0.


#12

Yeah. Fairmath never goes to 100 or 0. And starting it at 1 would be odd – it’s made for 50 to be the starting neutral point. Start at 1, and the stat will increase really quickly but not be able to reduce at all. Maybe that’s the dynamic you want for this stat?

Otherwise you might find it makes more sense to use normal math and just display the stat as a percentage, per Muton’s point.


#13

Oh right, I didn’t consider reducing the stat, good point. Then 50 would be better. If it will only ever increase without decreasing, THEN you can start at 1.

Or if you want to start at 0, then you could set up a *gosub instead, and not use fair math, but that’s probably a bit too advanced for now.


#14

@Havenstone @MutonElite yeah I have it set up right now. Thanks for the help both of you. When Germany wins the world cup I’ll buy you both a pint