1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Newbie Q: Changing projectice texture

Discussion in 'Programming' started by RedEye(Co30), Sep 13, 2001.

  1. RedEye(Co30)

    RedEye(Co30) New Member

    Joined:
    Sep 13, 2001
    Messages:
    40
    Likes Received:
    0
    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: Sep 13, 2001
  2. Mr.Mitchell

    Mr.Mitchell New Member

    Joined:
    Sep 5, 2001
    Messages:
    140
    Likes Received:
    0
    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.
     
  3. TaoPaiPai

    TaoPaiPai Commisaire Van Loc

    Joined:
    Jun 13, 2000
    Messages:
    1,626
    Likes Received:
    0
    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.
     
  4. Mr.Mitchell

    Mr.Mitchell New Member

    Joined:
    Sep 5, 2001
    Messages:
    140
    Likes Received:
    0
    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.
     
  5. RedEye(Co30)

    RedEye(Co30) New Member

    Joined:
    Sep 13, 2001
    Messages:
    40
    Likes Received:
    0
    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 :)
     
  6. Mr.Mitchell

    Mr.Mitchell New Member

    Joined:
    Sep 5, 2001
    Messages:
    140
    Likes Received:
    0
    You could try posting the code here ;)
     
  7. RedEye(Co30)

    RedEye(Co30) New Member

    Joined:
    Sep 13, 2001
    Messages:
    40
    Likes Received:
    0
    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
    }
     
  8. Mr.Mitchell

    Mr.Mitchell New Member

    Joined:
    Sep 5, 2001
    Messages:
    140
    Likes Received:
    0
    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.
     
  9. RedEye(Co30)

    RedEye(Co30) New Member

    Joined:
    Sep 13, 2001
    Messages:
    40
    Likes Received:
    0
    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: Sep 18, 2001
  10. Mr.Mitchell

    Mr.Mitchell New Member

    Joined:
    Sep 5, 2001
    Messages:
    140
    Likes Received:
    0
    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. :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.
     
  11. Raeled

    Raeled Feuer Frei!

    Joined:
    Jul 1, 2001
    Messages:
    161
    Likes Received:
    0
    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:
    //----------------------------------------------------------- 
    // 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 
    }
     
  12. RedEye(Co30)

    RedEye(Co30) New Member

    Joined:
    Sep 13, 2001
    Messages:
    40
    Likes Received:
    0
    Didn't Work

    Tried it, no luck. The blob remains green. Thanks for trying, though.
     
  13. Raeled

    Raeled Feuer Frei!

    Joined:
    Jul 1, 2001
    Messages:
    161
    Likes Received:
    0
    that must mean the blob is not your blob.

    are you sure the gun shoots your blob?

    try add this to the blob:

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

    and check the UT log
     
  14. Raeled

    Raeled Feuer Frei!

    Joined:
    Jul 1, 2001
    Messages:
    161
    Likes Received:
    0
    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'
    }
     
  15. RedEye(Co30)

    RedEye(Co30) New Member

    Joined:
    Sep 13, 2001
    Messages:
    40
    Likes Received:
    0
    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!
     

Share This Page