UT99 Movement control help

  • 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.

Asgard

New Member
Oct 6, 2000
265
0
0
Visit site
Note This is for UT 99 not UT2004.

I was wondering if any one could offer some help or suggestions?

Ive made a player controlled projectile similar to the redeemer. Its actually some kind of helicopter but I might do other projectiles and an aircraft later *IF* I can get it to work.

The problem is I dont want to make execs and seperate binds to make it fly.

The simple solution would of been to access the pilots aforward, aBaseY, aStrafe etc but they always return a value of 0.

Next solution I thought perhaps using bWasForward, bWasLeft etc but they just refuse to replicate, Theyre fine local but in netplay no matter what I try it just doesnt work. I tried using and inventory item to try and use it as a controller but still no luck.

Anyway.. I'm trying to make my own ver of aforward and astrafe. For lack of a better solution.

When a player bumps into it it sets the player as the owner (pilot)

Code:
var float Goforward;
var vector accel,vrot;

 simulated function Tick(float DeltaTime)
 {
   accel = Pilot.Acceleration;       
   vrot = vector(Pilot.rotation); 
   Goforward = Normal(accel) dot Normal(vrot);

   if ( Goforward > 0 )
   { 							
      if ( speed<default.speed)
          speed+= 10.0;
      else							   
           speed=default.speed;
   }
  etc etc 
 }

The above works but no cigar. If im not moving forward and I press a strafe key while turning it returns a positive or negative value..Not 0

Code:
var vector accel, vrot, afoward;

 simulated function Tick(float DeltaTime)
 {
     accel = Pilot.Acceleration;       
     vrot = vector(Pilot.rotation); 
     aforward = accel*vrot;

    if ( aforward.x + aforward.y >1 && aforward.z !=0)
    { 
      if ( speed<default.speed)
       speed+= 10.0;
      else
          speed=default.speed;
    }
  etc etc
}
The above seems to work but in network play the floats arent quite accurate which is why <1 and > 1 and not 0 (maybe 1 needs to be higher?)
When I strafe and turn while NOT moving forward, aforward.z is always 0 (fortunately).

I need to make a strafe ver of this but im stumped. The strafe has to be seperate and not effected by forward movement and turning such as if strafe left and strafe right keys were pressed. Or it'll strafe when not wanted.

Anyone have any suggestions?

cheers
 

Asgard

New Member
Oct 6, 2000
265
0
0
Visit site
Doesnt matter I figured out a method. (if anyones interested)

Code:
var	float strafe;
var bool  bStrafeLeft, bStrafeRight; 
var vector accel,vrot,aforward,sidedir,x,y,z;

 simulated function Tick(float DeltaTime)
 {

 GetAxes(Pilot.Rotation,X,Y,Z); 

 accel = Pilot.Acceleration;       
 vrot = vector(Pilot.rotation);  
 aforward = accel*vrot;

 strafe = accel dot y; // check for strafe

 if (strafe > 120) //strafe right
 {
 sideDir = vector( GuideRotation ) cross vect(0,0,-1);
 Velocity = CurrentVelocity + sideDir * 1500 * DeltaTime; 
 Velocity = 100 * sideDir + Normal(Velocity)*speed;
	}
 else if (strafe < -120) //strafe left
 {
 sideDir = vector( GuideRotation ) cross vect(0,0,1);
 Velocity = CurrentVelocity + sideDir * 1500 * DeltaTime; 
 Velocity = 100 * sideDir + Normal(Velocity)*speed;
 } 
}

etc etc

turning while moving with roll etc only returns very small values (if any at all), biggest I logged was -99, where strafing is huge. Stafing with no forward is about 550 and strafe moving returns about 330. I guess I could of tried to get a dot value from a cross vector but the turning might effect it aswell..

Still if anyone has any other methods would like to see them. In the end I dont think im using this code anyway :)

cheers
 
Last edited: