Rakugo-Dialogue-System icon indicating copy to clipboard operation
Rakugo-Dialogue-System copied to clipboard

Add Arrays to RakuScript

Open Jeremi360 opened this issue 1 year ago • 0 comments

It will be usefull for example inventory in game. I think we need to make it easy to discover/use arrays, because from what I discovered hacking many amateur games in Ren'Py, people don't know about arrays.

array empty_array # []
array invetory "crowbar" "key" # ["crowbar", "key"]
invetory += "knob" # ["crowbar", "key", "knob"]
invetory -= "key" # ["crowbar", "knob"]
invetory += ["light", "pan] # ["crowbar", "knob", "light", "pan]
invetory -= ["light", "pan] # ["crowbar", "knob"]
invetory[1] # => "knob"
invetory[1] = "key" #  ["crowbar", "key"]

if "knob" in invetory # => true
# or/add maybe:
if invetory has "knob" # => true

# multiline array
array invetory:
  "crowbar" "key"

# empty line ends mulitline array def

Jeremi360 avatar Oct 28 '23 07:10 Jeremi360