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

Args in labels and menus of RakuScript #236

Open
Jeremi360 opened this issue May 17, 2023 · 0 comments
Open

Args in labels and menus of RakuScript #236

Jeremi360 opened this issue May 17, 2023 · 0 comments
Labels
discussion need a discussion with our community enhancement New feature or request question Further information is requested RakuScript Rakugo Scripting Dialogue Langue

Comments

@Jeremi360
Copy link
Contributor

Jeremi360 commented May 17, 2023

Inspired by #235 and it shows that we need #53.
Is just way to make menu and labels be as useful as funcs in other langues.
Example:

func _ready():
  var door_script = Rakugo.parse_script("res://door.rk")

  door_a.pressed.connect(Rakugo.execute_script(door_script, "door_menu", ["door_a"]))
  door_b.pressed.connect(Rakugo.execute_script(door_script, "door_menu", ["door_b"]))
menu explore:
  "Go to door A" > door_menu("door_a")
  "Go to door B" > door_menu("door_b")
  "Go to next corridor"

menu door_menu(door_id):
  "Lock pick" show if (has_lockpics > 1) > lockpick_minigame(door)
  "Open Door" if door_id in keys > open_door(door_id)
  "Open Door" hide if door_id in closed_doors > missing_key
  "Go in" show if door_id in open_doors > door_id
  "Go Back to exploring" > explore
@Jeremi360 Jeremi360 added enhancement New feature or request question Further information is requested RakuScript Rakugo Scripting Dialogue Langue discussion need a discussion with our community labels May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion need a discussion with our community enhancement New feature or request question Further information is requested RakuScript Rakugo Scripting Dialogue Langue
Projects
None yet
Development

No branches or pull requests

1 participant