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

refreshing myself on the vehicle systems

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

    refreshing myself on the vehicle systems



    I will be posting this car in the community content section when its done so I thought I would show how its coming along.

    why a peugot 206?it just happens to be the car Im driving at the moment,pink gear stick and all.

    download peugot here

    http://www.mediafire.com/download/dj...peugot_206.zip

    #2
    Super work. Nice damage system too.

    But seriously how about a Lambo or McLaren?

    Something to day dream about on a dreary wednesday

    Comment


      #3
      thanks Frankit,pick a model and I will get on it shortly.

      http://www.the-blueprints.com/blueprints/

      when I started this model I did something I really should have done a long time ago.ive watched loads of tuts for udk on youtube in the last 5 years but it never occurred to me to watch any max tuts.
      well I did watch a couple and I think ive vastly improved my modelling skills,now im eager to push myself.

      Comment


        #4
        When it comes to Lambos I'm not afraid to hold out my hand and ask for charity
        Either of these bad boys should do it.. Cheers in advance Gaz661!

        http://www.the-blueprints.com/bluepr...ntador__2011_/
        http://www.the-blueprints.com/bluepr..._700_4__2012_/

        Comment


          #5



          the 206 in near completion.

          13396 polys
          22 destuctable parts
          5 morph targets

          im using utskelcontrol_damagespring for most of the destructible parts and am looking for a way to notify the script when a part falls off,ie exhaust,so I can alter the engine sounds,but im not having much luck.

          Comment


            #6
            looking good gaz
            Code:
            /**
             * This event is triggered when the spring has decided to break.
             *
             * Network - Called everywhere except on a dedicated server.
             */
            simulated event BreakApart(vector PartLocation, bool bIsVisible)
            in that function you would do something like
            if (BrokenBone == 'exhaustbone'){
            YourVehicleClass(OwnerVehicle).changeexhaustnote() ;

            edit:
            im revisiting vehicle destruction myself atm, you say 22 destructible parts, does this mean you use 22 bones for this?
            have you tested it multiplayer?

            Comment


              #7
              yes im using separate bones for each part and tweeking the physicasset,although the physicaset doesn't seem to be that important.

              ive not tried any multiplayer stuff at all im afraid.

              Code:
              if (BrokenBone == 'exhaustbone')
                      {
                         class'peugot206_vehicle'(OwnerVehicle).changeexhaustnote() ;
              
                      }
              this gives me :Error, '(' Expression has no effect

              I think im almost there like this in my vehicle.uc

              Code:
              simulated function checkengine()
              {
                     local SkelControlListHead LH;
                     local utSkelControl_DamageSpring engineSkelControl;
                     local SkelControlBase NextSkelControl;
                     
              
                               
                               foreach AnimTree(Mesh.Animations).SkelControlLists(LH)
              				{
              					NextSkelControl = LH.ControlHead;
              					while (NextSkelControl != None)
              					{
              						engineSkelControl = utSkelControl_Damagespring(NextSkelControl);
              						if( engineSkelControl != none)
              						{
                                                                   if( engineSkelControl.bisbroken == true )
              							{
              								        groundspeed=0;
                                                                       }
              						}
              
              						NextSkelControl = NextSkelControl.NextControl;
              					}
              				}
                             SetTimer(1, false, 'checkengine');
              }
              this alters the groundspeed var(although not the actual speed of the car) when any piece is shot of so I created a new class DASkelControl_DamageSpring and assigned it in the animtree to the engine then altered the code

              Code:
              simulated function checkengine()
              {
                     local SkelControlListHead LH;
                     local DASkelControl_DamageSpring engineSkelControl;
                     local SkelControlBase NextSkelControl;
                     
              
              
                               
                               foreach AnimTree(Mesh.Animations).SkelControlLists(LH)
              				{
              
              					NextSkelControl = LH.ControlHead;
              					while (NextSkelControl != None)
              					{
              						engineSkelControl = DASkelControl_Damagespring(NextSkelControl);
              						if( engineSkelControl != none)
              						{
                                                                   if( engineSkelControl.bisbroken == true )
              							{
              								        groundspeed=0;
                                                                       }
              						}
              
              						NextSkelControl = NextSkelControl.NextControl;
              					}
              				}
                             SetTimer(1, false, 'checkengine');
              }
              but this no longer works.

              Comment


                #8
                "Error, '(' Expression has no effect"
                you would have to put that function in your vehicle for it to work
                im assuming checkengine() is called every tick which is not good, doing it from the spring class would only trigger when the bone breaks
                so in your vehicle
                Code:
                function changeexhaustnote()
                {
                //do stuff here to change the engine sound ect
                }
                and in the spring code it wouldnt be
                class'peugot206_vehicle'(...)
                it would be
                peugot206_vehicle(...)

                and this part
                if (BrokenBone == 'exhaustbone')
                is assuming your bone for the exhaust is called 'exhaustbone', change that to the name you are using in the skeleton

                Comment


                  #9
                  I had it as a simulated function in the vehicle code.ive just changed it to function and its copiled,so I can test now.

                  exhaustbone is called exhaustbone,but I was actually testing the engine.engine bone is engine.
                  i wasn't doing it in tick,i had it on a 1 second timer.

                  Thanks Mick.

                  edit:BrokenBone always returns as none

                  Code:
                  `log("busted"@BrokenBone);
                  
                  	if (BrokenBone == 'engine')
                          {
                            peugot206_vehicle(OwnerVehicle).killengine() ;
                            `log("try to kill engine");
                          }
                  to test I set if (BrokenBone == 'none') and again it works but whenever any piece is shot off.

                  Comment


                    #10
                    BrokenBone always returns as none
                    hmm ok thats strange

                    in UDKSkelControl_Damage it has
                    /** This holds the name of the bone that was broken */
                    var transient name BrokenBone;
                    would have thought that variable gets filled, guess it doesnt

                    maybe there is some check box in the skel control or something?
                    im messing with all this kind of thing atm so ill let you know if i find a solution

                    edit:
                    another way is to call checkengine() from the skel control BreakApart() instead of the timer

                    Comment


                      #11
                      Originally posted by tegleg View Post
                      another way is to call checkengine() from the skel control BreakApart() instead of the timer
                      yeah,thats where im using it,ive removed all my stuff from the vehicle code and am using the code in my previous post.

                      Comment


                        #12
                        ive done it in a different way.

                        Code:
                        local int i;
                        	local name BoneName;
                        
                        	
                                ///if(damageType == class'UTDmgType_VehicleCollision')
                                if(Damage >= 1)
                        	{
                        
                        
                                 for (i=0;i<Mesh.PhysicsAsset.BodySetup.Length;i++)
                                     {
                                 BoneName = Mesh.PhysicsAsset.BodySetup[i].BoneName;
                                 
                                 `log(bonename@Damage@DamageType);
                                 
                        
                        			//if ( BoneName != '' && Mesh.MatchRefBone(BoneName) != INDEX_NONE)
                        			if ( BoneName == 'engine' && Mesh.MatchRefBone(BoneName) != INDEX_NONE)
                        			{
                                                    `log("engine damaged"@Damage);
                                                    enginetotaldamage=enginetotaldamage+Damage;
                                                    
                                                    if  (enginetotaldamage > 510)
                                                           {
                                                              DriverLeave(true);
                                                              bIsDisabled = true;
                                                              Mesh.HideBoneByName(BoneName, PBO_term);
                                                           }
                                                    }
                                     }
                        in the takedamage event in the vehicle.uc.

                        thanks for the input.

                        Comment


                          #13
                          hey gaz
                          how do you get the spring to activate?
                          doesnt seem to happen for me

                          Comment


                            #14
                            no,i wasnt using the spring in this case,but rather tried to do it in the same way I do the zombie dismemberment.but Mesh.BreakConstraint doesn't sem to work on vehicles so I went with Mesh.HideBoneByName and a PhysX emitter.

                            but after further testing yesterday and adding the exhaust stuff I found that the damage received isn't selective but rather,when the main_root is damaged,all bones are damaged.it kind of works,from my example,the cars health is 350 but the damage the engine bone takes to be destroyed is 510.so I can have the engine fall out and the player left unable to drive.

                            today ive been exploring your suggestion again but haven't got any further.

                            Code:
                            class DASkelControl_DamageSpring  extends UDKSkelControl_DamageSpring;
                            
                            
                            /**
                             * This event is triggered when the spring has decided to break.
                             *
                             * Network - Called everywhere except on a dedicated server.
                             */
                            simulated event BreakApart(vector PartLocation, bool bIsVisible)
                            {
                            	local UTGib Gib;
                                    `log("dabusted");
                            
                            	if (BrokenBone != 'none')
                                    {
                                      peugot206_vehicle(OwnerVehicle).killengine() ;
                                      `log("try to kill engine");
                                    }
                            
                            	if( !bOnDamageActive
                            		|| ( BreakMesh == none )
                            		|| ( OwnerVehicle == none )
                            		|| bIsBroken
                            		)
                            	{
                            		// if this was called these flags should be set even if there is no visual effects
                            		bIsBreaking = FALSE;
                            		bIsBroken = TRUE;
                            		`log("da break"@BrokenBone);
                            		return;
                            	}
                            
                            	if ( bIsVisible && (OwnerVehicle.WorldInfo.NetMode != NM_DedicatedServer) )
                            	{
                            		Gib = UTVehicle(OwnerVehicle).SpawnGibVehicle(PartLocation, OwnerVehicle.Rotation, BreakMesh, PartLocation, true, DefaultBreakDir, PS_DamageOnBreak, PS_DamageTrail);
                            
                            		if( Gib != none )
                            		{
                            			Gib.SetDrawScale3D( DamageScale );
                            		}
                            	}
                            
                            	BoneScale = DamageBoneScale;
                            	bIsBreaking = FALSE;
                            	bIsBroken = TRUE;
                            	`log("da break"@BrokenBone);
                            }
                            
                            simulated event BreakApartOnDeath(vector PartLocation, bool bIsVisible)
                            {
                            	local UTGib Gib;
                            	
                            	`log("dadeath");
                            
                            	if ( !bOnDeathActive )
                            	{
                            		return;
                            	}
                            	if ( DeathStaticMesh == None )
                            	{
                            		DeathStaticMesh = BreakMesh;
                            	}
                            	if( ( DeathStaticMesh == none )
                            		// if we are not within the percentage to spawn
                            		|| ( DeathPercentToActuallySpawn < FRand() )
                            		|| ( OwnerVehicle == none )
                            		|| bIsBroken )
                            	{
                            		// if this was called these flags should be set even if there is no visual effects
                            		bIsBroken = TRUE;
                            		return;
                            	}
                            
                            	if( bIsVisible && (OwnerVehicle.WorldInfo.NetMode != NM_DedicatedServer) )
                            	{
                            		Gib = UTVehicle(OwnerVehicle).SpawnGibVehicle(PartLocation, OwnerVehicle.Rotation, DeathStaticMesh, PartLocation, true, DeathImpulseDir, None, PS_DeathTrail);
                            
                            		if( Gib != none )
                            		{
                            			Gib.SetDrawScale3D( DeathScale );
                            		}
                            	}
                            
                            	BoneScale = DeathBoneScale;
                            	bIsBroken = TRUE;
                            }
                            
                            
                            defaultproperties
                            {
                            
                            }
                            this is a straight copy of UTSkelControl_DamageSpring with your addition and when I relace the node in the animtree it works perfectly but just doesn't send logs or the killengine function.

                            Comment


                              #15
                              I went with Mesh.HideBoneByName and a PhysX emitter...
                              damage received isn't selective but rather,when the main_root is damaged,all bones are damaged
                              right ok thank you, i was hoping the built in stuff just worked, guess not, or not as you would think.
                              its probably better to code my own system anyway, then i get control of it all.


                              so this log doesnt even show up?
                              `log("dabusted");

                              cheers

                              Comment

                              Working...
                              X