Game Development Community

AFX and GMK Cutscenes

by Peter Churness · in Game Mechanics Kit · 08/20/2009 (11:59 pm) · 6 replies

Has anyone gotten GMK cutscenes working in TGEA with AFX?

#1
08/21/2009 (8:52 am)
>Has anyone gotten GMK cutscenes working in TGEA with AFX?

Yes, Peter.
Guys have done this. There were some conflicts in camera code, however they can be solved. Unfortunately, I don't know what exactly - I don't have AFX license.

What exact bugs do you have?
#2
08/21/2009 (12:12 pm)
What happens is that as soon as my character hits the trigger for the cutscene, the character freezes and I can no longer control the character (which is as it should be), but the camera stays with the player - does not switch to the cutscene camera. Then after a few seconds (when the cutscene code is probably completed), control is returned to the player.

So yes, seems like some conflict with the afxCamera. I should be able to figure it out now that I know others have got it working. But if anyone out there with the AFX license has dealt with this already - please share the fix...

Thanks,
Peter
#3
08/21/2009 (11:29 pm)
Okay... I think I've got it working now. In case anyone else using AFX has the same conflict with GMK cutscenes working here's what worked for me.

In /server/scripts/logickingMechanics/cutScene.cs

Change

function CutScene::play(%this)
{    
    %this.player = LocalClientConnection.getControlObject();   
        
    %this.currentCameraPath = 0; 
    
    %this.createCamera();
    %this.playCamera();
    %this.processChunks();
    %this.playSounds();
    
    if(!LogickingEditor.isActive) 
        %this.signal("onPlay");
    
    $currentPlayingScene = %this;
    CutSceneActionMap.push();
}

to

function CutScene::play(%this)
{   
    %this.player = LocalClientConnection.getControlObject();   
    // AFX/GMK >>
    %client = %this.player.getControllingClient();  
    $saveAFXCamera = %client.camera ;
    %client.clearCameraObject() ;
    // << AFX/GMK     
   
    %this.currentCameraPath = 0; 
    
    %this.createCamera();
    %this.playCamera();
    %this.processChunks();
    %this.playSounds();
    
    if(!LogickingEditor.isActive) 
        %this.signal("onPlay");
    
    $currentPlayingScene = %this;
    CutSceneActionMap.push();
}

And then change

function CutScene::stop(%this, %onEndCamera)
{    
    $currentPlayingScene = "";
    CutSceneActionMap.push();   
    if(!LogickingEditor.isActive) 
        %this.signal("onStop");   
    if(%onEndCamera $= "")
    {
        %this.camera.onEndPath = "";
        %this.camera.stop();        
    }
    else
        LocalClientConnection.setControlObject(%this.player);  
        
    %this.camera = "";
    %this.player = "";
    
    %this.stopSounds();
}

To

function CutScene::stop(%this, %onEndCamera)
{    
    $currentPlayingScene = "";
    CutSceneActionMap.push();   
    if(!LogickingEditor.isActive) 
        %this.signal("onStop");   
    if(%onEndCamera $= "")
    {
        %this.camera.onEndPath = "";
        %this.camera.stop();
    }
    else {
        LocalClientConnection.setControlObject(%this.player);  
        // AFX/GMK  >>
        LocalClientConnection.setCameraObject($saveAFXCamera);
        // << AFX/GMK
    }
	
	%this.camera = "";
   %this.player = "";
    
   %this.stopSounds();
}

Cheers
#4
08/23/2009 (11:23 am)
Awesome job, Peter!
Thanks.
Hope it will be helpful to all AFX and GMK owners.
#5
02/26/2010 (5:31 pm)
Thanks for this, I needed this for one of my projects.
#6
03/14/2010 (4:02 pm)
Thanks fixed my issue with the advanced camera.