# Did arrays get added to choicescript?

**URL:** <https://forum.choiceofgames.com/t/did-arrays-get-added-to-choicescript/13108>\
**Category:** Game Development\
**Created:** [November 17, 2015, 3:03pm UTC](https://forum.choiceofgames.com/t/did-arrays-get-added-to-choicescript/13108 "2015-11-17T15:03:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hanon\_Ondricek](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/hanon_ondricek/32/95886_2.png) [@Hanon\_Ondricek](https://forum.choiceofgames.com/u/Hanon_Ondricek)\
**Post date:** [November 17, 2015, 3:03pm UTC](https://forum.choiceofgames.com/t/did-arrays-get-added-to-choicescript/13108/1 "2015-11-17T15:03:26Z")

</div>

I don’t know if I dreamed this, but I thought I read a blog post at one time that said we could use arrays. What I’m hoping to do is have a list of stuff like an inventory set inv = “apple, sword, raingoggles” and be able to present a choice if something exists in the array: if inv contains “apple”… Similarly, to manipulate the array if a player selects to eat the apple: remove “apple” from inv…

Is that even a function in CS, or am I thinking of something else?

---

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [November 17, 2015, 4:23pm UTC](https://forum.choiceofgames.com/t/did-arrays-get-added-to-choicescript/13108/2 "2015-11-17T16:23:41Z")

</div>

A short syntax for _referring_ to variables in an array-like way has been implemented, but they aren’t true arrays. You can’t currently define them together and they don’t have any associated methods or functions.

i.e.

You can’t do \*create\_array …  
You have to do…

```
*create myarray_1 "Hello"
*create myarray_2 "World"

```

You can then refer to them like this:

```
${myarray[1]} ${myarray[2]}

```

This is useful in loop-like constructs, but it hasn’t added any additional functionality to Choicescript, it has just made some things a lot easier (which is no _bad_ thing, but perhaps not quite what you were hoping for).
