inkcpp_py
Python bindings for InkCPP https://github.com/JBenda/inkcpp
Allows reading and editing inkcpp lists. !Only valid until next choose ore getline a runner referncing the corresponding global
A list flag containing the name of the flag and the corresponding list
A Value of a Ink Variable
__init__(args, *kwargs) Overloaded function.
__init__(self: inkcpp_py.Value, value: bool) -> None
__init__(self: inkcpp_py.Value, value: int, type: inkcpp_py.Value.Type) -> None
Used to explicit set a Uint32 value. Type must be inkcpp_py.Value.Type.Uint32!
__init__(self: inkcpp_py.Value, value: int) -> None
__init__(self: inkcpp_py.Value, value: float) -> None
__init__(self: inkcpp_py.Value, value: inkcpp_py.IList) -> None
__init__(self: inkcpp_py.Value, value: str) -> None
If it contains a inkcpp_py.Value.Type.List, return it. Else throws AttributeError.
If value contains a inkcpp_py.Value.Type.Int32 or inkcpp_py.Value.Type.Uint32 return the int value. Else throws AttributeError
If value contains a inkcpp_py.Value.Type.Bool, return it. Else throws a AttributeError.
If value contains a inkcpp_py.Value.Type.String, return it. Else throws an AttributeError.
If you want convert it to a string use: str(value)
.
If value contains a inkcpp_py.Value.Type.Float, return it. Else throws an AttributeError.
Globals and all assoziatet runner stored for later restoration
Converts a story.json file to a story.bin file used by inkcpp
Global variable store. Use globals[var_name]
to read/write them.
Runtime logic for a story.
Creates a snapshot from the current state for later usage.
This snapshot will also contain the global state. To reload:
>>> snapshot = old_runner.create_snapshot()
>>> story = Story.from_file("story.bin")
>>> runner = story.new_runner_from_snapshot(snapshot)
Get current choice at index.
iter(inkcpp_py.Runner) returns a iterator over all current choices.
Bind function with void result
Ceates a new runner.
Arguments:
- globals: pass a global to use, else use a new inetrnal one.
Returns:
inkcpp_py.Runner: a newly created runner, initelized at start of story
Loads a global store from a snapshot.
Returns:
inkcpp_py.Globals: a new global store with the same state then stored in the snapshot.
Reconstructs a runner from a snapshot.
Arguments:
- snapshot: snapshot to load runner from.
- globals: store used by this runner, else load the store from the file and use it. (created with inkcpp_py.Story.new_runner_from_snapshot)
- runner_id: if multiple runners are stored in the snapshot, id of runner to reconstruct. (ids start at 0 and are dense)
Returns:
inkcpp_py.Runner: at same state as before