UE1 - UT Iterator for non-actor objects?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Chopin

New Member
Aug 23, 2005
174
0
0
Is there an iterator function that works on non-actor objects? Like ForEach AllActors, but works for non-actors?

For example,

Code:
function PreRender(canvas Canvas)
{

local Texture ThisTexture;

foreach AllActors(Class'Texture', ThisTexture)
ThisTexture.Palette = Palette'MyTexturePackage.Palette7';

}

gets a type mismatch error since the class 'Texture' isn't an Actor... what can I use instead of AllActors? (I tried AllObjects, which unfortunately doesn't exist.)
 
Last edited by a moderator:

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
There are no non-actor iterators in UT.

What exactly are you trying to achieve? Randomly replacing palettes is going to look extremely ugly because colors are usually not ordered in any specific way and if you replace the palette, the new colors will usually not be related to the original colors in any way. Granted, it may work in specific cases, but for most textures it won't. Also, palettes will remain that way until either the texture is unloaded (which will never happen for certain textures) or UT is shut down.
 

Chopin

New Member
Aug 23, 2005
174
0
0
Okay more general question... how do I reference every non-actor object of a certain class?

The palette is only a few colors of the same hue only, its for a HUD mutator which changes the way the world is rendered. I can always change the textures back to their default palettes in another function, like before executing this one i can get the names of each palette and put them in an array and then later when i want to revert them back to their original palettes i have the information stored about what their original palettes were...
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
It's not possible to iterate over non-actor objects, no matter what restrictions you want to apply. Also, as mentioned before, final texture colors are a result of the texture pixel's palette index. If you change the palette you change the color. The new color depends only on the new color at the same index in the new palette. It would most certainly look ugly if you replaced every texture's palette. Not to mention you wouldn't be able to restore the original palette and leave the texture messed up until the player restarts the game.
 

Chopin

New Member
Aug 23, 2005
174
0
0
oh snap, i wish that were possible... i will have use an alternative method of drawing a modulated texture over the whole screen, which i really didn't want to do since that effs up the HUD...