dim3 Forum

Full Version: cameras
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
to change the type of camera you use (side scroller, ect.) what do you change in the map's scripting, and what do you change it to.

Also, is it possible to have the camera change in a certain situation, like 3rd person when you are walking, but then someting starts chasing you down a hallway and you switch to side scroller?
Look in the docs under scripting -> camera.
It's all explained there.
It is of course possible to change the camera by script at any time for example when you get a message.
I have a script in my game for a button that opens a door when you press it.
It also changes the camera so you can see the door opening. The camera then changes back to 1st person.
Code:
function buttonClick(obj) { //When the button is clicked

    var movement = obj.setting.getParameter(0); // get the first parameter
    var text = obj.setting.getParameter(1); // get the second one
    var buttonevent = obj.setting.getParameter(2); // and the third one

    obj.setting.clickable=false; // make the button unclickable so you wont be able to press it again
    map.movement.start(movement); // start the movement

    camera.setting.type=DIM3_CAMERA_TYPE_STATIC; // change the camera
    camera.staticPosition.moveToSpot(map.spot.find('camera1','camera')); // move the camera to the spot
    camera.staticPosition.follow=false; // dont follow the player
    camera.angle.y=180; // turn around 180° to face the door

    obj.event.chain(20,'buttonWait'); // wait 20, then continue with the buttonWait function
}

function buttonWait() {

        camera.setting.type=DIM3_CAMERA_TYPE_FPP; // change the camera back to 1st person
        camera.angle.y=0; // turn it around because you dont have eyes on the back of your head
}
Reference URL's