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

    #16
    no,but the spring itself works perfectly.

    Comment


      #17
      Code:
      simulated function checkengine()
      {
             local SkelControlListHead LH;
             local utSkelControl_DamageSpring engineSkelControl;
             local SkelControlBase NextSkelControl;
             local float bonescale;
      
                       
                       foreach AnimTree(Mesh.Animations).SkelControlLists(LH)
      				{
      					NextSkelControl = LH.ControlHead;
      					while (NextSkelControl != None)
      					{
      						engineSkelControl = utSkelControl_Damagespring(NextSkelControl);
                                                      bonescale=engineSkelControl.bonescale;
      
      						`log(NextSkelControl@engineSkelControl@bonescale);
      
      						if( engineSkelControl != none)
      						{
                                                           if( engineSkelControl.bisbroken == true )
      							{
      
      								        killengine();
                                                               }
      						}
      
      						NextSkelControl = NextSkelControl.NextControl;
      					}
      				}
                     SetTimer(1, false, 'checkengine');
      }
      ok, so I went back to this and can sucsessfully monitor the bonescale for all controllers.

      from the log

      Code:
      ScriptLog: UTSkelControl_DamageSpring_1 UTSkelControl_DamageSpring_1 1.0000
      [0051.85] ScriptLog: UTSkelControl_DamageSpring_2 UTSkelControl_DamageSpring_2 1.0000
      [0051.85] ScriptLog: kill the engine
      [0051.85] ScriptLog: UTSkelControl_DamageSpring_3 UTSkelControl_DamageSpring_3 1.0000
      [0051.85] ScriptLog: UTSkelControl_DamageSpring_4 UTSkelControl_DamageSpring_4 1.0000
      [0051.85] ScriptLog: UTSkelControl_DamageSpring_5 UTSkelControl_DamageSpring_5 0.0000
      [0051.85] ScriptLog: kill the engine
      [0051.85] ScriptLog: UTSkelControl_DamageSpring_6 UTSkelControl_DamageSpring_6 0.0000
      [0051.85] ScriptLog: kill the engine
      [0051.85] ScriptLog: UTSkelControl_DamageSpring_7 UTSkelControl_DamageSpring_7 1.0000
      [0051.85] ScriptLog: UTSkelControl_DamageSpring_8 UTSkelControl_DamageSpring_8 1.0000
      [0051.85] ScriptLog: UTSkelControl_DamageSpring_9 UTSkelControl_DamageSpring_9 1.0000
      [0051.85] ScriptLog: UTSkelControl_DamageSpring_10 UTSkelControl_DamageSpring_10 1.0000
      [0051.85] ScriptLog: UTSkelControl_DamageSpring_11 UTSkelControl_DamageSpring_11 1.0000
      the engine is UTSkelControl_DamageSpring_10 ,but im unsure how to replace the none in the line

      Code:
      if( engineSkelControl != none)

      Comment


        #18
        if(engineSkelControl.ControlName == 'WhateverYouCalledIt')
        {....

        Comment


          #19
          ah sweet succsess.thanks Mick.

          ive got the exhaust half sorted too.

          I had hoped to post the car today,but it will be a couple more days yet.

          Comment


            #20
            ey up this is something you might find useful (or not) to break wheels
            extend the wheel class and add a Health variable, in the function below my wheel is called 'TegVehicleWheel_New' so change that to your class name
            put this in the car's TakeDamage
            Code:
            //wheel damage
            	DamageWheel(mesh.FindClosestBone(HitLocation), Damage, HitLocation);
            and here is the rest
            Code:
            simulated function DamageWheel(name BoneName, int DamageAmount, vector HitLoc)
            {
                local int WheelIndex;
            
            //you may have to change values here, check your wheel objects
                if (BoneName == 'F_R_Tire')
                {
                    WheelIndex = 2;
                }
                if (BoneName == 'F_L_Tire')
                {
                    WheelIndex = 3;
                }
                if (BoneName == 'B_R_Tire')
                {
                    WheelIndex = 1;
                }
                if (BoneName == 'B_L_Tire')
                {
                    WheelIndex = 0;
                }
            
                //take health from the wheel
                TegVehicleWheel_New(Wheels[WheelIndex]).Health -= DamageAmount;
               
                //wheel is dead so break it
                if (TegVehicleWheel_New(Wheels[WheelIndex]).Health <= 0)
                {
            
                   if (BoneName != 'Main_Root') //make sure its not main_root
                   {  
                      //hide bone
                      mesh.HideBoneByName(BoneName, PBO_Disable);
                      //break wheel
                      BreakWheel(WheelIndex);
                      //spawn explosion, add a WheelBreakParticle variable to the car, could be a physx particle of the wheel mesh
                      WorldInfo.MyEmitterPool.SpawnEmitter(WheelBreakParticle, HitLoc, Rotation);
                   }
            
                }
            }
            
            simulated function BreakWheel(int MyInt)
            {
                 //set wheel props
                  Wheels[MyInt].WheelRadius = 0.01;
                  Wheels[MyInt].LatSlipFactor = 0.001;
                  Wheels[MyInt].LongSlipFactor = 0.001;
                  Wheels[MyInt].SteerFactor = 0.0;
                  Wheels[MyInt].bCollidesPawns = False;
                  Wheels[MyInt].bCollidesVehicles = False;
                  Wheels[MyInt].MotorTorque = 0.0;
            
                  //hack to force physics to re-init
                 //might be a better way but i didnt find it
                 if (bDriving)
                 {
                   SetDriving(false);
                   SetDriving(true);
                 }
                 else
                 {
                    SetDriving(true);
                    SetDriving(false);
                 }
            }

            Comment


              #21
              this was next on the list to look at,thanks.

              Comment


                #22
                your code works great,but I have a weird displacement issue going on with 1 wheel and I was going no where with the exhaust so I had a break from the code and started the lambo.



                Comment


                  #23
                  Gaz,i was watching the video in the first post(in the begining) and the car doesnt shades good.When making the lambo be careful with the normals.(i think in max is called normal angle and you modify it to be soft or hard.)An example with my trash can in maya.If the normals are set the correct way and hide those triangles the final normal map will be rendered better and the surface will be smooth flat as it shoud.

                  Apologies if i said something you already knew

                  Comment


                    #24
                    I think you mean the windows in the first vid.i just hadn't done the smoothing groups in that one.smoothing groups usually take care of most problems and I rarely use the edit normal modifier.

                    Comment


                      #25
                      Yeah,i ment smoothing groups.Not only the windows but the frame of the car body.The effect is more visible on the door frames when its being lit but its a finished models and not worth going back to fix this.I just wanted to note that in case you havent payed atention but it looks like you knew that so my bad.
                      Do you have any poly budget for the lambo?If not no need to go too low poly on that as i lately see that cars in racing games tend to have more and more insane polycount.(speaking in the range of 100 000 and up,not including the interior lol)but for udks purpose you coud achieve a nice surface shading with something like 20k.
                      Is the lamborgini going to be in your game?

                      Comment


                        #26
                        the lambo is only my second attempt at this kind of modelling so still lots to learn.i will try to keep the poly count below 20k but the most important thing is for it to destructible.i wont be using mesh smooth or turbo smooth.

                        Frankit asked for a lambo so that's why im building it.it will go in the community content section along with the peugot.

                        im doing it because i needed a break from my game.

                        Comment


                          #27
                          peugot 206

                          ive got all lights working and the morph damage materials are finally done.

                          I cant for the life of me find where the PitchModulation is done.i can change the exhaust sound but I cant get it to rev.

                          I cant get the wheel damage working right either,i works but the damage isn't contained to the wheels.all bones are shootable including the drivers seat,lol.

                          I will post the car and code in its current state tomorrow and then update the code as and when.

                          I have also done more to the Lamborghini.



                          Comment


                            #28
                            Its fun watching the Lambo evolve. Thanks for sharing Gaz661...

                            Comment


                              #29
                              You are not going to make the lambo high poly in order to make a normal map right?If so there is another way.Havent tryed it but i know it works.Mental ray has a shader that makes/renders round and smooth edges.Its the same shader in maya and max.I know that if you apply that shader to a low poly object(like a qube)it will give it the proper smooth edges without making a high poly version of it for the normal map.It will work on the car too in the round areas.Forgot how the workflow was but just type in google something like (mental ray shader round edges shader normal map)lol and you will get a example.

                              Comment


                                #30
                                I see what your getting at and that's opened up a whole can of worms.ive been using crazybump till now.

                                thanks for the gentle push in the right direction.

                                frankit,no worries,its strangely fascinating for me to watch too.

                                Comment

                                Working...
                                X