For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Change BSP texture dynamically

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
Post Reply
User avatar
gopostal
OldUnreal Member
Posts: 1005
Joined: Thu Jul 31, 2008 9:29 pm

Change BSP texture dynamically

Post by gopostal »

I know I'm grasping at straws but I thought I'd float this here. Is there a way to dynamically alter a normal room's texture via script after the match has started? I spent last night trying to cheat it via decoration, mover, etc and nothing was flicker-free. Is it really just not possible given the way BSP is done?

I don't want to go crazy just swap the base texture of the room once. AFAIK it can't be done but this is the place to ask.
I don't want to give the end away
but we're all going to die one day
User avatar
Krull0r
Global Moderator
Posts: 543
Joined: Sun Jul 01, 2007 4:07 pm

Re: Change BSP texture dynamically

Post by Krull0r »

What about scripted textures? I know that qcomputers can change scripted textures while triggering.

But I have no Idea how to create such a script for scripted textures.
Image
User avatar
makemeunreal
OldUnreal Member
Posts: 544
Joined: Sat Mar 23, 2013 7:51 pm

Re: Change BSP texture dynamically

Post by makemeunreal »

You should try askin' this on UT99.org too. Lots of coders there.
User avatar
gopostal
OldUnreal Member
Posts: 1005
Joined: Thu Jul 31, 2008 9:29 pm

Re: Change BSP texture dynamically

Post by gopostal »

I looked at scripted textures but there are issues with color palettes so it's not a good fit. I really need a way to declare the texture change via script and not via some nested trigger/dispatcher thing. I've seen those go wonky too many times online. I was hoping someone had figured out a hacky way to make it work. Not surprised it hasn't been done. I've been thinking on it for two days and don't see an answer.

*Edit because I can't spell.
Last edited by gopostal on Sat Aug 26, 2017 3:43 am, edited 1 time in total.
I don't want to give the end away
but we're all going to die one day
User avatar
Kajgue
Global Moderator
Posts: 756
Joined: Mon Oct 17, 2005 2:36 pm

Re: Change BSP texture dynamically

Post by Kajgue »

Only .pcx and .bmp textures need to be imported with a palette/indexed colours, .dds textures don't need a palette.
AKA - ( T : S : B ) Ice-Lizard
Image
User avatar
Masterkent
OldUnreal Member
Posts: 1469
Joined: Fri Apr 05, 2013 12:41 pm

Re: Change BSP texture dynamically

Post by Masterkent »

Is there a way to dynamically alter a normal room's texture via script after the match has started?
What do you mean by altering a texture: changing properties of the texture object itself (this would be observable in every place where the texture is used and potentially can be observable even after a map change) or attaching a different texture to a particular surface of a Brush?

The former can easily be done for 227 clients if you know the name of the texture. F.e.

Code: Select all

      local Texture Tex;
      Tex = Texture(FindObject(class'Texture', "GenEarth.ground.Grass"));
      if (Tex != none)
      {
            Tex.Palette = Palette'GenFluid.Palette179';
            ConsoleCommand("Flush");
      }
The latter most likely cannot be done by means of UScript only, albeit I can't be 100% sure, because there is a possibility that I overlooked something.
I spent last night trying to cheat it via decoration, mover, etc and nothing was flicker-free.
Decals should be flicker-free in most cases (in some cases they can flicker though). But they won't be rendered if the user disabled decals client-side, and attaching them to rotating movers probably won't work well.
User avatar
gopostal
OldUnreal Member
Posts: 1005
Joined: Thu Jul 31, 2008 9:29 pm

Re: Change BSP texture dynamically

Post by gopostal »

I had not thought of using decals. Years back I made a spray-tag mod and so I dug that out and ran a quick test. I think this might work for the limited use I need. Even if the client has disabled decals it won't change anything besides them missing some of the changes to the walls.

As a further question, and this is the reason I abandoned the spray tags mod in the first place, can the rotation value of the decal be controlled? I could never figure out a way and the tags ended up randomly rotated, ruining the effect. If I can clamp rotation then I can tightly control placement of the decal and match it's size to the wall I'm wanting to repaint and also prevent any overlap.

This decal idea is great and might be a good way to continue. Thanks for the idea MK!
Last edited by gopostal on Sat Aug 26, 2017 1:55 pm, edited 1 time in total.
I don't want to give the end away
but we're all going to die one day
User avatar
Masterkent
OldUnreal Member
Posts: 1469
Joined: Fri Apr 05, 2013 12:41 pm

Re: Change BSP texture dynamically

Post by Masterkent »

As a further question, and this is the reason I abandoned the spray tags mod in the first place, can the rotation value of the decal be controlled?
Rotation of the decal's image can be defined by the second argument of Decal.AttachDecal:

Code: Select all

simulated native function Texture AttachDecal( float TraceDistance, optional vector DecalDir );
Last edited by Masterkent on Sat Aug 26, 2017 4:11 pm, edited 1 time in total.
User avatar
gopostal
OldUnreal Member
Posts: 1005
Joined: Thu Jul 31, 2008 9:29 pm

Re: Change BSP texture dynamically

Post by gopostal »

Tested and fixed, this works just fine. Thank you Masterkent! This way is a bit hacky but I do get full control over the wall colors now and I can change them at will.
I don't want to give the end away
but we're all going to die one day
Post Reply

Return to “UScript Board”