Announcement

Collapse
No announcement yet.

Checking states, Checking vertical distance, Checking checking checking

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

    #16
    Setting traceheight anywhere from 1000 to 20000 has no visible effect.

    I implemented the timer solution, and the problem is still there.

    I believe there is somewhat of a delay time, because the transitions(states themselves) between each state have delay time in the form of sleep('') for animations. Should I put delay times in the non-transitional states as well? Don't know how that would help, though...

    Comment


      #17
      Shinzon, you dont need to use so many states for your vehicle. Really all I would use would be the 4 states where it is not changing. (2 air/2 non-air).

      For example:
      Code:
      auto state UnDeployed
      function VehicleFire(bool bWasAltFire)
          {
          	if (bWasAltFire)
          	{
                  if (PlayerController(Controller) != None)
                      GotoState('Deploying');
              }
          	else
          		bWeaponIsFiring = True;
          }
      }
      I would make it like this:
      Code:
      auto state UnDeployed
      function VehicleFire(bool bWasAltFire)
          {
          	if (bWasAltFire)
          	{
                  if (PlayerController(Controller) != None)
                      PlayAnim('Deploying');
                      Sleep( [Make this the length of your animation] );
                      GotoState('Deployed');
              }
          	else
          		bWeaponIsFiring = True;
          }
      }
      I would consider adding a line in there that nullifies the vehicles weapons if so you cant confuse the system with another AltFire while it is changing and so you cant shoot while you are changing. If you need help for this, look at the levy code, as it is used in there.

      Also, about your height checking problem. Like MarZer suggested, run a trace from the vehicle stright down. Get the value of that. Check that against the Deployed Height. Then:

      Try something like this in your tick function:
      Code:
      function Tick(delta time)
      {
                 float HeightCheckTime = 0.25;
      
           HeightCheckTime -= DeltaTime;
      
      If (HeightCheckTime <= 0.0)
      {
               CheckHeight();
               HeightCheckTime = 0.25;
      }
      }
      
      
      function CheckHeight()
      {
      ** Run your trace in here**
      
      If (Height >= Deployed Height)
      {
                If (State == Flying)
                    return;
                Else If (State == Undeployed)
                {
                          PlayAnim('Undeployed_Flying')
                          Sleep('X')
                          GotoState('FlyingUndeployed')
                 }
                 Else
                 {
                          PlayAnim('deployed_Flying')
                          Sleep('X')
                          GotoState('FlyingDeployed')
                  }
      }
      Else
      {
               If (State != Flying)
                    return;
                Else If (State == Undeployed)
                {
                          PlayAnim('Undeployed)
                          Sleep('X')
                          GotoState('Undeployed')
                 }
                 Else
                 {
                          PlayAnim('deployed_Flying')
                          Sleep('X')
                          GotoState('Deployed')
                  }
      }
      }
      Also Shinzon, remember that a player can jump 128 UUs each jump (256 for double jump). So keep that in mind for a height chech distance.

      (Ok, so it might be 64/128 instead of 128/256 but you get the point )

      Comment


        #18
        CMan! What have you been up to? Get on MSN once in a while!

        Comment

        Working...
        X