Page 2 of 2 FirstFirst 12
Results 41 to 47 of 47
  1. #41
    Skaarj
    Join Date
    Apr 2012
    Location
    Quilpue, Chile
    Posts
    27
    Gamer IDs

    Gamertag: DonFrag

    Default

    well i was looking and i think that something must be missing, because when the car barely touch the wall or bump it, the car emites a bump sound, so must be some kind of script that fires up when it touch this wall.
    so i think that the next step is to check if that script or line of code exists and how it work.

  2. #42
    MSgt. Shooter Person
    Join Date
    Aug 2010
    Location
    Australia
    Posts
    144

    Default

    I also have a lot of problems figuring out which of the myriad of functions gets called when there is a collision. I usually end up putting a log in about 10 different functions (touch, encroach, bump, raninto, RigidBody...) trying to find the right one.

    The only thing I can suggest is that because the car gets bumped away from the wall it's possible that is done via the AddImpulse function in the vehicle class - maybe put a log in that and similar functions to see if they get called. More likely however it is done via native code in which case you're kind of stuck....

  3. #43
    Palace Guard
    Join Date
    Feb 2010
    Location
    Tegleg Records
    Posts
    3,618
    Gamer IDs

    Gamertag: tegleg digital

    Default

    it could be the suspensionheavyshift sound, ive had problems with that firing at random, you can remove the function that plays it, cant remember what off hand.
    to get when it hits something do like paco suggested and log touch, bump, RigidBodycollision ect..
    Code:
    We.spazmodicaly.simulate.new.sound.with.technical.equipment.that.is.specificaly.manufactured.for.humans.to.communicate.in.outer.space.Tegleg.manipulates.time.and.space.to.create.new.experiences.to.generate.a.hardcore.database.generation.
    Please ask questions in the forum, NOT a private message
    tegleg.co.uk
    My Tutorials n Stuff
    Games: Tegs Playground - Unwheel2 - VCTF Game - Sponic Mesh 3D - Shh.. dont tell anyone about my android apps.
    will code for money

  4. #44
    Skaarj
    Join Date
    Apr 2012
    Location
    Quilpue, Chile
    Posts
    27
    Gamer IDs

    Gamertag: DonFrag

    Default

    simulated event SuspensionHeavyShift (float Delta)

    thats the event that works better o more times, still there is some bumps not detected, but this function is more sensible than others

  5. #45
    Skaarj
    Join Date
    Apr 2012
    Location
    Quilpue, Chile
    Posts
    27
    Gamer IDs

    Gamertag: DonFrag

    Default

    Now i have a new question. The professor in charge asked me to increase the speed..
    so i tried this(using tutorials and post in this forum)
    first i tried to change de torquevcurve, and the basespeed and max speed to a higher value.
    PHP Code:
    class CarPLayer extends UTVehicle_Scorpion_Content;
    var 
    config vector PlayerLocation;
    var 
    float  CurTime;
    var 
    float CurSpeed;
    struct SCollisionsList
    {
        var 
    int RandNumber;
        var 
    float position;
        var 
    float curTime;
        var 
    int nHits;

    };
    var 
    int lap;
    var array< 
    SCollisionsListCollisionsList;

    var() 
    string MessageHud;
    var 
    bool ShowMessageHud;
    var 
    int nRand;
    var 
    int nHits;
    var 
    vector StartPosition;
    var 
    bool xPath;
    //filewriter vars
    var FileWriter FW;
    var 
    string html;
    var 
    SCollisionsList rec;
       

    simulated event PostBeginPlay(){
            
    super.PostBeginPlay();
            
    LockWheels();
            
    EnableFullSteering();
            
            
    //this means that the car is moving through the Y axis, so i read the X change
            
    xPath=false;
               
            
            
    FW =  spawn(class'FileWriter');
            
    FW.OpenFile("results",FWFT_HTML );
             
    html="";
             
    FW.Logf("<html><body><table width='200' border='1'>");
             
    //sTmp=this.Velocity;
            
           
        
    }

    event tick(float DeltaTime)
    {
        
    //  WorldInfo.Game.Broadcast(self,"XXX POS:"$GetALocalPlayerController().Pawn.Location.X);
        //   WorldInfo.Game.Broadcast(self,"YYY POS:"$GetALocalPlayerController().Pawn.Location.Y);
        //WorldInfo.Game.Broadcast(self,"XXX POS:"$WorldInfo.TimeSeconds);
       
        
    CurTime=WorldInfo.TimeSeconds;
         if(
    ShowMessageHud)
         {
            
    // local SCollisionsList newRecord;
             
    rec.RandNumber=nRand;
             if(
    xPath)
             
    rec.position=StartPosition.Y-GetALocalPlayerController().Pawn.Location.Y;
             else
               
    rec.position=StartPosition.X-GetALocalPlayerController().Pawn.Location.X;
           
             
    rec.curTime=CurTime;
             
    rec.nHits=nHits;
             
    LogToHtml(rec);
            
             
             
         }
    }

    function 
    LogToHtml(SCollisionsList cRec)
    {
       
    html="<tr><td>"$cRec.RandNumber$"</td>";
            
    html=html$"<td>"$cRec.position$"</td>";
             
    html=html$"<td>"$cRec.curTime$"</td>";
             
    html=html$"<td>"$cRec.nHits$"</td>";
             
    html=html$"</tr>";
            
              
    FW.Logf(html);
             
        
        
    }
     function 
    PassIn()
     {
         
    ShowMessageHud=true;
         
    StartPosition=GetALocalPlayerController().Pawn.Location;
         
    nRand=GenerateRandomNumber(lap);
         
    MessageHud=string(nRand);
     }
     
     function 
    PassOut()
     {
         
    ShowMessageHud=false;
         
     }
     
     function 
    ChangePath()
     {
         if(
    xPath)
         
    xPath=false;
         else
         
    xPath=true;
     }
    event Touch(Actor OtherPrimitiveComponent OtherCompvector HitLocationvector HitNormal)
    {
            
    local string MetaName;
            
            
            if(
    lap==0)lap=1;
           
            
    MetaName=string(Other);
            
            
    // GetALocalPlayerController().ClientMessage(MetaName);//this works 
            // `Log(MetaName);
     
            
         
    switch(MetaName)
         {
             case (
    "TriggerVolume_0"):
             
    PassIn();
            break;
             
             case (
    "TriggerVolume_1"):
              
    PassOut();
              
             break;
             
             
             case (
    "TriggerVolume_11"):
             
    PassIn();
              
              break;
             
             case (
    "TriggerVolume_12"):
             
    ChangePath();
              
    PassOut();
             break;
             
               case (
    "TriggerVolume_2"):
              
    PassIn();
             break;
             
             case (
    "TriggerVolume_3"):
              
    PassOut();
             break;
             
             case (
    "TriggerVolume_13"):
              
    PassIn();
             break;
             
             case (
    "TriggerVolume_14"):
             
    ChangePath();
              
    PassOut();
             break;
             
             case (
    "TriggerVolume_15"):
              
    PassIn();
             break;
             
             case (
    "TriggerVolume_16"):
              
    PassOut();
             break;
             
              case (
    "TriggerVolume_4"):
              
    PassIn();
             break;
             
             case (
    "TriggerVolume_5"):
             
    ChangePath();
              
    PassOut();
             break;
             
              case (
    "TriggerVolume_6"):
              
    PassIn();
             break;
             
             case (
    "TriggerVolume_7"):
              
    PassOut();
             break;
             
              case (
    "TriggerVolume_17"):
            
    PassIn();
             break;
             
             case (
    "TriggerVolume_18"):
             
    ChangePath();
             
    PassOut();
             break;
             
             
             
             case (
    "TriggerVolume_8"):
             
    lap++;
             
    ShowMessageHud=true;
             
    MessageHud="Vuelta Numero "$lap;
             if(
    lap>1)
             {
                 
    MessageHud="Fin";
                 
    EndGame();
                 
                 
             }
             break;
             
             case (
    "TriggerVolume_9"):
             
    ChangePath();
             
    PassOut();
             break;
             
             
         }
         
         
       
    }
     
    //this function saves all when the game is over
    function  EndGame()
    {
       
            
    FW.Logf("</table></body></html>");      
          
    FW.CloseFile();
            
          
    ConsoleCommand("exit");
            
         
        
    }

    //this function generates a random number. eery lap the game increase the number lenght by one
    simulated function int  GenerateRandomNumber(int nLap)
    {
        
    local int sRandomNumber;
        
    local int nBase;
        
    local int Range1;
        
    local int Range2;
        
        
        
    nBase=5;
        
    Range1=10**(nLap+nBase-1);
        
    Range2=(10**(nLap+nBase))-1;
        
    sRandomNumber=intRandRange(Range1,Range2)); 
             
           return 
    sRandomNumber;
        
              
    }

       
    simulated function bool CalcCamerafloat fDeltaTimeout vector out_CamLocout rotator out_CamRotout float out_FOV )
    {
         
    local vector XYZ;
        
    //this makes the camera stay with the vehicle
        
    GetActorEyesViewPointout_CamLocout_CamRot );

            
    GetAxes(Rotation,X,Y,Z);

            
    // a bit behind
            
    out_CamLoc Location 40 X;
            
    //up a bit
            
    out_CamLoc.Location.25;

        
    //camera rotation yaw = vehicle rotation yaw
        
    out_CamRot.Yaw Rotation.Yaw;
        
    //  look down a bit
        
    out_CamRot.Pitch = (-0.0f     *DegToRad) * RadToUnrRot;
        
    //delete this line if you want the cam to roll with the vehicle
        
    out_CamRot.Roll 0;

        return 
    true;
    }
    simulated function DrawHUDHUD H )
    {
        
      
    super.DrawHUD(H);
        if(
    ShowMessageHud)
        {
       
    H.Canvas.SetPos(H.Canvas.ClipX/2,H.Canvas.ClipY/2-200);  
       
    H.Canvas.SetDrawColor(255255255);  
        
    H.Canvas.Font = class'Engine'.static.GetLargeFont();  
         
    H.Canvas.DrawText(MessageHud);
         }
     
     

    }
    function 
    collidedWith(Actor a
    // both RigidBodyCollision and RanInto end up here
        // My code here
        
        
    nHits++;

        
    }

    simulated event RigidBodyCollision (PrimitiveComponent HitComponentPrimitiveComponent OtherComponent, const out Actor.CollisionImpactData Collisionint ContactIndex)
    {
        
    super.RigidBodyCollision(hitcomponentothercomponentCollisionContactIndex);
        
    collidedWith(OtherComponent.owner);
    }

    event RanIntoActor Other )    // called for encroaching actors which successfully moved the other actor out of the way
    {
        
    super.RanInto(other);
        
    collidedWith(other);
    }
    simulated event PlayTakeHitEffects ()
    {
            
    GetALocalPlayerController().ClientMessage("PLayHIt effects:");
      
    }
    event Bump(Actor OtherPrimitiveComponent OtherCompVector HitNormal)
    {
        
    WorldInfo.Game.Broadcast(self,"Driver Bumped");
         
    WorldInfo.Game.Broadcast(self,Other);
    }

    event HitWall(Vector HitNormalActor WallPrimitiveComponent WallComp)
    {
        
    WorldInfo.Game.Broadcast(GetALocalPlayerController(),"Get driver hitwall!");
    }

       

    event EncroachedBy(Actor Other)
    {
        
      
    GetALocalPlayerController().ClientMessage("EncroachedBy");
    }
    simulated event SuspensionHeavyShift (float Delta)
    {
      
    GetALocalPlayerController().ClientMessage("SuspensionHeavyShift");
    }
    simulated event TornOff()
    {
        
    GetALocalPlayerController().ClientMessage("TornOff:");
    }
        



    defaultproperties
    {
        
    GroundSpeed=50000
        MaxSpeed
    =50000;
         
    bDirectHitWall=True;
         
         
    Begin Object Class=UDKVehicleSimCar  Name=MySimObject
       WheelSuspensionStiffness
    =100.f
        WheelSuspensionDamping
    =3.f
        WheelSuspensionBias
    =0.1f
        ChassisTorqueScale
    =0.f
        MaxBrakeTorque
    =5.f
        StopThreshold
    =100
        MaxSteerAngleCurve
    =(Points=((InVal=0.f,OutVal=45.f),(InVal=600.f,OutVal=15.f),(InVal=1100.f,OutVal=10.f),(InVal=1300.f,OutVal=6.f),(InVal=1600.f,OutVal=1.f)))
        
    SteerSpeed=110
        LSDFactor
    =0.f
        TorqueVSpeedCurve
    =(Points=((InVal=-500.000000),(InVal=-300.000000,OutVal=60.000000),(OutVal=21200.000000),(InVal=24000.000000,OutVal=120.000000),(InVal=28000.000000,OutVal=2150.000000),(InVal=29200.000000)))
       
    EngineRPMCurve=(Points=((InVal=-500.f,OutVal=2500.f),(InVal=0.f,OutVal=500.f),(InVal=549.f,OutVal=3500.f),(InVal=550.f,OutVal=1000.f),(InVal=849.f,OutVal=4500.f),(InVal=850.f,OutVal=1500.f),(InVal=1100.f,OutVal=5000.f)))
        
    EngineBrakeFactor=0.f25f
        ThrottleSpeed
    =0.02f
        WheelInertia
    =0.2f
        NumWheelsForFullSteering
    =4
        SteeringReductionFactor
    =0.f
        SteeringReductionMinSpeed
    =1100.f
        SteeringReductionSpeed
    =1400.f
        bAutoHandbrake
    =true
        bClampedFrictionModel
    =true
        FrontalCollisionGripFactor
    =0.18f
        ConsoleHardTurnGripFactor
    =1.f
        HardTurnMotorTorque
    =0.7f
        SpeedBasedTurnDamping
    =20.f
        AirControlTurnTorque
    =40.f
        InAirUprightMaxTorque
    =15.f
        InAirUprightTorqueFactor
    =-30.f
        WheelLongExtremumSlip
    =0.1f
        WheelLongExtremumValue
    =1.f
        WheelLongAsymptoteSlip
    =2.f
        WheelLongAsymptoteValue
    =0.6f
        WheelLatExtremumSlip
    =0.35f
        WheelLatExtremumValue
    =0.9f
        WheelLatAsymptoteSlip
    =1.4f
        WheelLatAsymptoteValue
    =0.9f
        bAutoDrive
    =false
        AutoDriveSteer
    =0.3f
      End Object
     SimObj
    =MySimObject
     Components
    .Add(MySimObject)
         
     } 
    later i added a hud modification so i can see the current speed
    PHP Code:
    class MyGamePlayerController extends GamePlayerController 
    var 
    BaseGame cBaseGame
         
    simulated event PostBeginPlay(){ 
            
    super.PostBeginPlay(); 
            
    cBaseGame=spawn(class'BaseGame'); 
       
         


    simulated function DrawHUDHUD H )
    local String tmp;
        
    local Pawn P
       
    local string sText;
      
    super.DrawHUD(H);
      if(
    cBaseGame.bShowCountDown)
      {
      
    sText=cBaseGame.sMessage;
        
     
    H.Canvas.SetPos(H.Canvas.ClipX/2,H.Canvas.ClipY/2-200);  
            
    H.Canvas.SetDrawColor(255255255);  
        
    H.Canvas.Font = class'Engine'.static.GetLargeFont();  
                
                
    H.Canvas.DrawText(sText);
            }
            
            
    GetALocalPlayerController().Pawn;
              if (
    != None)
              {
                  
    tmp=String(P.Velocity);
              }
              
    H.Canvas.SetPos(0,0);  
            
    H.Canvas.SetDrawColor(255255255);  
        
    H.Canvas.Font = class'Engine'.static.GetLargeFont();  
                
                
    H.Canvas.DrawText("Speed:"$tmp);
                
                
    //GetALocalPlayerController().ClientMessage("Speed:"$tmp);
       
    }
    state PlayerDriving 

       
        function 
    PlayerMovefloat DeltaTime 
        { 
            
    local float ForwardStrafe
            
    local bool bState;
           
    bState=cBaseGame.Move
             
            
                    
         
    //if the counter gets to start! in BaseGame.uc send a message for debugging purposses 
        //this is not working. its not capturing the BaseGame.Move variable value   
            
    if(bState==true
            { 
              
            
    UpdateRotation(DeltaTime); 

            
    // Get the forward input information 
            
    Forward PlayerInput.aForward
            
            
    // Get the strafe input information 
            
    Strafe PlayerInput.aStrafe
            
    // Remap raw x-axis movement.
            
    Strafe += PlayerInput.aBaseX 7.5 PlayerInput.aMouseX;
       
          

                        if (
    PlayerInput != None
                        { 
                          
    Forward = (((PlayerInput.aTilt.UnrRotToDeg) - 30.f) / 50.f) * -1.f
                        } 
                      

                    
    // Clamp the forward to within -1.f and 1.f 
                    
    Forward FClamp(Forward, -1.f1.f); 
                    
                    
    ProcessDrive(ForwardStrafePlayerInput.aUpbPressedJump); 

                       

                    
    bPressedJump false
                  
              } 
                else 
                { 
                        
    ProcessDrive(00PlayerInput.aUpbPressedJump); 

                } 
               
            } 
             


    defaultproperties
      

    so i compile i can't see any effect on speed. watching the hud indicator of speed, it always tops to 1100 so i cant find a real way of increasing this value.
    what im doing wrong?

  6. #46
    MSgt. Shooter Person
    Join Date
    Jun 2010
    Posts
    453

    Default

    Just a guess from a noob but ... you could try GroundSpeed worked for my pawn , but i dont know its effects on vehicles.
    I 4M 4LW4Y5 H3LPFUL. 4T L345T ! BuMp3D Y0uR THr34D.

  7. #47
    Skaarj
    Join Date
    Apr 2012
    Location
    Quilpue, Chile
    Posts
    27
    Gamer IDs

    Gamertag: DonFrag

    Default

    but i already changed GroundSpeed


 
Page 2 of 2 FirstFirst 12

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.