Hello, I am trying to make a simple script to let the character look through his gun scope and have it zoom in a certain distance.

I tried to make it by editing my panel to display the main panel when not zoomed in and the other while zooming, but i could not use a conditional to distinguish in the panel function. it returned an error. also, the camera would not zoom in when prompted.

if anyone could offer some advise, resources, or point me in the right direction, it owuld be greatly appreciated.

here is some of my code.
Code:
//zoom in function
function zoom_scope()
{
	scope_on = (scope_on == off);
	var temp_cam;
	temp_cam.x = camera.x;
	temp_cam.y = camera.y;
	temp_cam.z = camera.z;
	while(scope_on == 1)
	{
		camera.x = temp_cam.x + 50;
		
	}
	camera.x = temp_cam.x;
}

//PANEL SCRIPT

var x = 4;
bmap scope <"scope.bmp">;
bmap the_panel <"panel.bmp">;
font font1 = "font1_blue.pcx",12,16;  // named the font digi_font
panel game_panel
{
		//tried to do condition but did not compile
		if(scope_on == on)
		{
			bmap = scope;
			
		}
		else
		{
		
		bmap = the_panel;
		flags = visible, overlay;
		//player.ammo = clip_ammo[current_weapon];
		digits = 470,579,3,font1,1,player.health;
		digits = 15,579,3,font1,1,player.battery;
		digits = 730,579,3,font1,1, player.ammo;
		digits = 246,579,3,font1,1,player.armor;
		}
}





Last edited by rvL_eXile; 07/05/09 01:02.