Announcement

Collapse
No announcement yet.

making weapons solid

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

    making weapons solid

    Hi there,
    Ive been playing about making vehicles/stationary turrets, but i cant seem to make what ever weapon I'm using solid.
    do i have to give the weapon a separate set of Kparams?
    thanks.

    #2
    All animatino meshes need collison boxes set on them for vec and stationary turret usage....

    Comment


      #3
      thanks
      do you mean just straight forward collision height and radius settings?
      And just cheking.. 'vec' is short for vehicles?

      Comment


        #4
        I tried giving, for instance, a tank cannon a collision box, but everything still went straight through... But then the Goliath cannon seems to have collision. But then again the Goliath seems to have some weird bit of code in its Tick event that I can't understand...

        Anyone shed some light on this?

        Comment


          #5
          I mean giving it collison boxes in the animation browser FatalOverdose

          And Xyx, As far as I have experianced, no weapons attached to a vec have collision, the collison on all aniamtions is kinf od weird...

          The tick code is odd, I'll look at it fuirther later...

          Comment


            #6
            I think the bit of code your talking about limits the max falling speed of the tank.?

            Comment


              #7
              That too, but that is not enough to fill the full page of code there is.

              Comment


                #8
                ..er looks like it translates the craft intended velocity to the pan speed of the tracks to simulate the tacks moving.

                OK I've had a look in the animations browser and the collision setting seem pretty straight forward but if there are no collision boxes already set on the weapons how come they are solid in the game? I cant find any setting defining collision for them in the vehicle classes or the weapon classes
                Thanks

                Comment


                  #9
                  As far as I know, no animated anything has collision. Animated meshes dont collide, and I have never found a way to do so. You might be able to get a collision cylinder going, but thats about it (via CollsionHeight and CollisionRadius, and bUseCollisionCylinder=True).

                  Comment


                    #10
                    Hmm... the Goliath Tick is only about the treads indeed. My apologies, I had it mixed up with the Goliath cannon Tick, which certainly does provide a sort of collision. Check it out:
                    Code:
                    function Tick(float Delta)
                    {
                    	local int i;
                    	local xPawn P;
                    	local vector NewDir, PawnDir;
                        local coords WeaponBoneCoords;
                    
                    
                        Super.Tick(Delta);
                    
                    	if ( (Role == ROLE_Authority) && (Base != None) )
                    	{
                    	    WeaponBoneCoords = GetBoneCoords(YawBone);
                    		NewDir = WeaponBoneCoords.XAxis;
                    		if ( (Vehicle(Base).Controller != None) && (NewDir.Z < 0.9) )
                    		{
                    			for ( i=0; i<Base.Attached.Length; i++ )
                    			{
                    				P = XPawn(Base.Attached[i]);
                    				if ( (P != None) && (P.Physics != PHYS_None) && (P != Vehicle(Base).Driver) )
                    				{
                    					PawnDir = P.Location - WeaponBoneCoords.Origin;
                    					PawnDir.Z = 0;
                    					PawnDir = Normal(PawnDir);
                    					if ( ((PawnDir.X <= NewDir.X) && (PawnDir.X > OldDir.X))
                    						|| ((PawnDir.X >= NewDir.X) && (PawnDir.X < OldDir.X)) )
                    					{
                    						if ( ((PawnDir.Y <= NewDir.Y) && (PawnDir.Y > OldDir.Y))
                    							|| ((PawnDir.Y >= NewDir.Y) && (PawnDir.X < OldDir.Y)) )
                    						{
                    							P.SetPhysics(PHYS_Falling);
                    							P.Velocity = WeaponBoneCoords.YAxis;
                    							if ( ((NewDir - OldDir) Dot WeaponBoneCoords.YAxis) < 0 )
                    								P.Velocity *= -1;
                    							P.Velocity = 500 * (P.Velocity + 0.3*NewDir);
                    							P.Velocity.Z = 200;
                    						}
                    					}
                    				}
                    			}
                    		}
                    		OldDir = NewDir;
                    	}
                    }
                    What this does is push people off the tank if the barrel turns into them. You can confirm this by freezing the game and climbing onto an enemy Goliath. They'll sweep you off with the barrel. I vaguely remember reports of the barrel even roadkilling people, but I could not confirm that.

                    I don't really have a clue how this works, but it does. It looks like it checks to see who's in contact with the weapon, and adds some velocity to whoever it finds.

                    Note that the weapon does not Tick when nobody is manning it, so the weapon is only solid when the Goliath is being driven.

                    Comment


                      #11
                      lol... what a odd way of doing things.
                      Hold on if theres no collision you can set on animated meshes..whats the collision box's for in the animation browser?

                      Comment


                        #12
                        Those boxes work fine for the vehicle mesh, just not for its weapons... I guess they have different karma stuff applied to them.

                        Comment


                          #13
                          What about collision staticmeshes? I noticed that the hellbender has a collision staticmesh that includes the rear and side turret. I've watched a few collision tuts, and this isn't explained very well as it applies to vehicles.

                          Comment


                            #14
                            Ive never tried that with animated meshes. I could never get it working. Also remember that static meshes are, well, static. So they will only be accurate in one position.

                            Comment

                            Working...
                            X