Render texture on model?

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

Render texture on model?

Post by 1337GameDev »

Looking at multiple models, i see a render texture for Ammo count.

This is evident on the PulseGun.uc, with the following relevant code:

Code: Select all

#exec OBJ LOAD FILE=Textures\Ammocount.utx  PACKAGE=Botpack.Ammocount
//left handed model
#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
//right handed model
#exec MESHMAP SETTEXTURE MESHMAP=PulseGunR NUM=1 TEXTURE=Botpack.Ammocount.Ammoled
#exec MESHMAP SETTEXTURE MESHMAP=PulseGunR NUM=2 TEXTURE=JPulseGun_02
#exec MESHMAP SETTEXTURE MESHMAP=PulseGunR NUM=3 TEXTURE=JPulseGun_03

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(AmmoType.AmmoAmount);

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

	Tex.DrawTile( 30, 100, (Min(AmmoType.AmmoAmount,AmmoType.Default.AmmoAmount)*196)/AmmoType.Default.AmmoAmount, 10, 0, 0, 1, 1, Texture'AmmoCountBar', False );

	if(AmmoType.AmmoAmount < 10)
	{
		C.R = 255;
		C.G = 0;
		C.B = 0;	
	}
	else
	{
		C.R = 0;
		C.G = 0;
		C.B = 255;
	}

	Tex.DrawColoredText( 56, 14, Temp, Font'LEDFont', C );	
}
I understand the import of the existing Botpack.Ammocount import, but unsure of the others, and how they map to the model....

How would I make my own model in Milkshape with this placeholder for the render texture target?
Post Reply