Hello
I'm sorry if this is a very noobish question, but i'm having a hard time understand arrays in general, so here goes.
I'm trying to make a "trait" system, with different ranks, so say your character has 3 levels of a given trait, namely "Strength", which goes like this "nStr, Str1, Str2, Str3", where nStr represents not having the trait at all.
How could i include something like this in an array, so i can merely print all of your characters traits in one go, like a list? example: $traitlist
If we say that there also exist a leveled traits for Dexterity and Intelligence, then a printed example would look something like this:
Traits = $traitlist ==> Traits = Str2, Dex1, Int3
and in case you had nStr (which is not having the trait at all, then it would look like this:
Traits = $traitlist ==> Traits = Dex1, Int3
It would also be fine if there was an way to make an array where you could just throw in objects and take them out. I am not too keen on widgets, and i would very much appreciate it if it was kept simple.
Thank you very much.
ps
I read the Sugarcube document, but couldn't find anything helping with something like this.
I'm sorry if this is a very noobish question, but i'm having a hard time understand arrays in general, so here goes.
I'm trying to make a "trait" system, with different ranks, so say your character has 3 levels of a given trait, namely "Strength", which goes like this "nStr, Str1, Str2, Str3", where nStr represents not having the trait at all.
How could i include something like this in an array, so i can merely print all of your characters traits in one go, like a list? example: $traitlist
If we say that there also exist a leveled traits for Dexterity and Intelligence, then a printed example would look something like this:
Traits = $traitlist ==> Traits = Str2, Dex1, Int3
and in case you had nStr (which is not having the trait at all, then it would look like this:
Traits = $traitlist ==> Traits = Dex1, Int3
It would also be fine if there was an way to make an array where you could just throw in objects and take them out. I am not too keen on widgets, and i would very much appreciate it if it was kept simple.
Thank you very much.
ps
I read the Sugarcube document, but couldn't find anything helping with something like this.