Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Arrays to RakuScript #265

Open
Jeremi360 opened this issue Oct 28, 2023 · 0 comments
Open

Add Arrays to RakuScript #265

Jeremi360 opened this issue Oct 28, 2023 · 0 comments
Labels
enhancement New feature or request majorChange Add this pr to changelog and should describe it RakuScript Rakugo Scripting Dialogue Langue

Comments

@Jeremi360
Copy link
Contributor

Jeremi360 commented Oct 28, 2023

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 Jeremi360 added enhancement New feature or request RakuScript Rakugo Scripting Dialogue Langue majorChange Add this pr to changelog and should describe it labels Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request majorChange Add this pr to changelog and should describe it RakuScript Rakugo Scripting Dialogue Langue
Projects
None yet
Development

No branches or pull requests

1 participant