Get the name of what's inside a TextureID as a string

Moderator: GZDoom Developers

Post Reply
HeXaGoN
Posts: 161
Joined: Sat Dec 04, 2010 3:07 pm
Location: Texas, United States

Get the name of what's inside a TextureID as a string

Post by HeXaGoN »

Right now in ZScript, we can check if a TextureID variable contains a particular texture.
This is fine if you want to check for a particular texture, but what if you don't? What if you actually need to see what the texture is?

Right now, for example, if you want to make a footstep script in ZScript without defining a sound for every single flat, and instead just want to see if the texture has some prefix like "METAL" at the beginning and play a metallic step sound, you can't.
(this is just an example, I am well aware of [wiki]GetActorFloorTexture[/wiki]'s existence, so please don't just say "just do it in ACS")
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Get the name of what's inside a TextureID as a string

Post by _mental_ »

So in short you want a new static function String GetName(TextureID tex) in TexMan class, right?
It's fairly easy to add, don't know why there is no such function. Maybe no one asked about it before.
HeXaGoN
Posts: 161
Joined: Sat Dec 04, 2010 3:07 pm
Location: Texas, United States

Re: Get the name of what's inside a TextureID as a string

Post by HeXaGoN »

Yes, that's exactly what I want. Sorry if I worded my request poorly.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Get the name of what's inside a TextureID as a string

Post by _mental_ »

Added in f40a314.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”