Milkshape and Models

Search and find cool skins and models, or introduce your own ones!
1337GameDev
Skilled
Posts: 198
Joined: Thu Apr 16, 2020 3:23 pm
Personal rank: GameDev

Re: Milkshape and Models

Post by 1337GameDev »

Hmm, sorry to resurrect, but im running into odd problems with another mesh i made... a basic c4 model with flat textures.

I got it to export as psk, and import, and have it uvmapped....
Screen Shot 2021-08-12 at 6.08.48 PM.png
Screen Shot 2021-08-12 at 6.10.57 PM.png
As you can see, it chunks up my model for some reason....

Code: Select all

#exec MESH MODELIMPORT MESH=C4 MODELFILE=Models\C4.PSK LODSTYLE=12
#exec MESH ORIGIN MESH=C4 X=0 Y=0 Z=0
#exec MESH LODPARAMS MESH=C4 STRENGTH=0.0

#exec TEXTURE IMPORT NAME=C4Skin FILE=Textures\C4Skin.bmp GROUP=Skins FLAGS=2
#exec MESHMAP SETTEXTURE MESHMAP=C4 NUM=0 TEXTURE=C4Skin
#exec MESHMAP SETTEXTURE MESHMAP=C4 NUM=1 TEXTURE=Botpack.Ammocount.Ammoled
The above is my import code. I have LOD to be 0, and origin set to (0,0,0) and that's where my origin is.

What's going on?

PS: I imported my psk into a blank MS3D scene, and it imports fine and is intact.
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Milkshape and Models

Post by Feralidragon »

Thus far all PSK files you tried to import, you tried so without importing the animation as well, and you got into all sorts of trouble.

So try to export and import the animation file as well (PSA), as supposed for PSK files, with at least 1 frame of animation defined in the execs.
And ensure that all vertices are assigned to one joint at least.
1337GameDev
Skilled
Posts: 198
Joined: Thu Apr 16, 2020 3:23 pm
Personal rank: GameDev

Re: Milkshape and Models

Post by 1337GameDev »

Feralidragon wrote: Fri Aug 13, 2021 12:47 am Thus far all PSK files you tried to import, you tried so without importing the animation as well, and you got into all sorts of trouble.

So try to export and import the animation file as well (PSA), as supposed for PSK files, with at least 1 frame of animation defined in the execs.
And ensure that all vertices are assigned to one joint at least.
I tried the above and it still didn't work....

Hmm, I created a no-movement animation in ms3d... Created a joint at origin, and assigned all vertices to it (selected all vertices, then in joints tab, selected "joint1" and clicked "assign.")

Enabled "Anim," set Total Keyframes to "2", and Max Keyframes to "2" and at keyframe 1, went to "Animation -> Set Keyframe", and moved to keyframe 2.0 with the slider, and set the keyframe again. Then I saved my ms3d scene, and reexported the psk and psa file.

(Essentially I followed this site: http://homepage.eircom.net/~abyrne/Mode ... _tut09.htm)

I used the following import code:

Code: Select all

#exec ANIM IMPORT ANIM=C4Anim ANIMFILE=Models\C4.PSA COMPRESS=0.28 IMPORTSEQS=1
#exec MESH MODELIMPORT MESH=C4 MODELFILE=Models\C4.PSK LODSTYLE=12
#exec MESH ORIGIN MESH=C4 X=0 Y=0 Z=0
#exec MESH LODPARAMS MESH=C4 STRENGTH=0.0
#exec MESH DEFAULTANIM MESH=C4 ANIM=C4Anim

#exec TEXTURE IMPORT NAME=C4Skin FILE=Textures\C4Skin.bmp GROUP=Skins FLAGS=2
#exec MESHMAP SETTEXTURE MESHMAP=C4 NUM=0 TEXTURE=C4Skin
#exec MESHMAP SETTEXTURE MESHMAP=C4 NUM=1 TEXTURE=Botpack.Ammocount.Ammoled
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Milkshape and Models

Post by Feralidragon »

Hmm, then the animation probably isn't really needed, and something else is going on.

If you like, PM me the source with just this part (UT-side source, meaning just the uc, psk file, etc, not the ms3d file), as well as your currently compiled package (also with just this).
I want to take a look at the compiled package first to check exactly what you're seeing (a screenshot is not enough, I would like to see the model in 3D and its wireframe, in different perspectives, zoomed, etc), and the source itself in case I need to run some experiments.
1337GameDev
Skilled
Posts: 198
Joined: Thu Apr 16, 2020 3:23 pm
Personal rank: GameDev

Re: Milkshape and Models

Post by 1337GameDev »

I have attached a slimmed down version of my project, and viewing in the Mesh Browser, it still shows the same issue with the mesh, but not as severe this time, but still improper....
C42.zip
(33.88 KiB) Downloaded 11 times
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Milkshape and Models

Post by Feralidragon »

Just saw what was happening, and this is exactly why I asked the source: you did nothing wrong at all, the model itself is imported just fine and everything.

What is happening, however, is that the mesh browser uses the Software renderer by default, and this renderer has serious Z-buffering glitches that make the model, especially higher poly ones, to glitch out visually, especially while you turn it around you see faces disappearing and then appearing again, etc.

So, you need to change the renderer used for the mesh browser, the following way:
  • open the UnrealTournament.ini file;
  • find the WindowedRenderDevice line (it's actually around line 29, at least in my case);
  • you will see that it's set to SoftDrv.SoftwareRenderDevice, so you just need to change it to an hardware renderer, such as: WindowedRenderDevice=OpenGLDrv.OpenGLRenderDevice;
  • above I have set to OpenGL, but the game offers XOpenGL, D3D9, etc, you can use OpenGL or something else, as long as it's not SoftDrv;
  • save the file and open the editor again: you should now see your model properly, and you will see it's fine.
For reference, this is how it appears for me using OpenGL:

C42_opengl.jpg
1337GameDev
Skilled
Posts: 198
Joined: Thu Apr 16, 2020 3:23 pm
Personal rank: GameDev

Re: Milkshape and Models

Post by 1337GameDev »

Hmm, I don't see that line in the ini when searching... Do you have a snippet of that section that's missing?

Also, in the mesh browser, it doesn't have any info on polys or etc.... why is that?

I tried this:

Code: Select all

#exec MESH SEQUENCE MESH=C4 SEQ=All    STARTFRAME=0  NUMFRAMES=1
And it gave me this:
Screen Shot 2021-08-14 at 12.52.05 PM.png
My exported model doesn't seem to have any keyframes? But I created an animation according to the process on that site? Idk how to test if my keyframe creation in ms3d works...
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Milkshape and Models

Post by Feralidragon »

1337GameDev wrote: Sat Aug 14, 2021 6:57 pm Hmm, I don't see that line in the ini when searching... Do you have a snippet of that section that's missing?
Are you sure you're looking into the right file?

There are multiple ini files, the one I am talking about is UnrealTournament.ini.
There are also int files, which are a different kind of file, but which due to the similar extension name may also lead to confusion here, so make sure you're not opening an int file instead.

For reference, here's how mine looks like from the section I was talking about:

Code: Select all

[Engine.Engine]
GameRenderDevice=OpenGLDrv.OpenGLRenderDevice
AudioDevice=Cluster.ClusterAudioSubsystem
NetworkDevice=IpDrv.TcpNetDriver
DemoRecordingDevice=udemo.udemodriver
Console=UTMenu.UTConsole
Language=int
GameEngine=Engine.GameEngine
EditorEngine=Editor.EditorEngine
WindowedRenderDevice=OpenGLDrv.OpenGLRenderDevice
RenderDevice=GlideDrv.GlideRenderDevice
DefaultGame=Botpack.DeathMatchPlus
DefaultServerGame=Botpack.DeathMatchPlus
ViewportManager=WinDrv.WindowsClient
Render=Render.Render
Input=Engine.Input
Canvas=Engine.Canvas
...
1337GameDev wrote: Sat Aug 14, 2021 6:57 pm Also, in the mesh browser, it doesn't have any info on polys or etc.... why is that?
Likely because you don't have any animations set by default: the mesh browser may only show poly and vertex count if there's 1 key frame of animation at least (I guess).
1337GameDev wrote: Sat Aug 14, 2021 6:57 pm I tried this:

Code: Select all

#exec MESH SEQUENCE MESH=C4 SEQ=All    STARTFRAME=0  NUMFRAMES=1
And it gave me this:
[...]

My exported model doesn't seem to have any keyframes? But I created an animation according to the process on that site? Idk how to test if my keyframe creation in ms3d works...
Skeletal animation importation works a bit differently: rather than telling in the execs themselves during import what the animation sequences are, such as their names, how many frames they have, how long they take to animate by default, and so on, it's supposed for the PSA file (exported skeletal animation file) to already have that full information inside it.

For normal vertex meshes there's almost no difference between the mesh itself and the animation, they're hard-coupled together, because each key frame represents a full state, vertex-wise, of the entire mesh, which may also be why the mesh browser is bound to that as well for poly-count visualization and such.

However, for skeletal meshes, the mesh and the animation are distinct things, and you can even have multiple animation files (PSA) for same exact mesh (PSK), because the idea is to be able to reuse the same mesh, but have different animations, but you can also have different mesh PSK files all using the same PSA animation file as well (which is how it has been mostly used until now, especially for new player models).

So, the animation information in that case is completely self-contained in the file itself.

Unfortunately, however, I don't think you can really use MS3D for this, because that editor is really basic on pretty much everything, and especially animation, so while you can set key frames and etc over there, I don't think you can define and name the sequences there.

If you don't need animation, and if the PSK file alone works well enough for you, then you can skip that.
However, if you do need animation, then you need to use a different 3D modelling program, such as Blender for example, where you can set multiple sequences, name them, etc.

Blender also has a PSA/PSK exporter I believe, because Unreal Engine never really moved from this format up until now (as far as I know, but I haven't been keeping up with their supported 3D formats), but I have no idea how well it works, or if there's really such an exporter nowadays (I believe there is though, since I have seen folks over at UnrealSP creating new skeletal meshes using Blender and importing into the game).

Either way, from here I cannot really help much with the external tooling, unfortunately, since I haven't done anything on this regard for almost 10 years now.
1337GameDev
Skilled
Posts: 198
Joined: Thu Apr 16, 2020 3:23 pm
Personal rank: GameDev

Re: Milkshape and Models

Post by 1337GameDev »

Feralidragon wrote: Sat Aug 14, 2021 11:18 pm
1337GameDev wrote: Sat Aug 14, 2021 6:57 pm Hmm, I don't see that line in the ini when searching... Do you have a snippet of that section that's missing?
Are you sure you're looking into the right file?

There are multiple ini files, the one I am talking about is UnrealTournament.ini.
There are also int files, which are a different kind of file, but which due to the similar extension name may also lead to confusion here, so make sure you're not opening an int file instead.

For reference, here's how mine looks like from the section I was talking about:

Code: Select all

[Engine.Engine]
GameRenderDevice=OpenGLDrv.OpenGLRenderDevice
AudioDevice=Cluster.ClusterAudioSubsystem
NetworkDevice=IpDrv.TcpNetDriver
DemoRecordingDevice=udemo.udemodriver
Console=UTMenu.UTConsole
Language=int
GameEngine=Engine.GameEngine
EditorEngine=Editor.EditorEngine
WindowedRenderDevice=OpenGLDrv.OpenGLRenderDevice
RenderDevice=GlideDrv.GlideRenderDevice
DefaultGame=Botpack.DeathMatchPlus
DefaultServerGame=Botpack.DeathMatchPlus
ViewportManager=WinDrv.WindowsClient
Render=Render.Render
Input=Engine.Input
Canvas=Engine.Canvas
...
1337GameDev wrote: Sat Aug 14, 2021 6:57 pm Also, in the mesh browser, it doesn't have any info on polys or etc.... why is that?
Likely because you don't have any animations set by default: the mesh browser may only show poly and vertex count if there's 1 key frame of animation at least (I guess).
1337GameDev wrote: Sat Aug 14, 2021 6:57 pm I tried this:

Code: Select all

#exec MESH SEQUENCE MESH=C4 SEQ=All    STARTFRAME=0  NUMFRAMES=1
And it gave me this:
[...]

My exported model doesn't seem to have any keyframes? But I created an animation according to the process on that site? Idk how to test if my keyframe creation in ms3d works...
Skeletal animation importation works a bit differently: rather than telling in the execs themselves during import what the animation sequences are, such as their names, how many frames they have, how long they take to animate by default, and so on, it's supposed for the PSA file (exported skeletal animation file) to already have that full information inside it.

For normal vertex meshes there's almost no difference between the mesh itself and the animation, they're hard-coupled together, because each key frame represents a full state, vertex-wise, of the entire mesh, which may also be why the mesh browser is bound to that as well for poly-count visualization and such.

However, for skeletal meshes, the mesh and the animation are distinct things, and you can even have multiple animation files (PSA) for same exact mesh (PSK), because the idea is to be able to reuse the same mesh, but have different animations, but you can also have different mesh PSK files all using the same PSA animation file as well (which is how it has been mostly used until now, especially for new player models).

So, the animation information in that case is completely self-contained in the file itself.

Unfortunately, however, I don't think you can really use MS3D for this, because that editor is really basic on pretty much everything, and especially animation, so while you can set key frames and etc over there, I don't think you can define and name the sequences there.

If you don't need animation, and if the PSK file alone works well enough for you, then you can skip that.
However, if you do need animation, then you need to use a different 3D modelling program, such as Blender for example, where you can set multiple sequences, name them, etc.

Blender also has a PSA/PSK exporter I believe, because Unreal Engine never really moved from this format up until now (as far as I know, but I haven't been keeping up with their supported 3D formats), but I have no idea how well it works, or if there's really such an exporter nowadays (I believe there is though, since I have seen folks over at UnrealSP creating new skeletal meshes using Blender and importing into the game).

Either way, from here I cannot really help much with the external tooling, unfortunately, since I haven't done anything on this regard for almost 10 years now.
This is good to know. Thanks for explaining.

Now, I’m curious, is there a way to import a model once in a file, and then use it elsewhere in another? Does order of compilation matter, or is that fine because these are preprocessor directives for asset import?

And I have an odd issue, my model has no animation, and I have code in an ACTIVE state block, and some log statements. My code enters the active block, with BeginState, and my tick function happens a few times (known via log statements), but then my code leaves the Active state and EndState is triggered.

Why is this? Is it because my model doesn’t have an animation? I don’t have any erroneous “GotoState” calls that force it to the default state or etc.....
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Milkshape and Models

Post by Feralidragon »

The order of the execs do matter, so if by the time a certain exec is executed it references an asset that has not yet been imported at that point, it will fail.

However, the same isn't true for the rest of the class: execs aside, if you assign a mesh, texture or any other imported asset in the default properties or in the code itself for example, it doesn't really matter when the asset is imported, because by the time the code itself is compiled all the execs have already been executed.

Having that said, one strategy you can follow, and which I have already seen other mods doing, is to import everything you need to import as far as execs go in a single class (you could even have a dummy class extending from Object just for this, which also I have seen done), because that way you are able to ensure that the execs are executed in the order that you want and need, otherwise if they are spread out across different classes, you don't really know when each exec group from each class will execute (it will probably be in alphabetical order relative to the name of the uc files themselves, but I am not 100% sure).

As for the states and such, one thing to keep in mind, and which I believe most modders do not really know, is that the TournamentPlayer is hardcoded to force a weapon to reset its state once it's detected that is no longer animating under certain situations (which happen all the time).

As messed up as this is, this was probably done to prevent weapons to remain stuck in a given state in case something goes wrong, especially in online games, so it's nothing more than a hack, but regardless, in order for a weapon to not leave a state, it needs to stay executing some sort of animation.

In my case, I came across this issue in NW3 when I was doing the Megaton, namely when I was doing the custom numpad which you can setup, and it was continuously resetting the state by itself, and that's when I looked what could be causing this, and it was that.
So what I did was to always keep all weapons in some sort of animation, even if that animation was just a 1-frame tween, or 2 frames with the weapon in the same position.

That is to say that, if you're creating a weapon, you really need to have at least 2 frames of animation set, even if they are 2 frames where the weapon doesn't move at all, just so you can play it during those states to keep the weapon in those states, otherwise the game will eventually force the weapon out of whichever state it's in (it sucks, I know, but that's how it is).
1337GameDev
Skilled
Posts: 198
Joined: Thu Apr 16, 2020 3:23 pm
Personal rank: GameDev

Re: Milkshape and Models

Post by 1337GameDev »

Feralidragon wrote: Sun Aug 15, 2021 11:24 pm The order of the execs do matter, so if by the time a certain exec is executed it references an asset that has not yet been imported at that point, it will fail.

However, the same isn't true for the rest of the class: execs aside, if you assign a mesh, texture or any other imported asset in the default properties or in the code itself for example, it doesn't really matter when the asset is imported, because by the time the code itself is compiled all the execs have already been executed.

Having that said, one strategy you can follow, and which I have already seen other mods doing, is to import everything you need to import as far as execs go in a single class (you could even have a dummy class extending from Object just for this, which also I have seen done), because that way you are able to ensure that the execs are executed in the order that you want and need, otherwise if they are spread out across different classes, you don't really know when each exec group from each class will execute (it will probably be in alphabetical order relative to the name of the uc files themselves, but I am not 100% sure).

As for the states and such, one thing to keep in mind, and which I believe most modders do not really know, is that the TournamentPlayer is hardcoded to force a weapon to reset its state once it's detected that is no longer animating under certain situations (which happen all the time).

As messed up as this is, this was probably done to prevent weapons to remain stuck in a given state in case something goes wrong, especially in online games, so it's nothing more than a hack, but regardless, in order for a weapon to not leave a state, it needs to stay executing some sort of animation.

In my case, I came across this issue in NW3 when I was doing the Megaton, namely when I was doing the custom numpad which you can setup, and it was continuously resetting the state by itself, and that's when I looked what could be causing this, and it was that.
So what I did was to always keep all weapons in some sort of animation, even if that animation was just a 1-frame tween, or 2 frames with the weapon in the same position.

That is to say that, if you're creating a weapon, you really need to have at least 2 frames of animation set, even if they are 2 frames where the weapon doesn't move at all, just so you can play it during those states to keep the weapon in those states, otherwise the game will eventually force the weapon out of whichever state it's in (it sucks, I know, but that's how it is).
Good to know, on the execs. Makes much clearer sense.

And interesting on the weapon state -- I figured it was something like that.... Maybe i'll have a boolean, and just toggle this in the BringUp / PutDown, and just call Enable / Disable on 'Tick' (assuming that works, if not i'll just short circuit in that method).

Meh....

I can't make animation sequences in ms3d, and I don't want to switch to blender as a modeler, import to ms3d and export (as blender isn't as compatible with ut99's importer). It would also be annoying to model in ms3d, and then export to blender, add the animations, and then back to ms3d (or tinker with blender's exporter settings and such). Meh....

Also, i have 2 materials on my c4 model, and #1 is the skin, and #2 is the "screen" of the c4, that I mapped to an already existing scripted texture, but it doens't render....

Pertinent code below:

Code: Select all

#exec ANIM IMPORT ANIM=C4Anim ANIMFILE=Models\C4.PSA IMPORTSEQS=1
#exec MESH MODELIMPORT MESH=C4 MODELFILE=Models\C4.PSK LODSTYLE=12
#exec MESH ORIGIN MESH=C4 X=0 Y=0 Z=0 Pitch=64
#exec MESH LODPARAMS MESH=C4 STRENGTH=0.0
#exec MESH DEFAULTANIM MESH=C4 ANIM=C4Anim
#exec MESH SEQUENCE MESH=C4 SEQ=All    STARTFRAME=0  NUMFRAMES=1
#exec MESHMAP SETTEXTURE MESHMAP=C4 NUM=0 TEXTURE=C4Skin
#exec MESHMAP SETTEXTURE MESHMAP=C4 NUM=1 TEXTURE=Botpack.Ammocount.Ammoled

simulated event RenderOverlays(canvas Canvas){
	Texture'Ammoled'.NotifyActor = Self;
	Super.RenderOverlays(Canvas);
	Texture'Ammoled'.NotifyActor = None;
}
simulated event RenderTexture(ScriptedTexture Tex){
	local Color C;
	local string Temp;

    Temp = String(TimerSeconds);

	while(Len(Temp) < 3){
        Temp = "0"$Temp;
	}

	C.R = 255;
	C.G = 0;
	C.B = 0;

	Tex.DrawColoredText(56, 14, Temp, Font'LEDFont', C);
}
I looked at the pulsegun UC file for this, and i don't know what i'm doing wrong....

Ideas?
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Milkshape and Models

Post by Feralidragon »

As far as Blender goes, I don't advise to go back and forth between Blender and MS3D either: in case you really need to do animation, and opt to use Blender, you should simply use Blender completely, and not use MS3D at all.
This is, of course, assuming that there's a working PSK/PSA exporter from Blender, which I think there is (if so, it's worth the change).

As for the render code itself: although it should work like that, the fact that it doesn't means that either:
  • the Texture'Ammoled' is not actually being used at that point, despite being so in the exec (you could have another texture assigned in the Multiskins);
  • RenderTexture is not being called for some reason (try to log stuff in it to check if it's called at all);
  • Temp is a different string than a set of digits (Font'LEDFont' only supports digits), so you can try to hardcode it to something like "123" for now, just to test it.
There are also other possibilities, although unlikely, as they depend on the rest of your code, like: if you're overriding any of these functions in a different state for example, but you probably aren't doing this, so that shouldn't be the problem.

Also, it just came to my mind that you're trying to do something like a C4 bomb type of weapon, so if you're trying to see the digits rendered when the C4 is "deployed" or so (out of your hands), that's not going to work.
RenderOverlays is only called when the weapon is being rendered in the first-person view perspective (when you are "using" the weapon).

Furthermore, if you have more than one C4 deployed, you cannot have different countdowns rendered in each one that way, because they are all sharing the same scripted texture.
Scripted textures are singletons, only 1 instance of each exists at any given time, so if 2 actors are using the same scripted texture, they will both render the same thing.

In order to have a proper 3-digit countdown that is unique per deployed C4, you need instead split that visor into 3 textures, where each texture is a digit, and then in the code instead of rendering text directly, you just translate the timer to the digit textures and apply them through the Multiskins.

I have done this very same thing for a weapon of mine called Megaton, in NW3.
Which is also in the source I sent you a while ago, in case you want to take a look to understand what I am talking about here.
1337GameDev
Skilled
Posts: 198
Joined: Thu Apr 16, 2020 3:23 pm
Personal rank: GameDev

Re: Milkshape and Models

Post by 1337GameDev »

Thanks for explaining! You saved me from going down a rabbit hole....

I'll try to isolate some digits for a texture, and apply them to the timer.
1337GameDev
Skilled
Posts: 198
Joined: Thu Apr 16, 2020 3:23 pm
Personal rank: GameDev

Re: Milkshape and Models

Post by 1337GameDev »

An update:

I got your solution to work very well.

I made 5 model "groups" in Milkshape, 1 for the c4 I skinned with LithUnwrap, 1 for the screen faces (so i can have the ":" for the digits, or have it blank), and 3 for the faces of each digit.

I simple aligned the digits to the screen via trial and error, and moved the 0.1 units above the "screen" of the timer on my model. This is obviously not "contiguous" and some model optimizers / decimators might remove them, but i already decimated my high poly model.

I then added materials to ms3d, and assigned each for each group. Each of these, on import to ut99 correspond to MultiSkins property indices 1-5. I selected the textures for each material in ms3d, so I could get a basic preview of my UV alignment.

I had to manually align the UV coordinates with milkshape though, and found out how to use it's coordinate editor. You need to deselect everything on the model, then select the group you want to edit coordinates for, then select that group in the coordinate editor window. Then for which direction (front, back, left, right) in that window's drop down, you select back/front for face based geometry. I tried initially with front, but had to choose "back" as my textures were mirrored. Then I selected "remap" and manually moved the vertices in the UV coordinate editor window so the ms3d textured preview window shows it lining up. I had to rotate a few times though (selecting all vertices in the uv coordinate window) by 90 degrees a few times (if you select more than that, it rotates off the edge of that window and is hard to bring the selected vertices back into view unless you start over by hitting "remap."). Then I repeated the same procedure for each screen and digit group until they lined up to an acceptable amount in the textured preview viewport in ms3d.

Then I made LED-like digit textures in GIMP (and honored the bmp rules for ut99 bmp import, as noted below)
Screen Shot 2021-08-18 at 11.46.42 AM.png
Screen Shot 2021-08-18 at 11.46.42 AM.png (28.28 KiB) Viewed 821 times
And ensured they were powers of 2 for their dimensions (apparently ut99 can't pad any texture size that isn't)....

In my scripts, I then just extracted the digits out of my counter for the minutes, tens and ones places (and handled edge cases over 599 seconds and less than 0) and called update when the c4 is brought up, thrown, the ghost is displayed, timer changed, and when countdowns happen (and when object changes state when active).

I used the following code:

Code: Select all

function UpdateTimer(int timerValue){
	local int mins, tens, ones;
	if(timerValue > 599){//if the timer would read 999 or more
		mins = 9;
		tens = 9;
		ones = 9;
		return;
	} else if(timerValue < 0) {
		mins = 0;
		tens = 0;
		ones = 0;
	} else {
		//get the minutes count
		mins = timerValue / 60;
		timerValue = timerValue % 60;
		//get the number of tens
		tens = timerValue / 10;
		timerValue = timerValue % 10;
		//the remainder is the ones place
		ones = timerValue;
	}

	Self.MultiSkins[2] = class'C4.C4Weapon'.default.TimerDigitTextures[mins];
	Self.MultiSkins[3] = class'C4.C4Weapon'.default.TimerDigitTextures[tens];
	Self.MultiSkins[4] = class'C4.C4Weapon'.default.TimerDigitTextures[ones];
}
I made an array of each texture, and placed the 0 digit in index 0, 1 digit in index 1, etc.

It works quite well and looks better than i'd imagine the render texture would.

Still kind of sucks that they limited render textures to singletons... but I guess for low end computers / consoles back in the day, this was a very expensive operation and needed an entirely new draw call to the gpu to render. Still sucks that it can't be set to instanced vs singleton scoping though for modern systems. Maybe they could add that for the 469b patch? I doubt they would, as they hate adding new features... for fear of epic's disappointment in not sticking to purely fixes / modern system support... meh.

But I got it to work, and figured i'd document for others to learn from my trial and error.
Attachments
Screen Shot 2021-08-18 at 11.30.36 AM.png
Screen Shot 2021-08-18 at 11.30.26 AM.png
Post Reply