Playercamera Zoomlevel

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Condor
Colour Sergeant
Posts: 82
Joined: Mon Apr 09, 2007 3:19 pm
Location: Bavaria (Germany)

Playercamera Zoomlevel

Post by Condor »

Hi,
I changed the "zoom" value in the binoculars.tik file to "420 1",
so thats my result, looks nice, like an "on drugs" effect.
So, I wanted to change the zoomlevel for the playercamera instantly no matter witch item (Weapon, binoculars etc.) you have in your hands, or even sliding, for example from "20 1" to "400 1", using the map script.

Can anyone help me and tell me a way to change this zoomlevel?

http://img354.imageshack.us/img354/2610/bild1na8.jpg
http://img457.imageshack.us/img457/6713/bild2mj0.jpg (wthout the zoom)
http://img485.imageshack.us/img485/7798/bild3pn7.jpg

I didn't find anything about "zoom", no references with commands.
Thx.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Hmmm... something like this maybe:

Code: Select all

local.someplayer weaponcommand dual zoom 420 1
local.someplayer safezoom 1
Not very elegant though and highly unsafe :( (will ruin the default zoom values for sniper).

You may be wanting something that cannot be done :?
Image
Condor
Colour Sergeant
Posts: 82
Joined: Mon Apr 09, 2007 3:19 pm
Location: Bavaria (Germany)

Post by Condor »

Hmm, ok, thank you :)
homer
Private
Posts: 4
Joined: Mon Apr 09, 2007 5:55 am

:D

Post by homer »

srry to ask but whered u get that radar mod ??
on the screenshots ??
can u give me a link
Condor
Colour Sergeant
Posts: 82
Joined: Mon Apr 09, 2007 3:19 pm
Location: Bavaria (Germany)

Post by Condor »

The Radar Mod is written by me, and it's "anchored" in the code of the map.
You have to add a shader for the overviewmap in the "/scripts/" directory and a shader for your red little players, you need this:

Code: Select all

//Use that to show the radar
	thread sethud
	thread drawehud
drawehud:
	while (1)
	{
		for(local.i = 1; local.i <player> 0)
				{
				local.plrrx = ( 160 + ((1661 - local.plrx) * 0.044143287176399759181216134858519) )
				}
			if (local.plrx < 0)
				{
				local.plrrx = ( 300 - ((1507 + (local.plrx * ( 1) )) * 0.0444499004644990046449900464499) )
				}
			if (local.plrx == 0)
				{
				local.plrrx = 230
				}
			if (local.plry <0> 0)
				{
				local.plrry = ( -55 - ((1135 - local.plry) * 0.049674008810572687224669603524229) )
				}
			if (local.plry == 0)
				{
				local.plrry = -125
				}
			huddraw_alpha local.hid 0
			huddraw_virtualsize local.hid 1
			huddraw_alpha local.hid .8
			huddraw_font local.hid "verdana-12"

			local.hdcol = (0.4 + (local.p.health / 100))

			if (local.p.dmteam != "spectator")
			{
			huddraw_color local.hid local.hdcol local.hdcol local.hdcol
			}
			else
			{
			huddraw_color local.hid 1.2 1.2 1.2
			}
			huddraw_rect local.hid local.plrrx local.plrry 4 4
			if (local.p.dmteam != "spectator")
			{
			if (local.p.origin[2] <448> 448)
				{

				if (local.p.origin[2] <800> 800)
					{
					huddraw_shader local.hid textures/laser/hudmarkerup
					huddraw_shader local.pid textures/laser/hudmarker3
					}
				}
			}
			else
			{
			huddraw_shader local.hid textures/laser/hudmarker2
			huddraw_shader local.pid textures/laser/hudmarker3
			}		
		}
	wait 0.1 //Radar update time
	}
end

sethud:
	while (1)
	{
		huddraw_alpha 20 0
		huddraw_virtualsize 20 1
		huddraw_alpha 20 .8
		huddraw_font 20 "verdana-12"
		huddraw_color 20 1 1 1
		huddraw_rect 20 230 -125 140 140
		huddraw_shader 20 textures/laser/hudradar
	wait 1
	}
end

I packed the basic shader and texture files, if you want to add your own map overview picture to it, replace the "hudradar.tga" with yours (517*477)

Using it is not that simple, because you have to adjust the values in the script to the position of your map limits and the position of your radar.
That's what I mean with "anchored".
http://rapidshare.com/files/25565609/hudradar.pk3.html
PS: Using such things as a radar isn't very useful on simple or small maps ;)
Post Reply