PDA

View Full Version : Newbie Q: Changing projectice texture


RedEye(Co30)
13th Sep 2001, 04:56 PM
My first foray into UScript, trying to change the colour of the Unreal 1 Biorifle projectile from green to red. I changed the jflare texture to red, saved it as RedPlasma, then imported it into my package, with the following code changes:



class RedBioGel expands BioGel;

#exec TEXTURE IMPORT NAME=RedPlasma FILE=MODELS\RedPlasma.pcx //oldtexture jflare.pcx in Unrealshare
#exec MESHMAP SCALE MESHMAP=Unrealshare.BioRGel X=0.05 Y=0.05 Z=0.1
#exec MESHMAP SETTEXTURE MESHMAP=Unrealshare.BioRGel NUM=1 TEXTURE=redeye.RedPlasma


This was the only code that seemed to have anything to do with the texture. Dunno what's going on here; when I changed the GreenGelPuff to red it worked fine, but that's a sprite not a mesh.

Any ideas?


Edit: No wonder I'm having trouble, I see by the thread title that I can't even spell "projectile" :)

Mr.Mitchell
16th Sep 2001, 06:49 AM
An easier way to change the texture is just import the texture with

#exec TEXTURE IMPORT NAME=RedPlasma FILE=MODELS\RedPlasma.pcx //oldtexture jflare.pcx in Unrealshare

Remove both other #exec lines and in your defaultproperties set texture and/or skin to the RedPlasma texture. Try both changing texture or skin, I don't have UT handy so I can't try. For now just try to summon it with "summon Packagename.RedBiogel" and you should be able to see your new RedBiogel.

Now you have real cool RedPlasma, but you don't have a weapon that shoots RedPlasma right? Just subclass the original weapon, and copy the functions with Biogel (probably Fire and/or AltFire)change Biogel with RedBiogel. Summon your new weapon and it should shoot RedBiogel.

TaoPaiPai
16th Sep 2001, 07:06 AM
I'm not sure but he should only change the 'altprojectileClass' in the default properties to indicate his custom biogel class ,instead of messing with the fire/altfire functions.

Mr.Mitchell
16th Sep 2001, 08:09 AM
I'm not sure but he should only change the 'altprojectileClass' in the default properties to indicate his custom biogel class ,instead of messing with the fire/altfire functions.

I made a FlakCannon mutator and the altfire projectile was hardcoded in the alt-fire function, but you have got a good point. If the altprojectile class setting works it is a lot easier. I guess it should work for some weapons.

RedEye(Co30)
16th Sep 2001, 10:00 AM
I tried taking out the #exec commands and just importing the texture, then setting the texture in the default properties . . . didn't work. Grrrrr . . . this is driving me nuts.

When I get my website going again (a week or so probably) I'll post the code so some kind soul can take a look and tell me what the heck I'm doing :)

Mr.Mitchell
17th Sep 2001, 12:27 PM
You could try posting the code here ;)

RedEye(Co30)
17th Sep 2001, 12:57 PM
I await enlightenment :)


//-----------------------------------------------------------
// Projectile for RedBiorifle ---- Calls RedPlasmaPuff instead of GreenPuff,
// which then calls RedPlasmaBlob in place of GreenBlob, as well as a
// ParticleBurst2 effect. GreenSmokePuff effect has been replaced by
// RedSmokePuff which calls the Unrealshare.BloodyPuff effect.
// Ambient light of the projectile has been set to red as well.
// Projectile speed has been increased, effectively making this
// a hitscan weapon at close range. PHYSICS_Falling has been retained,
// allowing relatively realistic projectile drop at long range.
//-----------------------------------------------------------
class RedBioGel expands BioGel;

#exec TEXTURE IMPORT NAME=RedPlasma FILE=MODELS\RedPlasma.pcx


function Timer()
{
local RedPlasmaPuff f;

f = spawn(class'RedPlasmaPuff',,,Location + SurfaceNormal*8);
f.DrawScale = DrawScale*2.0;
f.numBlobs = numBio;
if ( numBio > 0 )
f.SurfaceNormal = SurfaceNormal;
PlaySound (MiscSound,,3.0*DrawScale);
if ( (Mover(Base) != None) && Mover(Base).bDamageTriggered )
Base.TakeDamage( Damage, instigator, Location, MomentumTransfer * Normal(Velocity), '');

HurtRadius(damage * Drawscale, DrawScale * 120, 'corroded', MomentumTransfer * Drawscale, Location);
Destroy();
}


defaultproperties
{
Damage=200
numBio=7
speed=20000.000000
MaxSpeed=35000.000000
MomentumTransfer=40000
Texture=Texture'redeye.RedPlasma'
Skin=Texture'redeye.RedPlasma'
LightBrightness=200
LightHue=0
Buoyancy=70.000000
}

Mr.Mitchell
18th Sep 2001, 12:52 PM
Hmmm, now I see. I had this problem also when making my FlakMine mutator. I had a subclass from flakslug and I also couldn't change the texture. I ended up with exporting the original model and importing it again with a different name. From that model I could change the texture the way I explained earlier. It looks like the textures of the projectiles are locked in some sort of way.

As a last resort you could try setting multiskins 0 till 7 to your RedPlasma texture. So try adding multiskins(0)=Texture'redeye.RedPlasma' until multiskins(7)=Texture'redeye.RedPlasma' to your default properties. I don't think this will work to be honest, but it is the only thing I can think of at this moment.

RedEye(Co30)
18th Sep 2001, 01:57 PM
At least it's a real problem, not just something stupid on my part. Now . . . can you suggest some tutorials and tools for doing the model export/reskinning thingie?

I guess this is a good learning experience, started off simple and now I have to get more advanced :)

I've got more problems with this thing too: the collision detections is screwed, probably by the increased speed. If I shoot someone at close or medium range, I get the explosion effect but no damage. At long range it's lethal. Also, when it hits a wall, it "hovers" about 20 units off the wall. And it sticks to the warpzone portals in Radikus instead of going through.

Guess that's what's meant by "work in progress" :)

Mr.Mitchell
18th Sep 2001, 02:20 PM
To export the model you can use WOTGreal (http://www.wotgreal.com). But I think the Biogel mesh is animated so you have to reanimate it, because WOTGreal only exports one frame I think. I have seen another tool that can extract every frame one by one, but I don't know it's name anymore, "UT Package something" I think it was called.

To animate or create models I use MilkShape 3d (http://http://www.swissquake.ch/chumbalum-soft/) which is an inexpensive low-poly modelling program. Note that I am no good at modelling. I CAN make nice looking cubes, cylinders and spheres though. :D

You can also use 3D Studio or so, but I don't have those tools and as far as I know there are very expensive.

For the MilkShape editor there are some good tutorials at the site. I really like the .AVI tutorials, but they are a huge download.

I am no expert at skinning, but some simple skinning can be done with MilkShape. Don't know how it works with other tools.

Raeled
18th Sep 2001, 03:44 PM
The right texture var for the model is #1, so:
multiskin(1)='kickass.kickassskin'
should give it the right texture.

this will make the new code:


//-----------------------------------------------------------
// Projectile for RedBiorifle ---- Calls RedPlasmaPuff instead of GreenPuff,
// which then calls RedPlasmaBlob in place of GreenBlob, as well as a
// ParticleBurst2 effect. GreenSmokePuff effect has been replaced by
// RedSmokePuff which calls the Unrealshare.BloodyPuff effect.
// Ambient light of the projectile has been set to red as well.
// Projectile speed has been increased, effectively making this
// a hitscan weapon at close range. PHYSICS_Falling has been retained,
// allowing relatively realistic projectile drop at long range.
//-----------------------------------------------------------
class RedBioGel expands BioGel;

#exec TEXTURE IMPORT NAME=RedPlasma FILE=MODELS\RedPlasma.pcx


function Timer()
{
local RedPlasmaPuff f;

f = spawn(class'RedPlasmaPuff',,,Location + SurfaceNormal*8);
f.DrawScale = DrawScale*2.0;
f.numBlobs = numBio;
if ( numBio > 0 )
f.SurfaceNormal = SurfaceNormal;
PlaySound (MiscSound,,3.0*DrawScale);
if ( (Mover(Base) != None) && Mover(Base).bDamageTriggered )
Base.TakeDamage( Damage, instigator, Location, MomentumTransfer * Normal(Velocity), '');

HurtRadius(damage * Drawscale, DrawScale * 120, 'corroded', MomentumTransfer * Drawscale, Location);
Destroy();
}


defaultproperties
{
Damage=200
numBio=7
speed=20000.000000
MaxSpeed=35000.000000
MomentumTransfer=40000
Texture=Texture'redeye.RedPlasma'
MultiSkins(1)=Texture'redeye.RedPlasma' // <== changed here only
LightBrightness=200
LightHue=0
Buoyancy=70.000000
}

RedEye(Co30)
19th Sep 2001, 10:18 PM
Tried it, no luck. The blob remains green. Thanks for trying, though.

Raeled
20th Sep 2001, 09:04 AM
that must mean the blob is not your blob.

are you sure the gun shoots your blob?

try add this to the blob:

function PreBeginPlay()
{
Super.PreBeginPlay();
log("I am the kewl blob");
}


and check the UT log

Raeled
20th Sep 2001, 09:30 AM
i got it working (just changed texture of the blob only)

here's the code (if you want to call it code that is :) ):

// ===========================================
// MyBioGel
// ===========================================
class MyBioGel expands BioGel;

defaultproperties
{
MultiSkins(1)=Texture'Botpack.ShaneFX.top2'
}


// ===========================================
// myGESBioRifle
// ===========================================
class MyGESBioRifle expands GESBioRifle;

defaultproperties
{
ProjectileClass=Class'myBioGel'
}

RedEye(Co30)
20th Sep 2001, 10:27 AM
I tried to reply once and the system crashed, so please forgive me if the phantom reply shows up to confuse the issue :)

Raeled:

I added your code to my existing RedBioGel class, with no effect. It won't change the texture, no matter which texture I try to substitute, my own or one of the standard Unreal ones.

However: If I create a new subclass of Biogel, the texture change works, even if I use the new texture in the RedBioRifle package. So something weird is going on with my original class. But now, I can build on the new version and hopefully do some troubleshooting.

Thank you very much!