inkle / inkle/ink

[Question] Accessing Lists

Open
#338 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.9k
Forks
540
PR merge metrics
No merged PRs in 30d

Description

I'm not sure if I'm accessing a list correctly. I'm having no issues with my other global vars.

in ink :
**LIST speakers = GM, MADELINE, BEN**

in Unity c#:

InkList speakers = (InkList)story.variablesState["speakers"];

foreach(KeyValuePair speaker in speakers)
{
InkListItem item = speaker.Key;
Debug.Log("what is the key: " + item.fullName + ", what is the value: " + speaker.Value + "");
}

speakers is always null.

Although I have no issues accessing a InkListItem if it's assigned to another variable in .ink. eg.

ink:
VAR activeSpeaker = speakers.GM

Unity c#:
foreach (KeyValuePair item in activeSpeaker)
{
Debug.Log("Speaker Update: " + item.Key.itemName + "");

}

thanks in advance!
Shaun

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.