3rd View Weapon Texture Problem!!

Need some nice Mods? Here, you are right!
Post Reply
Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

3rd View Weapon Texture Problem!!

Post by Spectra »

I know my Question sounds Noobish.

I created a Weapon Called MiniPulse with the mesh of Pulse Gun and added a Multi-Texture in it.

Code: Select all

auto state Pickup
{
	ignores AnimEnd;

	event BeginState()
	{
		MultiSkins[1]=Texture'Ammoled';
		MultiSkins[2]=None;
	}

	event EndState()
	{
		MultiSkins[1]=None;
		MultiSkins[2]=Texture'Ammoled';
	}

	// Landed on ground.
	simulated function Landed(Vector HitNormal)
	{
		local rotator newRot;

		newRot = Rotation;
		newRot.pitch = 0;
		SetRotation(newRot);
		if ( Role == ROLE_Authority )
		{
			bSimFall = false;
			SetTimer(2.0, false);
		}
	}
}
I used above codes for my Weapon. The weapon looks beautiful with new texture in Pickup View Mesh and 1st Person Mesh but when I see myself in 3rd View with that weapon the MiniPulse looks in default Weapon Textures. So this my Problem.

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

Re: 3rd View Weapon Texture Problem!!

Post by Feralidragon »

What I did in the past to solve that was to have the normal multiskins to be the pickup and 3rd view skins, and a custom array of first person multiskins, along this:

Code: Select all

var(Display) texture MultiSkinsFirstPerson[8];

state Pickup
{
	simulated function BeginState()
	{
		Super.BeginState();
		SetPickupSkins();
	}
}

simulated function SetOwnerDisplay()
{
	Super.SetOwnerDisplay();
	SetPickupSkins();
}

simulated function setHand(float Hand)
{
	Super.SetHand(Hand);
	SetPickupSkins();
}

simulated function BecomeItem()
{
	Super.BecomeItem();
	SetPickupSkins();
}

simulated function BecomePickup()
{
	Super.BecomePickup();
	SetPickupSkins();
}

simulated function RenderOverlays( canvas Canvas )
{
	if (PlayerPawn(Owner) != None && PlayerPawn(Owner).ViewTarget == None && !PlayerPawn(Owner).bBehindView)
		SetFirstPersonViewSkins();
	Super.RenderOverlays(Canvas);
	SetPickupSkins();
}

simulated function SetPickupSkins()
{
local byte i;

	for (i = 0; i < ArrayCount(MultiSkins); i++)
		MultiSkins[i] = default.MultiSkins[i];
}

simulated function SetFirstPersonViewSkins()
{
local byte i;

	if (Owner == None)
		SetPickupSkins();
	for (i = 0; i < ArrayCount(MultiSkins); i++)
		MultiSkins[i] = MultiSkinsFirstPerson[i];
}
Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: 3rd View Weapon Texture Problem!!

Post by Spectra »

Thx Ferali for replying :)

But I got 1 more problem. When I compile it again via UCC then it tells me like this:

C:\UnrealTournament\New-Weapons\Classes\MiniPulse.uc<72> : Error, 'Sethand' Conflicts with 'Function New-Weapons.MiniPulse.Sethand'

What should I do??
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: 3rd View Weapon Texture Problem!!

Post by Feralidragon »

That means that you have 2 declarations of SetHand, and you can only have one.
In the code I put above, there's a SetHand already, and probably in your own code there was another before you copy & pasted it.
Just look at mine and then at yours, and merge them up as you find proper in your code. :)
Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: 3rd View Weapon Texture Problem!!

Post by Spectra »

Ok I compiled it, It was Successful.

Now 1 thing! I know u feel quite bored of me by asking Questions and Questions.

Code: Select all

simulated function SetPickupSkins()
    {
    local byte i;

       for (i = 0; i < ArrayCount(MultiSkins); i++)
          MultiSkins[i] = default.MultiSkins[i];
    }

    simulated function SetFirstPersonViewSkins()
    {
    local byte i;

       if (Owner == None)
          SetPickupSkins();
       for (i = 0; i < ArrayCount(MultiSkins); i++)
          MultiSkins[i] = MultiSkinsFirstPerson[i];
    }
Where do I put the Actual Texture??

In simulated function SetPickupSkins()
{
local byte i;

for (i = 0; i < ArrayCount(MultiSkins); i++)
MultiSkins = default.MultiSkins;
}
OR HERE!

simulated function SetFirstPersonViewSkins()
{
local byte i;

if (Owner == None)
SetPickupSkins();
for (i = 0; i < ArrayCount(MultiSkins); i++)
MultiSkins = MultiSkinsFirstPerson;
}

Sorry for disturbing u :|
Torax
Adept
Posts: 406
Joined: Fri Apr 20, 2012 6:38 pm
Personal rank: Master of Coop
Location: Odessa, Ukraine

Re: 3rd View Weapon Texture Problem!!

Post by Torax »

I used this script once...can't remember accurately but i think you must put textures you want to use into MultiSkinsFirstPerson
If under "Actual Texture" you mean CUSTOM, not DEFAULT skins
Unreal. Alter your reality..forever...
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: 3rd View Weapon Texture Problem!!

Post by Feralidragon »

In the default properties (defaultproperties block) you assign the first person view version of your custom skins to MultiSkinsFirstPerson, while your custom pickup and 3rd weapon view ones (which should be the same) go to be the MultiSkins themselves.
Post Reply