# Need help makeing a inventory for my game

**URL:** <https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458>\
**Category:** ChoiceScript Help\
**Created:** [December 21, 2017, 5:49am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458 "2017-12-21T05:49:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crav\_Stienbak](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/crav_stienbak/32/9323_2.png) [@Crav\_Stienbak](https://forum.choiceofgames.com/u/Crav_Stienbak)\
**Post date:** [December 21, 2017, 5:49am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/1 "2017-12-21T05:49:53Z")

</div>

I always get a choicescript\_stats line 9: Non-existent variable 'smg\_suppressed error pls help

---

<div class="post-metadata">

**Author:** ![EclecticEccentric](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/eclecticeccentric/32/112816_2.png) [@EclecticEccentric](https://forum.choiceofgames.com/u/EclecticEccentric)\
**Post date:** [December 21, 2017, 5:50am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/2 "2017-12-21T05:50:39Z")

</div>

Can you post your code?

---

<div class="post-metadata">

**Author:** ![Crav\_Stienbak](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/crav_stienbak/32/9323_2.png) [@Crav\_Stienbak](https://forum.choiceofgames.com/u/Crav_Stienbak)\
**Post date:** [December 21, 2017, 5:52am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/3 "2017-12-21T05:52:10Z")

</div>

This is under startup

```
*title The Pains Of War
*author Crav Steinbak
*scene_list
   startup
   Chapter_1
*create name "undetermined"
*create gender "undetermined"
*create rank "undetermined"
*create age "20"
*create inventory
*create willpower 50
*create control 50
*create perception 50
*create cqc 50
*create smg_suppressed false
*create stun_grenade false

```

this is under variables

```
*create willpower 50
*create control 50
*create perception 50
*create cqc 50
*create name "undetermined"
*create rank "undetermined"
*create age "20"
*create gender "undetermined"
*create inventory
*create smg_suppressed false
*create stun_grenade
*label gender
*if (gender = "male")
*set male "male"
 *goto nationality
*if (gender = "female")
*set female "female"

```

this is under choicescript

```
10/10 will look at my stats again
*stat_chart
   text name
   text gender
   text rank
   text age
*temp inventory ""
*temp comma false
*if (smg_suppressed != true)
   *set inventory &"smg_suppressed"
   *set comma true
*if (stun_grenade)
   *if comma
   	*set inventory &", "
   *set inventory &"stun_grenade"
   *set comma true
inventory: ${inventory}.
   percent perception
   percent willpower
   percent control
   percent cqc

```

---

<div class="post-metadata">

**Author:** ![EclecticEccentric](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/eclecticeccentric/32/112816_2.png) [@EclecticEccentric](https://forum.choiceofgames.com/u/EclecticEccentric)\
**Post date:** [December 21, 2017, 5:55am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/4 "2017-12-21T05:55:43Z")

</div>

Can you try using ````` at the top and bottom of your code so the indentation is preserved in the forum?

---

<div class="post-metadata">

**Author:** ![Carlos.R](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/carlos.r/32/75837_2.png) [@Carlos.R](https://forum.choiceofgames.com/u/Carlos.R)\
**Post date:** [December 21, 2017, 5:56am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/5 "2017-12-21T05:56:09Z")

</div>

You have an if statement before you declared a variable.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [December 21, 2017, 5:58am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/6 "2017-12-21T05:58:11Z")

</div>

Hmm, can you use the `preformatted text` tag so we can see the indentation?

The button looks like `</>` on the comment toolbar.

* * *

Other than that, I notice this one on your chocescript\_stats

> [@Crav\_Stienbak](#):
>
> `*set inventory &“smg_suppressed”`

The code won’t recognize `&"smg_suppressed"`.  
Instead, try using `&"${smg_suppressed}"`.

---

<div class="post-metadata">

**Author:** ![EclecticEccentric](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/eclecticeccentric/32/112816_2.png) [@EclecticEccentric](https://forum.choiceofgames.com/u/EclecticEccentric)\
**Post date:** [December 21, 2017, 6:03am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/7 "2017-12-21T06:03:45Z")

</div>

`smg_suppressed` is not a string, so it will display “false” or “true.”

What error message are you getting? Can you post a screenshot?

---

<div class="post-metadata">

**Author:** ![Crav\_Stienbak](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/crav_stienbak/32/9323_2.png) [@Crav\_Stienbak](https://forum.choiceofgames.com/u/Crav_Stienbak)\
**Post date:** [December 21, 2017, 6:04am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/8 "2017-12-21T06:04:47Z")

</div>

how do i take a screen shot

---

<div class="post-metadata">

**Author:** ![EclecticEccentric](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/eclecticeccentric/32/112816_2.png) [@EclecticEccentric](https://forum.choiceofgames.com/u/EclecticEccentric)\
**Post date:** [December 21, 2017, 6:05am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/9 "2017-12-21T06:05:17Z")

</div>

It depends. Are you on a PC?

---

<div class="post-metadata">

**Author:** ![Crav\_Stienbak](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/crav_stienbak/32/9323_2.png) [@Crav\_Stienbak](https://forum.choiceofgames.com/u/Crav_Stienbak)\
**Post date:** [December 21, 2017, 6:06am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/10 "2017-12-21T06:06:12Z")

</div>

yea i am on windows 10

---

<div class="post-metadata">

**Author:** ![EclecticEccentric](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/eclecticeccentric/32/112816_2.png) [@EclecticEccentric](https://forum.choiceofgames.com/u/EclecticEccentric)\
**Post date:** [December 21, 2017, 6:10am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/11 "2017-12-21T06:10:27Z")

</div>

Use the print screen function to take the screenshot

---

<div class="post-metadata">

**Author:** ![Crav\_Stienbak](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/crav_stienbak/32/9323_2.png) [@Crav\_Stienbak](https://forum.choiceofgames.com/u/Crav_Stienbak)\
**Post date:** [December 21, 2017, 6:16am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/12 "2017-12-21T06:16:07Z")

</div>

where should i upload it

---

<div class="post-metadata">

**Author:** ![EclecticEccentric](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/eclecticeccentric/32/112816_2.png) [@EclecticEccentric](https://forum.choiceofgames.com/u/EclecticEccentric)\
**Post date:** [December 21, 2017, 6:19am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/13 "2017-12-21T06:19:26Z")

</div>

On the forum. There’s a function to upload pictures.

---

<div class="post-metadata">

**Author:** ![Crav\_Stienbak](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/crav_stienbak/32/9323_2.png) [@Crav\_Stienbak](https://forum.choiceofgames.com/u/Crav_Stienbak)\
**Post date:** [December 21, 2017, 6:25am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/14 "2017-12-21T06:25:57Z")

</div>

k i uploaded it to the forum [My error message](https://forum.choiceofgames.com/t/my-error-message/33460) heres the link

---

<div class="post-metadata">

**Author:** ![Crav\_Stienbak](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/crav_stienbak/32/9323_2.png) [@Crav\_Stienbak](https://forum.choiceofgames.com/u/Crav_Stienbak)\
**Post date:** [December 21, 2017, 6:47am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/15 "2017-12-21T06:47:23Z")

</div>

[[Album] Imgur ![](https://i.imgur.com/G0nkCLl.jpg?fb "Imgur") ](https://imgur.com/a/ah1PC)

---

<div class="post-metadata">

**Author:** ![Fiogan](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fiogan/32/215832_2.png) [@Fiogan](https://forum.choiceofgames.com/u/Fiogan)\
**Post date:** [December 21, 2017, 6:47am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/16 "2017-12-21T06:47:46Z")

</div>

> [@Crav\_Stienbak](#):
>
> k i uploaded it to the forum My error message

I scooted it over here for you so it’d all be in one place. `(:`

> [@Crav\_Stienbak](#):
>
> this is under variables

What do you mean by ‘under variables’? You only need to (and only are allowed to) `*create` variables in the `startup.txt` file. Once you’ve created a variable, you can `*set` it wherever you like, in any scene, to change the variable’s value.

---

<div class="post-metadata">

**Author:** ![Crav\_Stienbak](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/crav_stienbak/32/9323_2.png) [@Crav\_Stienbak](https://forum.choiceofgames.com/u/Crav_Stienbak)\
**Post date:** [December 21, 2017, 8:02am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/17 "2017-12-21T08:02:12Z")

</div>

well after some fiddleing around i can make the inventory be persistant on the choicescript\_stat page or have it show up for a single scene in the actual story

to bad what i want it to do is show up in the inventory and then be able to remove it after i no longer need said item and while i suppose i could have it show up in the story it just doesnt look good.

> **[Screenshot 4](https://ibb.co/48H72ms)**
>
> Image Screenshot 4 hosted in ImgBB

---

<div class="post-metadata">

**Author:** ![TimberWoolf](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/timberwoolf/32/69602_2.png) [@TimberWoolf](https://forum.choiceofgames.com/u/TimberWoolf)\
**Post date:** [December 21, 2017, 8:19am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/18 "2017-12-21T08:19:22Z")

</div>

I think you might want to take a look at this: [Concatenation | ChoiceScript Wiki | Fandom](http://choicescriptdev.wikia.com/wiki/Concatenation)

> [@Crav\_Stienbak](#):
>
> \*set inventory &“smg\_suppressed”

I’m not too sure, but I think the problem here is the `*set inventory & "smg_suppressed"` part. Can somebody please correct me if I’m wrong, but should this not be `*set inventory inventory & "smg_suppressed"`

To be honest, I don’t fully understand the problem just yet. I’ll look at it again after some caffeine makes it way to my brain.

---

<div class="post-metadata">

**Author:** ![Carlos.R](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/carlos.r/32/75837_2.png) [@Carlos.R](https://forum.choiceofgames.com/u/Carlos.R)\
**Post date:** [December 21, 2017, 8:27am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/19 "2017-12-21T08:27:57Z")

</div>

By “show up in the inventory” do you mean when you click the stats screen?  
And, are you trying to change gear from the stats screen?

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [December 21, 2017, 9:19am UTC](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458/20 "2017-12-21T09:19:02Z")

</div>

Either way works fine. They’ll give a same result.  
But ofc, `*set bla "text"&bla` will give a different one.

[Next page](https://forum.choiceofgames.com/t/need-help-makeing-a-inventory-for-my-game/33458.md?page=2)
