I'm trying to create an input that will set a property on a token that has the languages known by the player.
So the input and subsequent if statements set the correct languages picked. But in order to get the current languages set then I need to use a getProperty statement but when I do it returns all of the languages separated by ##. I can't figure this. Any thoughts?
Here is the code
Code:
[h: fail = input(
"Abyssal|0|Abyssal|CHECK",
"Common|0|Common|CHECK",
"DeepSpeech|0|Deep Speech|CHECK",
"Draconic|0|Draconic|CHECK",
"Dwarven|0|Dwarven|CHECK",
"Elven|0|Elven|CHECK",
"Giant|0|Giant|CHECK",
"Goblin|0|Goblin|CHECK",
"Primordial|0|Primordial|CHECK",
"Supernal|0|Supernal|CHECK"
)]
[h: abort(fail)]
[h: tlanguage = getProperty("Languages")]
[h, if(Abyssal==1): tlanguage = listAppend(tlanguage, "Abyssal")]
[h, if(Common==1): tlanguage = listAppend(tlanguage, "Common")]
[h, if(DeepSpeech==1): tlanguage = listAppend(tlanguage, "DeepSpeech")]
[h, if(Draconic==1): tlanguage = listAppend(tlanguage, "Draconic")]
[h, if(Dwarven==1): tlanguage = listAppend(tlanguage, "Dwarven")]
[h, if(Elven==1): tlanguage = listAppend(tlanguage, "Elven")]
[h, if(Giant==1): tlanguage = listAppend(tlanguage, "Giant")]
[h, if(Goblin==1): tlanguage = listAppend(tlanguage, "Goblin")]
[h, if(Primordial==1): tlanguage = listAppend(tlanguage, "Primordial")]
[h, if(Supernal==1): tlanguage = listAppend(tlanguage, "Supernal")]
[h: setProperty("Languages", tlanguage)]
[r: tlanguage]
If I select Abyssal and common then the token property ends up looking like this
Code:
Abyssal=1 ## Common=1 ## DeepSpeech=0 ## Draconic=0 ## Dwarven=0 ## Elven=0 ## Giant=0 ## Goblin=0 ## Primordial=0 ## Supernal=0 ##, Abyssal, Common