Skip to content

Set a "divert" variable from gdscript? #62

Answered by ephread
mlinden87 asked this question in Q&A
Discussion options

You must be logged in to vote

Is there a way to make this work? Found an old discussion for Unity, that offered a way by changing the Path class, but how about Godot?

Yes,Path exists in inkgd as well, it's in ink_path.gd (to prevent collisions with the native Path type).

var InkPath := load("res://addons/inkgd/runtime/ink_path.gd") as GDScript

var random_knot_1 = InkPath.new_with_components_string("awesome_knot_z")

_ink_player.set_variable("option_1_divert", random_knot_1)

Note that creating paths that point to gathers outside of the runtime is tricky because gathers are usually one container deeper than expected. For instance, this divert:

VAR divert = -> knot.stitch.gather

uses the following path:

var divertPath = 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mlinden87
Comment options

Answer selected by ephread
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants