Results 1 to 7 of 7
  1. #1
    MSgt. Shooter Person
    Join Date
    Mar 2005
    Posts
    156

    Default Carrier vehicles

    I don't know why so many people seem to have such a hard time with carrier vehicles. The principle seems kinda easy. Here, check this demo out.

    www.arclength.net/ut2004/carrier.zip


    Slap the files into the System directory, then do

    summon demo.demo

    in the game



    Here's the actual code -- you'll notice it's an extremely simple mod on the Goliath cannon. I have comments where I've added stuff.

    UT2004Addict

    --------------------------------


    //-----------------------------------------------------------
    // Mod by UT2004Addict -- see the Atari forums for info
    //-----------------------------------------------------------
    class DemoCannon extends ONSWeapon;

    var vector OldDir;
    var rotator OldRot;


    ///////// Add this in as a global var
    var ONSHoverBike MyBike;



    #exec OBJ LOAD FILE=..\Animations\ONSWeapons-A.ukx
    #exec OBJ LOAD FILE=..\Textures\BenTex01.utx

    static function StaticPrecache(LevelInfo L)
    {
    L.AddPrecacheMaterial(Material'WeaponSkins.RocketS hellTex');
    L.AddPrecacheMaterial(Material'XEffects.RocketFlar e');
    L.AddPrecacheMaterial(Material'XEffects.SmokeAlpha b_t');
    L.AddPrecacheMaterial(Material'AW-2004Particles.Weapons.TankTrail');
    L.AddPrecacheMaterial(Material'AW-2004Particles.Weapons.SmokePanels2');
    L.AddPrecacheMaterial(Material'ONSInterface-TX.tankBarrelAligned');
    L.AddPrecacheMaterial(Material'VMParticleTextures. TankFiringP.TankDustKick1');
    L.AddPrecacheMaterial(Material'EmitterTextures.Mul tiFrame.rockchunks02');
    L.AddPrecacheMaterial(Material'EpicParticles.Smoke .SparkCloud_01aw');
    L.AddPrecacheMaterial(Material'BenTex01.Textures.S mokePuff01');
    L.AddPrecacheMaterial(Material'AW-2004Explosions.Fire.Part_explode2');
    L.AddPrecacheMaterial(Material'AW-2004Particles.Weapons.HardSpot');
    }

    simulated function UpdatePrecacheMaterials()
    {
    Level.AddPrecacheMaterial(Material'WeaponSkins.Roc ketShellTex');
    Level.AddPrecacheMaterial(Material'XEffects.Rocket Flare');
    Level.AddPrecacheMaterial(Material'XEffects.SmokeA lphab_t');
    Level.AddPrecacheMaterial(Material'AW-2004Particles.Weapons.TankTrail');
    Level.AddPrecacheMaterial(Material'AW-2004Particles.Weapons.SmokePanels2');
    Level.AddPrecacheMaterial(Material'ONSInterface-TX.tankBarrelAligned');
    Level.AddPrecacheMaterial(Material'VMParticleTextu res.TankFiringP.TankDustKick1');
    Level.AddPrecacheMaterial(Material'EmitterTextures .MultiFrame.rockchunks02');
    Level.AddPrecacheMaterial(Material'EpicParticles.S moke.SparkCloud_01aw');
    Level.AddPrecacheMaterial(Material'BenTex01.Textur es.SmokePuff01');
    Level.AddPrecacheMaterial(Material'AW-2004Explosions.Fire.Part_explode2');
    Level.AddPrecacheMaterial(Material'AW-2004Particles.Weapons.HardSpot');

    Super.UpdatePrecacheMaterials();
    }

    simulated function UpdatePrecacheStaticMeshes()
    {
    Level.AddPrecacheStaticMesh(StaticMesh'WeaponStati cMesh.RocketProj');
    Super.UpdatePrecacheStaticMeshes();
    }

    function byte BestMode()
    {
    return 0;
    }

    simulated function PostBeginPlay()
    {
    Super.PostBeginPlay();

    OldDir = Vector(CurrentAim);


    ////////////// Add this stuff in here
    bHidden = True;
    SetCollision(false, false, false);
    }

    function Tick(float Delta)
    {
    ////////// And, of course, the lovely grabbing code.
    if (MyBike == None && Owner != None)
    {
    MyBike = Spawn(class'Onslaught.ONSHoverBike', Self,,location + vect(0,0,50), rotation);
    }

    if (MyBike != None)
    {

    if ( MyBike.Driver == None
    && VSize( MyBike.Location - (Location + vect(0,0,50)) ) <= 500.0 )
    {
    MyBike.SetPhysics(PHYS_None);
    MyBike.SetLocation(location + vect(0,0,50));
    MyBike.SetRotation(Rotation);
    }


    if ( MyBike.Driver != None && MyBike.Physics == PHYS_None)
    {
    MyBike.SetPhysics(MyBike.default.Physics);
    }



    }


    super.Tick(Delta);
    }

    defaultproperties
    {
    YawBone="TankTurret"
    PitchBone="TankBarrel"
    PitchUpLimit=6000
    PitchDownLimit=61500
    WeaponFireAttachmentBone="TankBarrel"
    WeaponFireOffset=200.000000
    RotationsPerSecond=0.180000
    Spread=0.015000
    RedSkin=Shader'VMVehicles-TX.HoverTankGroup.HoverTankChassisFinalRED'
    BlueSkin=Shader'VMVehicles-TX.HoverTankGroup.HoverTankChassisFinalBLUE'
    FireInterval=2.500000
    EffectEmitterClass=Class'Onslaught.ONSTankFireEffe ct'
    FireSoundClass=Sound'ONSVehicleSounds-S.Tank.TankFire01'
    FireSoundVolume=512.000000
    FireForce="Explosion05"
    ProjectileClass=Class'Onslaught.ONSRocketProjectil e'
    ShakeRotMag=(Z=250.000000)
    ShakeRotRate=(Z=2500.000000)
    ShakeRotTime=6.000000
    ShakeOffsetMag=(Z=10.000000)
    ShakeOffsetRate=(Z=200.000000)
    ShakeOffsetTime=10.000000
    AIInfo(0)=(bTrySplash=True,bLeadTarget=True,WarnTa rgetPct=0.750000,RefireRate=0.800000)
    Mesh=SkeletalMesh'ONSWeapons-A.HoverTankCannon'
    }

  2. #2
    Boomshot
    Join Date
    Apr 2001
    Posts
    2,184

    Default

    Now make it work dynmically, I have no problem moving empty vecs and attaching them and unattaching them, it's once there is a player int hem that **** hits the fan.

    Also your code makes the vec move very... jerkily, i'd suggest attachin to a bone myself
    "Mother, mother may I cry. Father will you
    teach me how to die the right way someday. I don't want a
    second chance to turn my stuttering reluctance into romance..."

  3. #3
    MSgt. Shooter Person
    Join Date
    Mar 2005
    Posts
    156

    Default

    This code handles it fine when the player gets out. Did you try the demo before you posted?

    Yeah, this is quick and dirty code to show that it can be done. If you really wanted to be eloquent, you'd do a test where

    if (MyBike.Driver == None
    && MyBike.Location - (Location + vect(0,0,50)) < 200.0
    && MyBike.Location.Z < Location.Z )
    {
    SmoothLanding();
    }

    simulated function SmoothLanding()
    {
    MyBike.SetPhysics(PHYS_None);
    MyBike.MoveSmooth(Location + vect(0,0,50) - MyBike.Location);
    }

    Originally posted by Hsoolien
    Now make it work dynmically, I have no problem moving empty vecs and attaching them and unattaching them, it's once there is a player int hem that **** hits the fan.

    Also your code makes the vec move very... jerkily, i'd suggest attachin to a bone myself

  4. #4
    Boomshot
    Join Date
    Apr 2001
    Posts
    2,184

    Default

    Yes I did try your code. You can't get into the manta if you spwaned onthe blue team but that's undertsandable...


    (and I tried it using a network game, cause SP carrier code is a breeze)


    And I meant have you tried attachin a vec that has a player in it?

    My code works perfectly unless there is a player in the vec that I'm trying to pickup.

    I can pick up an empty vehicle, and they can get into it, out of it no problems, online or offline.

    But if osmeone is in the vec when it is picked up, then one of three things happens.

    If your the vehicle doing the pickup, everything works perfectly (except you have to hide the driver and lights)

    If your in the vec being picked up, you see the pick up vec take off, but your vec stays behind you can no longer move, any shots you fire, originate at the pickup vec, and if he drops you, you TP to where he dropped you, or if you get out, the vec instanly attaches itself to the pick up vec, and you drop of at that point.

    If your someone else int he game, the picked up vec goes, but the driver (i it's a vec that shows the driver) is left behind, ater that it's the same as the driver of the picked up vec
    "Mother, mother may I cry. Father will you
    teach me how to die the right way someday. I don't want a
    second chance to turn my stuttering reluctance into romance..."

  5. #5
    MSgt. Shooter Person
    Join Date
    Mar 2005
    Posts
    156

    Default

    Thanks for sharing your results. For some reason, UT retains the old vehicle position when you move it, unless you set PHYS_Karma and then have to write an attraction function using KAddImpulse. Strange glitch in the engine.

    Some other weird stuff happens, too, with the bike -- for some reason, when it gets its physics set to PHYS_None and then back again, it behaves all wonky and flips over. You have do to a full MyBike.Reset() to get it to behave, but of course that will kill any driver in it. Crazy stuff.

    I wonder if this happens because the pawn gets moved with no controller in it. Maybe making a dummy controller would solve this problem...

    Cheers!


    Originally posted by Hsoolien
    Yes I did try your code. You can't get into the manta if you spwaned onthe blue team but that's undertsandable...


    (and I tried it using a network game, cause SP carrier code is a breeze)


    And I meant have you tried attachin a vec that has a player in it?

    My code works perfectly unless there is a player in the vec that I'm trying to pickup.

    I can pick up an empty vehicle, and they can get into it, out of it no problems, online or offline.

    But if osmeone is in the vec when it is picked up, then one of three things happens.

    If your the vehicle doing the pickup, everything works perfectly (except you have to hide the driver and lights)

    If your in the vec being picked up, you see the pick up vec take off, but your vec stays behind you can no longer move, any shots you fire, originate at the pickup vec, and if he drops you, you TP to where he dropped you, or if you get out, the vec instanly attaches itself to the pick up vec, and you drop of at that point.

    If your someone else int he game, the picked up vec goes, but the driver (i it's a vec that shows the driver) is left behind, ater that it's the same as the driver of the picked up vec

  6. #6
    Boomshot
    Join Date
    Apr 2001
    Posts
    2,184

    Default

    Mostly it's replication issues.

    I'm halfway to a solution, it involves spawing seperate actors that replicate across the whole network (i hope at least, still have to test with mroe then one player) IF I can convince all clients the vec was attached even though it has a controller, I think it will work... (it's having a contorller/PRI I think that bugs things up, cause there are now two conflicing rules on whats happening...)
    "Mother, mother may I cry. Father will you
    teach me how to die the right way someday. I don't want a
    second chance to turn my stuttering reluctance into romance..."

  7. #7
    Iron Guard
    Join Date
    Apr 2004
    Posts
    811

    Default

    I think you just need to replicate the attaching function, and make sure to set it to hard attach the vehicle to the transport. Then it should (by the actor code) get its movement information from the vehile it is attached to.

    To see what I mean, look at how the turrets are attached to a vehicle.

    You might have to find the variables where it stores position and rotation, and set them to the current location when you drop the vehicle, if the tele issue isnt fixed by doing the aforementiond.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.