Page 1 of 1

Swap skins of existing mesh?

Posted: Wed Jul 07, 2021 5:22 am
by 1337GameDev
I am currently tinkering with some custom weapons, and want to simply make minor edits to existing skins used by the weapon mesh. My current base weapon is the PulseGun.

I see lines like this:

Code: Select all

#exec MESHMAP SETTEXTURE MESHMAP=PulseGunL NUM=1 TEXTURE=Botpack.Ammocount.Ammoled
#exec MESHMAP SETTEXTURE MESHMAP=PulseGunL NUM=2 TEXTURE=JPulseGun_02
#exec MESHMAP SETTEXTURE MESHMAP=PulseGunL NUM=3 TEXTURE=JPulseGun_03
How would I change the texture for "JPulseGun_02?"

Would I just set the actor's "Texture" property to the new texture I have created after importing?

Code: Select all

Texture = Texture'MyPackage.Skins.MyTex_JPulseGun_02';

Code: Select all

#exec TEXTURE IMPORT NAME=MyTex_JPulseGun_02 FILE=Textures\Weapons\MyTex_JPulseGun_02.png GROUP="Skins" FLAGS=2 MIPS=OFF

Re: Swap skins of existing mesh?

Posted: Fri Jul 09, 2021 3:40 am
by papercoffee
You want to do this on runtime?

Re: Swap skins of existing mesh?

Posted: Fri Jul 23, 2021 1:57 am
by 1337GameDev
Or at compile time for a subclass of an existing bisect with a mesh - IE: subclasses UT weapon class.

Re: Swap skins of existing mesh?

Posted: Fri Jul 23, 2021 6:44 am
by sektor2111
As I recall I changed skin for a stock actor - Monster. Also I could see skins changed in MH-DarkWhite map at weapons. Why would be needed another class ?
MH-KillThemAllAgain_sk uses only STOCK monsters except a Brute "ChiefF...ker" and a "TarydiumTitan". All the rest are dynamically re-skined during run-time when are created in map. I don't get the point of a new Class for the same mesh and modified skins - unless that actor is different.
W_Skin_DW.PNG
What this map has I can "edit" with a code by simply accessing desired variable.
For ON-Line cases, new Texture must be added in ServerPackages.

Title: Swap skins of existing mesh ?
Answer: Yes... Why not ?

Re: Swap skins of existing mesh?

Posted: Fri Jul 23, 2021 3:11 pm
by 1337GameDev
No offence, but if you read my original post, I state it's for custom weapons.

I have weapons based off original UT ones that have different functionality, and are subclasses.

I want them to have a different skin when placed on maps.

How is this done -- in code?

Re: Swap skins of existing mesh?

Posted: Tue Aug 17, 2021 10:14 pm
by 1337GameDev
If anybody else finds this post, you edit the following properties:

Skin, MultiSkin [1] (if it's a mesh) and Texture if it's a sprite / different draw type. The first index (index 0) of MultiSkin doesn't seem to be used generally (as most models are imported with texture indices starting at 1).

Can't prove it'll work in every case, but it works for this gun I had that would show a "ghost" model where you're aiming and I tried a dozen different models and they worked just fine.

In a subclass, just set these in the defaultproperties block.

This can be done at runtime and works well.