[zscript] Changing textures (and more) with zscript
Posted: Sat Mar 24, 2018 5:27 pm
I'm wanting to play an animation when a switch is pulled. These textures will always have a name such that the first 4 characters are alpha characters and the last 4 are numbers. This should let me generalize the animation code such that I don't have to manually define the animation anywhere and can use multiple different animations on different lines that all have the same tag and they will all animate across their respective animations.
To do this I would like to do the following:
To do this I would like to do the following:
- Get a side that has a particular tag
- get the texture in the middle of that side
- Split the texture name into an alpha and numeric component (ABCD1234 >> ABCD 1234)
- Add 1 to the numeric part and reattach the numeric part
- If new texture exists change the middle to the new texture, otherwise repeat steps 1-5 for the next side
- If no sides have had their textures changed return FALSE, else return TRUE