Setting a Key to alter camera mode.

Posted By: jsaechao

Setting a Key to alter camera mode. - 04/02/08 21:47

I want to have by default the mouse on mode 2 which would make the mouse free and not alter the movement at all, that way i may use the mouse for button's and menu's however when the player presses and holds the right mouse button the camera mode shifts to 0 which would make the mouse movements change the camera angle and also turn the character. Heres the code i made

if (Key_Pressed(281) == on) {var mouse_mode = 0}
else {var mouse_mode = 2}

it keeps giving me script errors such as "Bad Keyword" or "Script end"

I don't know what i'm doing wrong.
Posted By: JazzDude

Re: Setting a Key to alter camera mode. - 04/03/08 03:48

You need some semi-colons. That might help.

function change_mouse_mode()
{
if (Key_Pressed(281) == on)
{
var mouse_mode = 0;
}
else
{
var mouse_mode = 2;
}
}
Posted By: jsaechao

Re: Setting a Key to alter camera mode. - 04/03/08 20:14

it's now giving me a syntax error saying that there is no function for change_mouse_mode()
Posted By: Rasterbar

Re: Setting a Key to alter camera mode. - 04/03/08 20:55

change var mouse_mode to mouse_mode
with var you declare a variable mouse_mode
© 2024 lite-C Forums