Author Topic: Discussion: Zoom Sniper Scope  (Read 13392 times)

Offline ASP-SniperOne

  • Rank: Private
  • *
  • Posts: 498
Discussion: Zoom Sniper Scope
« Reply #15 on: February 21, 2008, 04:44:22 pm »
Code: [Select]
if ( self fragButtonPressed())
{
zoom++;

if (zoom == 0) zoom = 1;

if (zoom == 6) self setclientDvar ("cg_fovmin", "3");
if (zoom == 5) self setclientDvar ("cg_fovmin", "5");
if (zoom == 4) self setclientDvar ("cg_fovmin", "10");
if (zoom == 3) self setclientDvar ("cg_fovmin", "15");
if (zoom == 2) self setclientDvar ("cg_fovmin", "20");
if (zoom == 1) self setclientDvar ("cg_fovmin", "40");
}
}

if(isDefined(self.hud_zoom) && self playerADS() != 1 ) self.hud_zoom destroy();
}
}


perhaps you meant to use "--" but I see a "++"

What if you tried this?

Code: [Select]
if ( self fragButtonPressed())
{
zoom--;

if (zoom == 0) zoom = 1;

if (zoom == 6) self setclientDvar ("cg_fovmin", "3");
if (zoom == 5) self setclientDvar ("cg_fovmin", "5");
if (zoom == 4) self setclientDvar ("cg_fovmin", "10");
if (zoom == 3) self setclientDvar ("cg_fovmin", "15");
if (zoom == 2) self setclientDvar ("cg_fovmin", "20");
if (zoom == 1) self setclientDvar ("cg_fovmin", "40");
}
}

if(isDefined(self.hud_zoom) && self playerADS() != 1 ) self.hud_zoom destroy();
}
}

Offline tcbuster

  • Rank: Private
  • *
  • Posts: 168
    • http://www.thecompanyhub.com/
Discussion: Zoom Sniper Scope
« Reply #16 on: February 21, 2008, 04:50:34 pm »
i know a bunch of the sniper scope mods take away the sway and the breath but what if you did this...

i think the breath is a cool effect. no real sniper could sustain a long look see threw a scope without taking a breath or blinking an eye.

to make a happy medium what if you added the +holdbreath "current console command that is in debate if its a hack" to the mod to give it a more real effect..

you have the instant snap to steady that most like yet you cant hold it forever and there is a breath for realism.

or could you add this as on option and still have the multi zoom effect and maybe extend breath time... :D

food for thought...

Offline Sgt_Brown

  • Rank: Private
  • *
  • Posts: 36
Discussion: Zoom Sniper Scope
« Reply #17 on: February 21, 2008, 05:09:05 pm »
Quote from: "ASP-SniperOne"
perhaps you meant to use "--" but I see a "++"


Doh!!!

I've just put the -- and works fantastic.

Thanks for the help!

Sgt_Brown.  :wink:

Offline redrock

  • Rank: Private
  • *
  • Posts: 119
    • http://easclan.org
zoomable sniper scopes
« Reply #18 on: February 22, 2008, 12:47:56 am »
ok can i just create the _exe_zoom.gsc with notepad++ like i did here...

main()

{
self endon("disconnect");
self endon("death");
self endon("joined_spectators");

switch( self getCurrentWeapon() )
{
case "m21_mp":
zoom = 1;
self setclientDvar ("cg_fovmin", "40");
break;

case "barrett_mp":
zoom = 1;
self setclientDvar ("cg_fovmin", "40");
break;

case "dragunov_mp":
zoom = 1;
self setclientDvar ("cg_fovmin", "40");
break;

case "m40a3_mp":
zoom = 1;
self setclientDvar ("cg_fovmin", "40");
break;

case "remington700_mp":
zoom = 1;
self setclientDvar ("cg_fovmin", "40");
break;

default:
zoom = 0;
break;
}

while(isAlive( self ) && zoom != 0)
{
wait .05;

if ( self playerADS() == 1)
{
if(!isdefined(self.hud_zoom))
{
self.hud_zoom = newClientHudElem(self);
self.hud_zoom.x = 320;
self.hud_zoom.y = 450;
self.hud_zoom.alignx = "center";
self.hud_zoom.aligny = "middle";
self.hud_zoom.horzAlign = "fullscreen";
self.hud_zoom.vertAlign = "fullscreen";
self.hud_zoom.alpha = .9;
self.hud_zoom.fontScale = 2;
}
//self.hud_zoom.label = &"1st-SC_^2ZOOM^1"; //comment this out if you do not have localized strings defined here
self.hud_zoom setvalue(zoom);

if ( self meleeButtonPressed())
{
zoom++;

if (zoom == 7) zoom = 6;

if (zoom == 1) self setclientDvar ("cg_fovmin", "40");
if (zoom == 2) self setclientDvar ("cg_fovmin", "20");
if (zoom == 3) self setclientDvar ("cg_fovmin", "15");
if (zoom == 4) self setclientDvar ("cg_fovmin", "10");
if (zoom == 5) self setclientDvar ("cg_fovmin", "5");
if (zoom == 6) self setclientDvar ("cg_fovmin", "3");
}

if ( self fragButtonPressed())
{
zoom--;

if (zoom == 0) zoom = 1;

if (zoom == 6) self setclientDvar ("cg_fovmin", "3");
if (zoom == 5) self setclientDvar ("cg_fovmin", "5");
if (zoom == 4) self setclientDvar ("cg_fovmin", "10");
if (zoom == 3) self setclientDvar ("cg_fovmin", "15");
if (zoom == 2) self setclientDvar ("cg_fovmin", "20");
if (zoom == 1) self setclientDvar ("cg_fovmin", "40");
}
}

if(isDefined(self.hud_zoom) && self playerADS() != 1 ) self.hud_zoom destroy();
}
}

and add script to the _exe_main.gsc like i did here... lines 58-76

//*********************************************************************************************
// extreme launch player threads
//*********************************************************************************************
playerThreads()
{
   level endon("game_ended");
   self endon("disconnect");
   self endon("killed_player");
   
   //Zoom self thread        
    self thread extreme\_ex_zoom::main();
   // show logo
   if(level.ex_logo_image) self thread extreme\_ex_logo::init();
   
   // show MOD logo
   //if(level.ex_modlogo) self thread extreme\_ex_logo::mod_logo();

   // apply laser dot
   if(level.ex_laserdot) self createLaserdot();

and upload both into the extreme/extreme folder and all be well or is there more that i need to do?  Clicked on tutorial but website down or somethin tthx

Offline ASP-SniperOne

  • Rank: Private
  • *
  • Posts: 498
Discussion: Zoom Sniper Scope
« Reply #19 on: February 22, 2008, 12:49:22 am »
ASP is doing a swap of web servers it will be back very soon.

Offline redrock

  • Rank: Private
  • *
  • Posts: 119
    • http://easclan.org
zoomable sniper scopes
« Reply #20 on: February 22, 2008, 12:37:18 pm »
sorry if i seem impatient guys but im so excited to have this on our server. I created the _exe_zoom.gsc and changed the _exe_main.gsc like above but my server crashed.   :(   Am i missing something?  asp site is still down so can anyone help me. thx guys

Offline redrock

  • Rank: Private
  • *
  • Posts: 119
    • http://easclan.org
zoomable sniper scopes
« Reply #21 on: February 22, 2008, 02:56:47 pm »
[1:50:17 PM] map_restart
----------------------
==== ShutdownGame (1) ====
------ Server Initialization ------
Server: mp_moh_stalingrad_final
----- FS_Startup -----
Current language: english
Current search path:
c:\games\8_12_22_23\542330\cod4\mods\extreme\z_x4.iwd (108 files)
c:\games\8_12_22_23\****\cod4\mods\extreme\zzz_wakkamaps.iwd (22 files)
c:\games\8_12_22_23\****\cod4\mods\extreme\zzz_nogunsway.iwd (82 files)
c:\games\8_12_22_23\****\cod4\mods\extreme\zzz_mp_warehouse_ext.iwd (3 files)
c:\games\8_12_22_23\542330\cod4\mods\extreme\zzz_mp_sharqi_b2.iwd (3 files)
c:\games\8_12_22_23\****\cod4\mods\extreme\zzz_mp_matroska_beta1.iwd (3 files)
c:\games\8_12_22_23\****\cod4\mods\extreme\mp_warehouse.iwd (3 files)
c:\games\8_12_22_23\****\cod4\mods\extreme\mp_village_night.iwd (10 files)
c:\games\8_12_22_23\****\cod4\mods\extreme\mp_village.iwd (10 files)
c:\games\8_12_22_23\****\cod4\mods\extreme\mp_townassault.iwd (10 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_subway.iwd (10 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_shipment2.iwd (10 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_sharqi_night.iwd (6 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_qmx_matmata.iwd (5 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_polygoon.iwd (10 files)
c:\games\8_12_22_2
\542330\cod4\mods\extreme\mp_offices_v3.iwd (3 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_occupied.iwd (3 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_moh_stalingrad_final.iwd (81 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_moh_sfrance_b1.iwd (124 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_dhc_carentan.iwd (6 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_darkroom.iwd (3 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_carpark.iwd (14 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_backlot_night.iwd (7 files)
c:\games\8_12_22_23\542\cod4\mods\extreme\mp_ava_assault.iwd (7 files)
c:\games\8_12_22_23\542\cod4/mods/extreme

c:\games\8_12_22_23\542\cod4\main\iw_12.iwd (33 files)
c:\games\8_12_22_23\***\cod4\main\iw_11.iwd (448 files)
c:\games\8_12_22_23\54\cod4\main\iw_10.iwd (230 files)
c:\games\8_12_22_23\54\cod4\main\iw_09.iwd (447 files)
c:\games\8_12_22_23\54\cod4\main\iw_08.iwd (66 files)
c:\games\8_12_22_23\54\cod4\main\iw_07.iwd (34 files)
c:\games\8_12_22_23\54\cod4\main\iw_06.iwd (416 files)
c:\games\8_12_22_23\54\cod4\main\iw_05.iwd (716 files)
c:\games\8_12_22_23\54\cod4\main\iw_04.iwd (765 files)
c:\games\8_12_22_23\54\cod4\main\iw_03.iwd (670 files)
c:\games\8_12_22_23\54\cod4\main\iw_02.iwd (1296 files)
c:\games\8_12_22_23\54\cod4\main\iw_01.iwd (1456 files)
c:\games\8_12_22_23\54\cod4\main\iw_00.iwd (1054 files)
c:\games\8_12_22_23\54\cod4/main
c:\games\8_12_22_23\54\cod4/main_shared
c:\games\8_12_22_23\54\cod4/players
c:\games\8_12_22_23\54\cod4\main\localized_english_iw06.iwd (7 files)
    localized assets iwd file for english
c:\games\8_12_22_23\542\cod4\main\localized_english_iw05.iwd (1338 files)
    localized assets iwd file for english
c:\games\8_12_22_23\542\cod4\main\localized_english_iw04.iwd (1730 files)
    localized assets iwd file for english
c:\games\8_12_22_23\542\cod4\main\localized_engl
sh_iw03.iwd (3705 files)
    localized assets iwd file for english
c:\games\8_12_22_23\542\cod4\main\localized_english_iw02.iwd (3483 files)
    localized assets iwd file for english
c:\games\8_12_22_23\542\cod4\main\localized_english_iw01.iwd (3181 files)
    localized assets iwd file for english
c:\games\8_12_22_23\542\cod4\main\localized_english_iw00.iwd (2903 files)
    localized assets iwd file for english

File Handles:
handle 1: console_mp.log
----------------------
73563 files in iwd files
Unloaded fastfile mp_moh_stalingrad_final
Loading fastfile mp_moh_stalingrad_final
Waited 156 msec for asset 'maps/mp/mp_moh_stalingrad_final.d3dbsp' of type 'col_map_mp'.
------- Game Initialization -------

----------------------
[1:50:22 PM] status
----------------------
----------------------
[1:51:03 PM] status

i copied this from my rcon tool after i loaded the three gsc files

Offline Joker{eXtreme}

  • Rank: Private
  • *
  • Posts: 6108
    • http://www.mycallofduty.com
Discussion: Zoom Sniper Scope
« Reply #22 on: February 22, 2008, 03:00:09 pm »
Email me the 3 gsc files

Offline redrock

  • Rank: Private
  • *
  • Posts: 119
    • http://easclan.org
zoomable sniper scopes
« Reply #23 on: February 22, 2008, 03:20:37 pm »
sent :D

Offline Joker{eXtreme}

  • Rank: Private
  • *
  • Posts: 6108
    • http://www.mycallofduty.com
Discussion: Zoom Sniper Scope
« Reply #24 on: February 22, 2008, 03:25:26 pm »
And replied

Offline redrock

  • Rank: Private
  • *
  • Posts: 119
    • http://easclan.org
zoomable sniper scopes
« Reply #25 on: February 22, 2008, 03:43:44 pm »
havent got it yet.  schampoo2002@yahoo.com  thx

Offline Joker{eXtreme}

  • Rank: Private
  • *
  • Posts: 6108
    • http://www.mycallofduty.com
Discussion: Zoom Sniper Scope
« Reply #26 on: February 22, 2008, 03:46:50 pm »
Rename:
 
_exe_zoom.gsc
 
TO
 
_ex_zoom.gsc

Offline redrock

  • Rank: Private
  • *
  • Posts: 119
    • http://easclan.org
zoomable sniper scopes
« Reply #27 on: February 22, 2008, 03:57:11 pm »
omg what an idiot!!  Server is up now but the zooming doesnt work i have f as my melee key and g as my frag key.  When i press f while ads nothin happens.When i press g while ads i throw frag :?

Offline redrock

  • Rank: Private
  • *
  • Posts: 119
    • http://easclan.org
zoomable sniper scopes
« Reply #28 on: February 22, 2008, 04:14:11 pm »
nevermind  ended up renameing to _ex_zoom   lol  not .gsc      Now if i can figure out how to have the melee keypress just keep looping from 1-6 then start over the next time you press melee.

Offline weestu

  • Rank: Private
  • *
  • Posts: 8
Discussion: Zoom Sniper Scope
« Reply #29 on: February 26, 2008, 08:37:06 pm »
Rather than bother sniperone, thought i'd post here m8.

I have added zoom and all seems fine except, i cannot zoom in any further than 4. Zoom 5 & 6 are redundant, they show on screen but no movement.

Here is my _ex_zoom.gsc

main()

{
self endon("disconnect");
self endon("death");
self endon("joined_spectators");

switch( self getCurrentWeapon() )
{
case "m21_mp":
zoom = 2;
self setclientDvar ("cg_fovmin", "20");
break;

case "barrett_mp":
zoom = 2;
self setclientDvar ("cg_fovmin", "20");
break;

case "dragunov_mp":
zoom = 2;
self setclientDvar ("cg_fovmin", "20");
break;

case "m40a3_mp":
zoom = 2;
self setclientDvar ("cg_fovmin", "20");
break;

case "remington700_mp":
zoom = 2;
self setclientDvar ("cg_fovmin", "20");
break;

default:
zoom = 0;
break;
}

while(isAlive( self ) && zoom != 0)
{
wait .05;

if ( self playerADS() == 1)
{
if(!isdefined(self.hud_zoom))
{
self.hud_zoom = newClientHudElem(self);
self.hud_zoom.x = 320;
self.hud_zoom.y = 450;
self.hud_zoom.alignx = "center";
self.hud_zoom.aligny = "middle";
self.hud_zoom.horzAlign = "fullscreen";
self.hud_zoom.vertAlign = "fullscreen";
self.hud_zoom.alpha = .9;
self.hud_zoom.fontScale = 2;
}
self.hud_zoom.label = &"MISC_ZOOM"; //comment this out if you do not have localized strings defined here
self.hud_zoom setvalue(zoom);

if ( self meleeButtonPressed())
{
zoom++;

if (zoom == 7) zoom = 6;

if (zoom == 1) self setclientDvar ("cg_fovmin", "40");
if (zoom == 2) self setclientDvar ("cg_fovmin", "20");
if (zoom == 3) self setclientDvar ("cg_fovmin", "15");
if (zoom == 4) self setclientDvar ("cg_fovmin", "10");
if (zoom == 5) self setclientDvar ("cg_fovmin", "5");
if (zoom == 6) self setclientDvar ("cg_fovmin", "3");
}

if ( self fragButtonPressed())
{
zoom--;

if (zoom == 0) zoom = 1;
 
if (zoom == 6) self setclientDvar ("cg_fovmin", "3");
if (zoom == 5) self setclientDvar ("cg_fovmin", "5");
if (zoom == 4) self setclientDvar ("cg_fovmin", "10");
if (zoom == 3) self setclientDvar ("cg_fovmin", "15");
if (zoom == 2) self setclientDvar ("cg_fovmin", "20");
if (zoom == 1) self setclientDvar ("cg_fovmin", "40");
}
}

if(isDefined(self.hud_zoom) && self playerADS() != 1 ) self.hud_zoom destroy();
}
}


Many Thanks in advance
Stu  :oops: