OldUnreal / UnrealTournamentPatches

Other
990 stars 29 forks source link

[469d] ScriptedTexture.replaceTexture() doesn't work #1592

Closed FrancescoBis closed 1 month ago

FrancescoBis commented 3 months ago

ScriptedTexture.replaceTexture() doesn't replace the texture on 469d.

SeriousBuggie commented 3 months ago

You need add reproduce steps, expected result and actual result. Maybe upload text example, which illustrate problem in easy way.

FrancescoBis commented 3 months ago

You need add reproduce steps, expected result and actual result. Maybe upload text example, which illustrate problem in easy way.

Got it.

Expected result: The source texture of the ScriptedTexture should be replaced with the texture given as argument to ScriptedTexture.replaceTexture().

Actual result: The original source texture keeps getting drawn even if replaceTexture() was called with a different texture than the original source as argument.

Reproduce steps:

  1. Create a ScriptedTexture in the editor (or use an existing one like the ones in Scripted.utx)
  2. Write a subclass of Actor and assign the notifyActor of the chosen ScriptedTexture to said actor, like: ScriptedTexture'ChosenScriptedTexture'.notifyActor = self;
  3. Implement the renderTexture event in the class and call replaceTexture() and pass a texture as argument, like: simulated event renderTexture(ScriptedTexture scrTex) { scrTex.replaceTexture(tex); }
SeriousBuggie commented 3 months ago

Can you provide simple cube test map with all actors embed into mylevel, please?

SeriousBuggie commented 3 months ago

Also what about 436?

And Unreal wiki say next:

ReplaceTexture (Texture (UT) Tex) Copies the given texture on the ScriptedTexture's canvas. The given texture and the ScriptedTexture must have exactly the same size. Only image data is copied, not the texture's palette; if both palettes don't match, you'll get a pretty psychedelic effect.

It different from what you expect. And in source code, it just copy texture data, not set it as base. I guess if you need change base texture, you need set it in ScriptedTexture properties.

It simple non-const field: var() Texture SourceTexture;.

FrancescoBis commented 3 months ago

Also what about 436?

And Unreal wiki say next:

ReplaceTexture (Texture (UT) Tex) Copies the given texture on the ScriptedTexture's canvas. The given texture and the ScriptedTexture must have exactly the same size. Only image data is copied, not the texture's palette; if both palettes don't match, you'll get a pretty psychedelic effect.

It different from what you expect. And in source code, it just copy texture data, not set it as base. I guess if you need change base texture, you need set it in ScriptedTexture properties.

It simple non-const field: var() Texture SourceTexture;.

It has always worked the way I expect on 436, indeed it works on the map I just created but only if resizing the window, I'll attach the map with this message. DM-replaceTexture_bug_1.zip

FrancescoBis commented 3 months ago

When the description you quoted says "copied" it means "copied and drawn", the palette is separated from the image as the images use indexed colors, but I don't mind about the palette not being copied.