GetActorFloorTexture()

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: GetActorFloorTexture()

Re: GetActorFloorTexture()

by Graf Zahl » Thu Jan 12, 2017 3:21 am

1) could be added but has far less use.
2) Yes.
3) These only read existing fields from the actor object ('actor.floorpic' and 'actor.floorterrain') and return their string representation, so they are readily accessible.

Re: GetActorFloorTexture()

by Nash » Wed Jan 11, 2017 11:31 pm

1) What about GetActorCeilingTexture?

2) Are these 3D floor friendly?

3) ZScript variants?

Re: GetActorFloorTexture()

by Graf Zahl » Wed Jan 11, 2017 5:50 pm

Added both. They will return the name of the requested info as a string, or "" if no matching actor could be found.

Re: GetActorFloorTexture()

by Fused » Mon Dec 26, 2016 12:32 pm

Hate to bump, but how is this coming along? I'm fine with either being implemented, as long as it saves the hassle of having to define every single texture.

Re: GetActorFloorTexture()

by Fused » Mon Sep 05, 2016 3:09 am

Graf Zahl wrote:No problem, but the footstep thing is a great example how NOT to do it. For that a GetActorFloorTerrain function would make much more sense because you can make the relevant assignments outside the script, and more importantly, since you can override a texture's terrain in UDMF, take that override also into account.
That works too, I was thinking something about this:

Code: Select all

...
	ActivatorSound(GetFloorSound(), 255);
...


// str probably wont even work but this is a rough example anyway
Function str GetFloorSound (void)
{
	str FloorSoundDef = StrParam(s:"STEP_", s:GetActorFloorTexture());
	str FloorSound = StrParam(l:FloorSoundDef);

	// FloorSound should NOT be identical when the LANGUAGE lump had something defined.
	if (FloorSoundDef == FloorSound)
		FloorSound = StrParam(l:"STEP_DEFAULT");

	RETURN FloorSound;
}
Of course, whatever works is fine by me.

Re: GetActorFloorTexture()

by Shadow Hog » Fri Sep 02, 2016 11:55 am

Honestly, I would like some way to quickly poll for the TERRAIN type of a given texture, yeah. Maybe (maybe) extend that to walls, in case I wanted different sounds for swinging a sword against different wall materials, or similar (although in the grand scheme of things, if I could only pick one, getting the floor's TERRAIN type would be more desirable).

Re: GetActorFloorTexture()

by Graf Zahl » Fri Sep 02, 2016 11:10 am

No problem, but the footstep thing is a great example how NOT to do it. For that a GetActorFloorTerrain function would make much more sense because you can make the relevant assignments outside the script, and more importantly, since you can override a texture's terrain in UDMF, take that override also into account.

Re: GetActorFloorTexture()

by NeuralStunner » Fri Sep 02, 2016 10:59 am

This would also be a single function call instead of potentially hundreds to check against every possibility. (I imagine string comparisons are much less costly.)

You could also use functions like [wiki]StrLeft[/wiki] to get partial matches (E.G. LAVA*), which would be very helpful for animation sequences.

GetActorFloorTexture()

by Fused » Fri Sep 02, 2016 8:57 am

Like CheckActorFloorTexture(), but instead directly retreives the floor you stand on instead of having to compare with a texture as argument.
Most useful for for example the footstep addon (http://forum.zdoom.org/viewtopic.php?f=37&t=35388), which will save a major amount of time because you wont need to make the array.
For example you could directly retreive the LANGUAGE equivelant from the retreived texture with the result instead of having to skip through the massive array.

Top