I tried using get catalog field value, the ability as entry, then InfoArray[Train + number + ].Unit[0] as field path.
This surely works for some abilities, but the problem is i can not know the range of that number.
If i test some train field that doesn't exist, such as InfoArray[Train20], it throws trigger error.
Even worse thing is the index is not continuous for some ability, for example, FactoryTrain has Train2, Train5 and Train6.
Someone help me! All i want is inputting ability (like, "BarracksTrain"), it outputs trainable units (like, "Marine", "Marauder", ...)
I found a way: upon game init, simply iterate from InfoArray[0] to InfoArray[29], or InfoArray[Train1] to InfoArray[Train30]
this doesn't produce trigger error ( or is it just not shown ? )
Do this for every CAbilTrain ability in catalog and cache the result to map ability -> unit type.
I tried using get catalog field value, the ability as entry, then InfoArray[Train + number + ].Unit[0] as field path. This surely works for some abilities, but the problem is i can not know the range of that number.
If i test some train field that doesn't exist, such as InfoArray[Train20], it throws trigger error. Even worse thing is the index is not continuous for some ability, for example, FactoryTrain has Train2, Train5 and Train6.
Someone help me! All i want is inputting ability (like, "BarracksTrain"), it outputs trainable units (like, "Marine", "Marauder", ...)
I found a way: upon game init, simply iterate from InfoArray[0] to InfoArray[29], or InfoArray[Train1] to InfoArray[Train30] this doesn't produce trigger error ( or is it just not shown ? )
Do this for every CAbilTrain ability in catalog and cache the result to map ability -> unit type.