PDA

View Full Version : Whizzle example



Akyon
11-16-2009, 02:54 PM
I've been messing with the engine and the documentation from Whizzle, but I'm getting some errors from the compiler:

This is my AquaPlayerController.uc

class AquaPlayerController extends UTPlayerController;
var AquaBall Ball;
state ControllingBall
{
ignores SeePlayer, HearNoise, Bump;

in AquaBall
function ProcessMove(float DeltaTime, vectorNewAccel, eDoubleClickDir, rotator DeltaRot);

function ProcessMove(float DeltaTime, vector NewAccel, eDoubleClickDir DoubleClickMove, rotator DeltaRot);

function PlayerMove( float DeltaTime )
{
if (Ball != None)
{
Ball.AxisInput(PlayerInput.RawJoyRight, PlayerInput.RawJoyUp);
}
}
}


the error is in the line 7:
Development\Src\Sides\Classes\AquaPlayerController .uc(7) : Error, Expression is not allowed here

I don't know if its necessary, but here's my AquaBall.uc


class AquaBall extends KActorSpawnable
placeable;
var() InterpCurveFloat InputPushAmountCurve;
var() float InputPushAmountY;
var() float InputPushAmountZ;
var() float InputThresholdZ;

var vector MovementDirection;

simulated event AxisInput(float AxisRight, float AxisUp)
{
MovementDirection.Y = AxisRight;
MovementDirection.Z = AxisUp;
}

simulated event Tick(float DT)
{
super.Tick(DT);

AddInputForce(DT);
}

simulated function AddInputForce(float DeltaTime)
{
local vector PushVector;
local float InputForceMultiplier;

if(Vsize(MovementDirection) < 0.2f)
return;
InputForceMultiplier = EvalInterpCurveFloat(InputPushAmountCurve, VSize(velocity));

PushVector = MovementDirection;

PushVector.Z = FMin (InputThresholdZ, PushVector.Z);

PushVector.Y *= InputPushAmountY * InputForceMultiplier;
PushVector.Z *= InputPushAmountZ * InputForceMultiplier;
StaticMeshComponent.AddImpulse(PushVector * DeltaTime);
}



DefaultProperties
{
Begin Object Name=StaticMeshComponent0
StaticMesh=StaticMesh'LT_Mech.SM.Mesh.S_LT_Mech_SM _Cratebox02a'
bNotifyRigidBodyCollision=true
HiddenGame=FALSE
ScriptRigidBodyCollisionThreshold=0.001
LightingChannels=(Dynamic=TRUE)
End Object

InputPushAmountY = 3000
InputPushAmountZ = 2000
InputThresholdZ=0.1f

InputPushAmountCurve=(Points=((InVal=0.0,OutVal=1. 0),(InVal=600.0,OutVal=2.00),(InVal=2000,OutVal=6. 0f),(InVal=4000,OutVal=16.0f)))

}

// Initialize ball:
// - Constrain the ball to only move on the Y and Z axis
simulated event PostBeginPlay()
{
local RB_ConstraintActor TwoDConstraint;
super.PostBeginPlay();
// Create the constraint in the world by spawning it. Self is used to set the Owner of the constraint to the ball
// We want to Spawn it at the same location as the ball, which is stored in the Location variable and no rotation
TwoDConstraint = Spawn(class'RB_ConstraintActorSpawnable', self, '', Location, rot(0,0,0));
// bLimited is set to 1 by default, so turn it off for Y and Z to allow Y and Z axis movement
TwoDConstraint.ConstraintSetup.LinearYSetup.bLimit ed = 0;
TwoDConstraint.ConstraintSetup.LinearZSetup.bLimit ed = 0;
// Don't allow the ball to swing, which would make it move along the X axis
TwoDConstraint.ConstraintSetup.bSwingLimited = true;
// Initialize the constraint and constrain the ball to the world
TwoDConstraint.InitConstraint( self, None );
}

Thanks

Akyon
11-16-2009, 05:08 PM
Ok, I had some syntax errors there, sorry to bother :x

mafiadude1
01-30-2010, 12:57 AM
not sure on what the specifics are but IMO i would refrain from putting ANY code under the DefaultProperties..just makes coding easier and cleaner i guess..