1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

(UT2k4) Top Down Movement problem...

Discussion in 'Programming' started by Call me Erdrik, Dec 18, 2004.

  1. Call me Erdrik

    Call me Erdrik Arch Mage

    Joined:
    Nov 24, 1999
    Messages:
    334
    Likes Received:
    0
    I'm trying to make a RTS style interface. The only problem I'm having so far is moving the camera around.
    Basicly I made a custom playercontroller that subclasses playercontroller, and made a new state with a new playermove function. I place the player in this state after spawning, in the gametype. I got the camera to lock in a top down view and a moving mouse pointer, but I have a movement problem. Strafeing and forward /reverse movement isn't working. I logged the NewAccel variable just before Processmove is called and NewAccel is getting the appropriate variables. Processmove is normaly:
    Code:
    If (pawn.Acceleration != NewAccel)
        pawn.Acceleration = NewAccel;
    
    Add from what I can tell this should work. truth fully I didn't change much in the playermove function(basicly only removed and locked camera rotation), and I don't get why this would stop player movement...
    The player and pawn are floating in the air.. does this require a specific physics to work? I've tried Falling, Flying, and None, would Walking work?..

    I'm going to tinker with it somemore, but if anyone knows specificly what to do I'd appriciate the help, thnx in advance :)
     
  2. Call me Erdrik

    Call me Erdrik Arch Mage

    Joined:
    Nov 24, 1999
    Messages:
    334
    Likes Received:
    0
    Ok, I did a hack that works...
    Currently I move like this: (GI is Level.Game)
    Code:
    //Crappy Hack! FIXME!!!
    If (Location.X < GI.LevelSize 
    && Location.X > -GI.LevelSize
    && Location.Y < GI.LevelSize
    && Location.Y > -GI.LevelSize
    )
    {
         setlocation(location + (NewAcell * 0.001));
    } Else
         NewLocation = Location;
         If (NewLocation.X > GI.LevelSize)
              NewLocation.X -= (NewLocation.X - GI.LevelSize) + 10;
         If (NewLocation.X < -GI.LevelSize)
              NewLocation.X += (NewLocation.X - GI.LevelSize) + 10;
         If (NewLocation.Y > GI.LevelSize)
              NewLocation.Y -= (NewLocation.Y - GI.LevelSize) + 10;
         If (NewLocation.Y < -GI.LevelSize)
              NewLocation.Y += (NewLocation.Y - GI.LevelSize) + 10;
         setlocation(NewLocation);
    }
    
    I can move fine with bounderies matching the play area. But this is a horrible hack in my eyes, and would perfer to use the processmove function...
    I noticed that the problem is that the pawn doesn't want to move. The PlayerController has no problem moving tho. Does adding Acceleration to a Controller class work the same as a Pawn class? If so then I can probly just change the processmove function to modify the acceleration of the controller instead of the pawn... tho I would like to get the pawn moving... any help or suggestions on which method is better would be greatly appreciated. :)

    Also sry about the double post :p
     
    Last edited: Dec 19, 2004

Share This Page