dim3 Forum

Full Version: Turning
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do I make it so that in a vehicle, when I sidestep, I turn instead (like in UT2004).

Also, why is this camera underground?

Code:
function Construct(obj)
{
    obj.model.on=true;
    obj.model.name="Tauri";
    obj.model.lit=DIM3_MODEL_LIT_FLAT;    
    obj.radar.on=true;
    obj.radar.icon='item';

    obj.vehicle.on=true;

    obj.setting.restrictPlayerTurning=true;
    obj.setting.sideStep=false;

    obj.setting.jump=false;

    obj.setting.duck=false;
    obj.setting.turnOnlyWhenMoving=true;
    obj.look.upAngle=0;

    obj.look.downAngle=0;
}

function Enter(obj)
{
    obj.sound.play("Door",1);
    obj.vehicle.enter();
    camera.state.save()
    obj.camera.setting.type=DIM3_CAMERA_TYPE_CHASE;

    camera.chase.distance=10500;

    camera.chase.trackSpeed=0.1;

    

    camera.chaseAngle.x=0;

    camera.chaseAngle.y=0;

    camera.chaseAngle.z=0;

        

    camera.chaseSlop.y=1000;
    obj.motionVector.alterGravity(0);
}


function Exit(obj)
{
    obj.sound.play("Door",1);
    obj.vehicle.exit();
    camera.state.restore();
}

function event(obj,mainEvent,subEvent,id,tick)
{
    switch (mainEvent) {
    
        case DIM3_EVENT_CONSTRUCT:
            Construct(obj);
            return;

        case DIM3_EVENT_VEHICLE_ENTER:
            Enter(obj);
            return;

        case DIM3_EVENT_VEHICLE_EXIT:
            Exit(obj);
            return;
    }
}
I assume that 0 x,0 y,0 z is ground level and you might of raised up segments. I thing Im wrong but oh well.
The important part is
Code:
camera.chaseAngle.x=0;
You have to change that, because otherwise the camera is always directly behind your object. Change it to something like 15 or 20 (you might have to use negative numbers, not sure how Dim3 handles it). Play around with the numbers until you're happy with it. Smile
Is the map first person? I seem to remember a problem with that. also, when was the script written? there was a time when all vehicle scripts did that and the still do (for reasons I can't explain, but new copies correct the issue)
Chainfist Wrote:How do I make it so that in a vehicle, when I sidestep, I turn instead (like in UT2004).

Do you mean that when you enter a vehicle, the side step keys now act as turn left/right keys? That would be hard for you to do, I'd have to add something to core for that, I don't have anyway to switch key functions when entering a vehicle.

[>] Brian
Okay. Fixed most of my problems (I dont know why it suddenly worked, but I'm not complaining :P). Except this:

I want it to fly like in fly mode, but when I add the fly statement and the gravity modulator (like in the fly mode for the player), it doesn't change anything. What else should I add (and still keep it in chase camera)?
What you do is make the turning key be assigned to the same key as the strafe key and then make strafeing be 0 speed, that way you can also have a turning animation.
Chainfist Wrote:I want it to fly like in fly mode, but when I add the fly statement and the gravity modulator (like in the fly mode for the player), it doesn't change anything. What else should I add (and still keep it in chase camera)?

That's all it should take. Did you have a "up" key defined (or look up and start going forward.) You might be flying, but if you are on the ground you'll need to actually GO up, it doesn't go up automatically.

[>] Brian
Reference URL's