Surface Texture

Discussions about Coding and Scripting
Post Reply
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Surface Texture

Post by Feralidragon »

Well, just one more of my questions, so anyone knows how do i get the texture info from a BSP surface?
Let's say I do a trace function and hit level geometry, of course the hit surface will have a texture, and I want to know what texture is the surface using (I don't want to change it, just take the info of it to something else)

:help: would be very apreciated
User avatar
GenMoKai
Godlike
Posts: 2896
Joined: Tue Mar 18, 2008 9:39 pm
Personal rank: Mapper
Location: Netherlands, the land of cheese and weed!

Re: Surface Texture

Post by GenMoKai »

Uhm, do you mean

Right mouse button on the surface -> Surface Properties

OR

Click with Left Mouse button on surface -> F5

OR

Click with Left Mouse button on surface -> View (you must look "Edit" and "Brush") -> Surface Properties


Or do you mean something else ? :P
Image
EAT THOSE FRIGGIN BANANAS !!!!!
1000 MPH Studios MAY NOT play any ut99.org community mappack 2 map without George W. Bush explicit permission
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Surface Texture

Post by Feralidragon »

Thanks, but I mean something really, really different:
I want to take the surface texture info from code itself (UScript), for a cool effect that I am about to do after the explosion of some nukes I am doing (simulated craters).

But thanks anyway :tu:
Myth
Inhuman
Posts: 988
Joined: Tue Feb 12, 2008 5:57 pm
Personal rank: Low Poly Freak

Re: Surface Texture

Post by Myth »

I'd say, that it's impossible whit pure Uscript.
Everything that handles footstep sounds, bsp surfaces or anything surface related are handled by built in unreal classes.
And triggered texture only swaps the ID of 2 textures.
User avatar
Shadow
Masterful
Posts: 743
Joined: Tue Jan 29, 2008 12:00 am
Personal rank: Mad Carpenter
Location: Germany
Contact:

Re: Surface Texture

Post by Shadow »

the simpliest way to do this would be using a decal to read the groundtexture:

- set up an directional trace (useful sideproducts: hitnormal,hitlocation,angles,length,hit actors,start,end of trace/surface)
- place the decal right where the hitlocation is
- let's read the groundtexture via AttachDecal and equate it with an empty texture variable (SearchedSurface = AttachDecal(TraceForwardDistance,SurfaceNormal))

I (and others too) used that method to read the groundtexture to have material dependent events (footsteps, explosions, materials etc.), we developed it for LSoNP back in '05 currently it's only partially used for the DecalProjector
Image
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Surface Texture

Post by Feralidragon »

Thanks Shadow, I knew that you know this one :tu:

That way is awsome btw, because my ideia is make a simulation of a crater (not a true one, but one that gives you the illusion that is deeper than the ground), so it will have a decal in the center too. So I make the decal in the ground by the explosion, and use it to read the ground texture at the same time, so I only use the resources needed.

Once again, thanks :gj: :rock:
User avatar
Shadow
Masterful
Posts: 743
Joined: Tue Jan 29, 2008 12:00 am
Personal rank: Mad Carpenter
Location: Germany
Contact:

Re: Surface Texture

Post by Shadow »

jo no prob, you're welcome !

well if you want I can give you the trace/decal code of the projector to make things easiear, it would be published anyway
Image
Max]I[muS-X
Novice
Posts: 20
Joined: Wed Dec 02, 2009 6:44 am

Re: Surface Texture

Post by Max]I[muS-X »

Looks like I am one year late on this thread! Actually, I stumbled across it searching for a solution to my problem, and this is the only thread I see that seems it might have one, without actually recreating the maps I intend to change. Basically, I am making a mod that converts every team based texture in the level to different colors other than red/blue. So you can choose, Blue vs Green, or Red vs Gold, etc. I have the mod finished except for changing textures on the actual geometry, such as walls. Most threads indicate this is impossible, but the AttachDecal ( ) function mentioned here intrigues me. Could I use it to find and replace textures throughout an entire level? Any help would be appreciated!
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Surface Texture

Post by Feralidragon »

Afaik this function can only read the texture, not changing it (it simply attaches the decal onto the surface, but since it returns the that surface texture, this is the best method to read it, if not the only one).
Changing the surfaces textures is another story, and that's something I want to search through the sources as well for my own project.
One thing I know is that you can set certain properties in the texture surfaces (like the footstep sounds to use them afterwards without taking any big amount of processing). And by knowing this I pretend to "study" it a bit further regarding scripted, animated and source textures, to see how far anyone could create "materials" or even change freely any texture without having it hard animated, being a wet/water/ice texture or having the same color pallete apllied.

But for now, the best man to answer that in this forum would be Shadow, since he's working severally with this kind of things in UT, so he might know already the answer you're looking for.
Max]I[muS-X
Novice
Posts: 20
Joined: Wed Dec 02, 2009 6:44 am

Re: Surface Texture

Post by Max]I[muS-X »

Oh, that's a pity. I was really hoping that is what I was looking for. I feel like there HAS to be a way, somehow, but maybe not. I know the Brush class is an Actor and it's possible to search through all Actors in the game. How does a Texture relate to a Brush class? I would assume there would be some relation since the texture is being applied to one of the faces of the Brush but then again I still can't find any connection as far as UScript code goes.

My final option would be to actually edit the maps and make each texture that I want to edit later a Scripted Texture ( or so I hear ). But I have no idea how to do that. Do you know anything about scripted textures?

P.S. You mentioned something about searching the sources... Do you have the source code to UT99?
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Surface Texture

Post by Feralidragon »

Max]I[muS-X wrote: P.S. You mentioned something about searching the sources... Do you have the source code to UT99?
I meant only the UScript side one, not the native one (no one has the c++ source of it, at least not the 436 version, which is what most matters).
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Re: Surface Texture

Post by zacman »

Try making somem kind of scripted texture, if you want it to change, and script some kind of trigger that if class "BlooFlag" colides with it, set the texture to blue mode, etc. and place this trigger over the flag Base. Not sure if it's possible, ask someone who knows something about scripted textures.
Image[url=steam://friends/add/76561198048595886]Image[/url]
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Surface Texture

Post by Feralidragon »

zacman wrote:Try making somem kind of scripted texture, if you want it to change, and script some kind of trigger that if class "BlooFlag" colides with it, set the texture to blue mode, etc. and place this trigger over the flag Base. Not sure if it's possible, ask someone who knows something about scripted textures.
I always considered the use of scripted textures way too limited, since:
1) You would have to change all the textures to scripted ones in his case;
2) Only textures with the same color pallete would work right, otherwise you might get a greyscaled texture on change or the colors just screwed up.
Post Reply