ThySpektre
TH.net Regular
- Reaction score
- 10
Hello,
To make certain decision trees/looping structures easier, is there anyway to reference an item type via string variables?
For example (this is SIMPLIFIED and I know you could do this quite easily another way. Please think about the many item case)
Let's say I wanted to give a different items to a unit based on the season of the year and the time of day. I have the 4 seasons defined in game and the day split into Morning, Afternoon, Evening, Night.
I have triggers that set two string variables throughout the game at the proper times named:
strSeason and strTOD.
to the values: "Spring", "Summer", etc...
Is there anyway to name my items smartly like ItemSpringMorning, ItemFallNight, ItemFallAfternoon, etc, and then refernce them in triggers?
Something like:
Give Hero Item Item + strSeason + strTOD.
I know how to do this with 16 condition statements, was wondering if there was a better way.
ThySpektre
PS: I am asking this for in general, I realize for a temporal based trigger I could change an item type variable when I update the string variables, but I am looking for the general case of referring to item types via strings.
To make certain decision trees/looping structures easier, is there anyway to reference an item type via string variables?
For example (this is SIMPLIFIED and I know you could do this quite easily another way. Please think about the many item case)
Let's say I wanted to give a different items to a unit based on the season of the year and the time of day. I have the 4 seasons defined in game and the day split into Morning, Afternoon, Evening, Night.
I have triggers that set two string variables throughout the game at the proper times named:
strSeason and strTOD.
to the values: "Spring", "Summer", etc...
Is there anyway to name my items smartly like ItemSpringMorning, ItemFallNight, ItemFallAfternoon, etc, and then refernce them in triggers?
Something like:
Give Hero Item Item + strSeason + strTOD.
I know how to do this with 16 condition statements, was wondering if there was a better way.
ThySpektre
PS: I am asking this for in general, I realize for a temporal based trigger I could change an item type variable when I update the string variables, but I am looking for the general case of referring to item types via strings.


