Page 1 of 1

FixedCamera and script trouble

Posted: Sun Jun 07, 2009 6:57 pm
by Danimita92
Hi everybody. I'm trying to make a system of fixed cameras and for now it kind of works. The camera is supposed to be attached to a pawn that does what the camera is supposed to do (Look at the scripted player)
The fixed camera hooks on the camera pawn and grabs its rotation at first, but when the Camera pawn rotates, the fixedcamera doesn't. It just stays there. Still. I tried the commands like

SetFixedCameraRotation(float RotX, float RotY, float RotZ);

But it doesnt seem to do anything... any ideas?

Re: FixedCamera and script trouble

Posted: Wed Jun 10, 2009 2:47 pm
by Juutis
How exactly are you doing this? Are you using the AttachCamera command?

Re: FixedCamera and script trouble

Posted: Wed Jun 10, 2009 3:40 pm
by Danimita92
No. Using EntityName in the fixedcamera entity.

But I managed to do it after a long time.
Problem is it doesn't use the Pawns yaw and pitch. I have to make it look at script points :evil:

Re: FixedCamera and script trouble

Posted: Wed Jun 10, 2009 4:44 pm
by Juutis
If you use a normal camera (not the FixedCamera stuff) you can use AttachCamera to attach the camera to a pawn and the camera will follow and rotate with the pawn.

Re: FixedCamera and script trouble

Posted: Wed Jun 10, 2009 11:25 pm
by Danimita92
But the pitch wont. That's why I'm using FixedCameras

Re: FixedCamera and script trouble

Posted: Thu Jun 11, 2009 2:01 am
by Juutis
Ah, yes. You are correct. You could, however, use the TiltCamera command to modify the pitch of the camera. Requires a bit of work but should be doable.

Re: FixedCamera and script trouble

Posted: Thu Jun 11, 2009 8:40 pm
by Juutis
Here's a little sample script that makes the camera follow a pawn called 'target'. Also pitch-wise:

Code: Select all

{    
    Spawn[ ()
    {
        Console(true);
        Gravity(false);
        LowLevel("setup");
    } ]
    
    setup[ ()
    {
        PawnRender(false);
        AttachCamera();
        yaw_speed = 10000;
        SetTarget("target");
        think = "run";
    } ]
    
    run[ ()
    {
        ThinkTime = 0;
        
        TiltCamera(enemy_pitch + camera_pitch);
        
        UpdateEnemyVis();
        ideal_yaw = enemy_yaw;
        ChangeYaw();
    } ]
    
}
Note: The pawn you assign this script to must have actorrotation values of '0 180 0' in pawn.ini and the camera must be in first person mode.

Re: FixedCamera and script trouble

Posted: Fri Jun 12, 2009 6:54 pm
by Danimita92
Wow. You're up for any challenge aren't you, Juutis?
The
enemy_pitch + camera_pitch
part is genius. I hadn't even thought about that. Wow.