Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Ball/Rolling Vehicle (plug n play)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Ball/Rolling Vehicle (plug n play)

    hello

    here is a rolling vehicle.
    you can get in and out of it, rolls away/toward the camera using up/down arrows.
    perhaps someone will find it usefull

    download the script and package file here




    Code:
    //tegleg 2012 http://tegleg.co.uk
    class Ball_Vehicle2 extends UTVehicle
    placeable;
    
    simulated function PostBeginPlay()
    {
    	Super.PostBeginPlay();
    
        Mesh.WakeRigidBody();
    }
    
    simulated function SetInputs(float InForward, float InStrafe, float InUp)
    {
    	Throttle = InForward;
    	Steering = InStrafe;
    	Rise = InUp;
    
    	ApplyForce(Throttle*1000);
    }
    
    function ApplyForce(float Force)
    {
        local vector X, Y, Z, RotationForce;
        //work out force direction
        GetAxes(Controller.Rotation, X, Y, Z);
        RotationForce = Force  * Y;
    
         //apply force
        Mesh.AddTorque(RotationForce);
    }
    
    function bool TryToDrive(Pawn P)
    {
    	return Super.TryToDrive(P);
    }
    
    //overide to stop it blowing up
    simulated event RigidBodyCollision( PrimitiveComponent HitComponent, PrimitiveComponent OtherComponent,
    								   const out CollisionImpactData Collision, int ContactIndex );
    //overide to stop it blowing up
    simulated event TakeDamage(int Damage, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser);
    
    DefaultProperties
    {
       Begin Object Name=CollisionCylinder
    		CollisionHeight=40.0
    		CollisionRadius=100.0
    		Translation=(X=-25.0)
    	End Object
    
         Seats.Empty
    	Seats(0)={(	GunClass=None,
    				GunSocket=(TurretFireSocket),
    				GunPivotPoints=(gun_rotate),
    				TurretVarPrefix="",
    				TurretControls=(TurretRotate),
    				SeatIconPos=(X=	0.415,Y=0.5),
    				bSeatVisible=true,
    				SeatBone=Main_Root,
    				SeatOffset=(X=40,Y=0,Z=-60),
    				CameraTag=GunViewSocket,
    				CameraBaseOffset=(X=0.0),
    				CameraOffset=-475,
    				WeaponEffects=((SocketName=TurretFireSocket,Offset=(X=-14,Y=5),Scale3D=(X=2.0,Y=3.0,Z=3.0)),(SocketName=TurretFireSocket,Offset=(X=-14,Y=-5),Scale3D=(X=2.0,Y=3.0,Z=3.0)))
    				)}
    
    Begin Object Name=SVehicleMesh
    	SkeletalMesh=SkeletalMesh'Ball_Vehicle_Package.Mesh.SK_VH_Ball'
    		PhysicsAsset=PhysicsAsset'Ball_Vehicle_Package.Mesh.SK_VH_Ball_Physics'
    		RBCollideWithChannels=(Default=TRUE,BlockingVolume=TRUE,GameplayPhysics=TRUE,EffectPhysics=TRUE,Vehicle=TRUE,Untitled4=TRUE)
    	End Object
    
        Mesh=SVehicleMesh
        CollisionComponent=SVehicleMesh
    
    	DrivingPhysicalMaterial=PhysicalMaterial'EngineMaterials.PhysMat_VehicleRagdoll'
    	DefaultPhysicalMaterial=PhysicalMaterial'EngineMaterials.PhysMat_VehicleRagdoll'
    
    	bCanFlip=false
    	bMustBeUpright=false
    	UpsideDownDamagePerSec=0.0
    	OccupiedUpsideDownDamagePerSec=0.0
    	bEjectPassengersWhenFlipped=false
    }
    heres a vid using this script with the scorpion mesh

    have fun
    Attached Files

    #2
    looks like fun, Marble Madness any one

    Comment


      #3
      if anyone would like to post a ball skelital mesh that would be awesome
      im gona have to try blender again i suppose

      Comment


        #4
        sent you something simple if you need more let me know

        Comment


          #5
          updated the first post with a script and package download and some pics
          cheers geodav, i managed to get 3ds working again in the end, thanks anywayz

          Comment


            #6
            That's like the "Chariot of Hueca" in The Ball. Only prettier.

            Comment


              #7
              Weapons!

              I wanna add some weapons to that ball! but can't :'(
              Help pleeeeease!

              Comment


                #8
                off the top of my head,
                if you want the weapon not to rotate with the ball, add another bone just outside the ball, in the animtree have the bone always pointing forward (probably have to mess with bonespace ect)
                add the weapon class to the seat along with the other weapon related stuff
                this bit
                Code:
                GunClass=None ,//change to your gun class
                				GunSocket=(TurretFireSocket),//the socket attached to the gun bone
                				GunPivotPoints=(gun_rotate),//the gun rotation bone, check scorpoion ect for an example
                				TurretVarPrefix="",
                				TurretControls=(TurretRotate)

                Comment

                Working...
                X