News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 13th Sep 2001, 03:56 PM   #1
RedEye(Co30)
Registered User
 
Join Date: Sep. 13th, 2001
Posts: 40
Question Newbie Q: Changing projectile texture

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"

Last edited by RedEye(Co30); 13th Sep 2001 at 04:24 PM.
RedEye(Co30) is offline   Reply With Quote
Old 16th Sep 2001, 05:49 AM   #2
Mr.Mitchell
Registered User
 
Join Date: Sep. 5th, 2001
Location: the Netherlands
Posts: 140
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.
Mr.Mitchell is offline   Reply With Quote
Old 16th Sep 2001, 06:06 AM   #3
TaoPaiPai
Commisaire Van Loc
 
TaoPaiPai's Avatar
 
Join Date: Jun. 13th, 2000
Location: Matnik
Posts: 1,623
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.
TaoPaiPai is offline   Reply With Quote
Old 16th Sep 2001, 07:09 AM   #4
Mr.Mitchell
Registered User
 
Join Date: Sep. 5th, 2001
Location: the Netherlands
Posts: 140
Quote:
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.
Mr.Mitchell is offline   Reply With Quote
Old 16th Sep 2001, 09:00 AM   #5
RedEye(Co30)
Registered User
 
Join Date: Sep. 13th, 2001
Posts: 40
Unhappy No luck :(

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
RedEye(Co30) is offline   Reply With Quote
Old 17th Sep 2001, 11:27 AM   #6
Mr.Mitchell
Registered User
 
Join Date: Sep. 5th, 2001
Location: the Netherlands
Posts: 140
Wink

You could try posting the code here
Mr.Mitchell is offline   Reply With Quote
Old 17th Sep 2001, 11:57 AM   #7
RedEye(Co30)
Registered User
 
Join Date: Sep. 13th, 2001
Posts: 40
You asked for it!

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
}
RedEye(Co30) is offline   Reply With Quote
Old 18th Sep 2001, 11:52 AM   #8
Mr.Mitchell
Registered User
 
Join Date: Sep. 5th, 2001
Location: the Netherlands
Posts: 140
Arrow Whooops, silly me. I forgot.

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.
Mr.Mitchell is offline   Reply With Quote
Old 18th Sep 2001, 12:57 PM   #9
RedEye(Co30)
Registered User
 
Join Date: Sep. 13th, 2001
Posts: 40
That's good, in a way . . .

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"

Last edited by RedEye(Co30); 18th Sep 2001 at 01:15 PM.
RedEye(Co30) is offline   Reply With Quote
Old 18th Sep 2001, 01:20 PM   #10
Mr.Mitchell
Registered User
 
Join Date: Sep. 5th, 2001
Location: the Netherlands
Posts: 140
Thumbs up OK let's do it.

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.

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.
Mr.Mitchell is offline   Reply With Quote
Old 18th Sep 2001, 02:44 PM   #11
Raeled
Feuer Frei!
 
Raeled's Avatar
 
Join Date: Jul. 1st, 2001
Location: Dordrecht, The Netherlands
Posts: 161
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:

PHP 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

spawn(class'RedPlasmaPuff',,,Location SurfaceNormal*8); 
f.DrawScale DrawScale*2.0
f.numBlobs numBio
if ( 
numBio 
f.SurfaceNormal SurfaceNormal
PlaySound (MiscSound,,3.0*DrawScale); 
if ( (
Mover(Base) != None) && Mover(Base).bDamageTriggered 
Base.TakeDamageDamageinstigatorLocationMomentumTransfer Normal(Velocity), ''); 

HurtRadius(damage DrawscaleDrawScale 120'corroded'MomentumTransfer DrawscaleLocation); 
Destroy(); 



defaultproperties 

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

Raeled is offline   Reply With Quote
Old 19th Sep 2001, 09:18 PM   #12
RedEye(Co30)
Registered User
 
Join Date: Sep. 13th, 2001
Posts: 40
Unhappy Didn't Work

Tried it, no luck. The blob remains green. Thanks for trying, though.
RedEye(Co30) is offline   Reply With Quote
Old 20th Sep 2001, 08:04 AM   #13
Raeled
Feuer Frei!
 
Raeled's Avatar
 
Join Date: Jul. 1st, 2001
Location: Dordrecht, The Netherlands
Posts: 161
that must mean the blob is not your blob.

are you sure the gun shoots your blob?

try add this to the blob:

PHP Code:
function PreBeginPlay()
{
  
Super.PreBeginPlay();
  
log("I am the kewl blob");


and check the UT log
Raeled is offline   Reply With Quote
Old 20th Sep 2001, 08:30 AM   #14
Raeled
Feuer Frei!
 
Raeled's Avatar
 
Join Date: Jul. 1st, 2001
Location: Dordrecht, The Netherlands
Posts: 161
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'
}
Raeled is offline   Reply With Quote
Old 20th Sep 2001, 09:27 AM   #15
RedEye(Co30)
Registered User
 
Join Date: Sep. 13th, 2001
Posts: 40
Exclamation Curiouser and Curiouser

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!
RedEye(Co30) is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:40 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer