PDA

View Full Version : Nearly finished my map, just need some help with 4 lines of code



BigJim
12-12-2005, 02:33 PM
Hiya, I'm hoping someone could help me out here, I'd be over the moon if they would. :)

I've been working for the past few months on a vctf map, vctf-Defcon, & as part of the theme I'm trying to add my own teamskins for the vehicles.

Some of the guys over at 3D buzz gave some really helpful coding advice a while back, and I thought I'd worked myself through this problem, I only noticed it while going through some of the last beta-tests..

I've nearly got everything in place, and the map is so close to finished I could squeal, but I keep running into a single problem -

When you steal a Hellbender from the other team, it's gun pawns always revert back to the stock brown or green skins, instead of the custom red team/blue team texture I produced.

http://img.photobucket.com/albums/v108/BigJim/VehicleSkin4.jpg
Red Bender

http://img.photobucket.com/albums/v108/BigJim/VehicleSkin2.jpg
Blue Bender

This is the code I'm using for my Benders.



//================================================== ===========================
// BeefedBender.
//================================================== ===========================
class BeefedBender extends ONSPRV
placeable;

simulated event TeamChanged()
{
Super.TeamChanged();

if (Team == 1){
Skins[0] = BlueSkin;
WeaponPawns[0].Gun.Skins[0] = Texture'myLevel.BenderSkinBlueFinal';
WeaponPawns[1].Gun.Skins[0] = Texture'myLevel.BenderSkinBlueFinal';
}

if (Team == 0){
Skins[0] = RedSkin;
WeaponPawns[0].Gun.Skins[0] = Texture'myLevel.BenderSkinRedFinal';
WeaponPawns[1].Gun.Skins[0] = Texture'myLevel.BenderSkinRedFinal';
}
}



Seems to me like the code to change the gun pawns is not executing when the vehicle is stonle - which is weird, because it seems to be executing to change the body texture, and obviously it worked when the vehicle first spawned. *confuzzled*

It compiles fine, & I've tried various combinations as well, pointing to the skin properties instead of writing out the string, changing the order in which the commands run, etc..

I hope I've explained this well enough, I can code about as well as I can juggle trucks, so forgive me if there's something stupid I'm overlooking. :)

I've included a download link to the construction room map where I did the coding/texturing of the vehicles, in case it helps any.

http://files.filefront.com/VehicleSkinTestMaprar/;4463145;;/fileinfo.html

Just a quickie word, as part of the gameplay, I've added some team-neutral vehicles.
The neutral vehicle factory I'm using always defaults the skin to team 0, so to get round that I've had to create 2 subclasses for each vehicle, one for red & the other for blue, each one stating that when it's set to team 255 (neutral) it's skin is red or blue.

Just thought I'd mention that in case anyone did look and where wondering why there's a blue and red version of each subclassed vehicle. :)

Thanks very much, & I hope somebody could help, or even just give me a clue as to what could be going wrong.:heart:

Xyx
12-12-2005, 03:52 PM
The teamskins and most of the neutral skin can be done by making a couple of classes consisting of nothing but a few defaultproperties.

Let's take the Hellbender... For the red and blue skins you need: A new shock gun subclass, with RedSkin and BlueSkin defaultproperties.
A new shock turret subclass, with a defaultproperty listing the new shock gun as Weapon.
A new twinbeam gun subclass, with RedSkin and BlueSkin defaultproperties.
A new twinbeam turret subclass, with a defaultproperty listing the new twinbeam gun as Weapon.
A new Hellbender subclass, with defaultproperties listing the new RedSkin and BlueSkin, and the new shock turret and twinbeam turret.For the neutral skins, you need to add a NeutralSkin defaultproperty to the Hellbender and the guns, and override the Hellbender's TeamChanged function and the guns' SetTeam functions to use the new skin.