Post: GSC Script: Ultimate Vision Editor for COD4
03-07-2012, 01:02 AM #1
Amanda
Can’t trickshot me!
(adsbygoogle = window.adsbygoogle || []).push({}); I see that these days it's in fashion for everyone to make an Editor for COD4. The first editors seen in IELIITEMODZX's patch for COD4 were really impressive. But when the original codes were released in public the result is that now everyone uses a Super - Duper Editor with shaders, progress Bars, RGB colors etc and edits Stats, Prestige, Dvars and many many other things.
I think this Custom Editors madness is even more anoying than the thousends of "Different Pro Mod patches" out there. We even see many clones of the same Editor. For example both editors edit stats but the one uses Black ScrollBar while the other one uses white...

Following this common sense here is my own editor I made for my new patch Winky Winky


Ultimate Vision Editor Ver 1.2

What exactly it Does ??

* Creates awesome custom Visions, using every possible combination of RGB colors
* The visions are infectable, so you will keep them even if you join an other lobby and you are not the host
* The visions are self-only, so only you will see the effects, even if you are the host
* Can edit Darker & Brighter colors, Contrast, Brightness, Blur
* Uses an awesome UI [ as all other Editors out there to impress :p ]
* In other words it eliminates the lack of VisionSetNakedForPlayer() for COD4!!!
* Works for MW2 too.
* The code is as small and optimized as possible, but it will be much better when I completely finish it
* It is currently a bit buggy, but I will fix it soon Smile
* It uses only one setText() so you can Have other 275 options in your Menu, and it will still not overflow!

How Powerfull is it?




Here is the script
    CustomVision() // Call this from a menu as a thread
{
// VER 1.2
// Made by Amanda //
/*
Please DO NOT remove the comments
if you use or edit this script
*/
self endon("StopCustomVision");
if(self.FirstTimeUsingCustomVision) { // Use this check to save script variables and prevent runtime errors, so the structure will be created only once //
self.FirstTimeUsingCustomVision = false;
self.film = SpawnStruct();
self.film.light = [];
self.film.light["R"] = 1;
self.film.light["G"] = 1;
self.film.light["B"] = 1;
self.film.dark = [];
self.film.dark["R"] = 0;
self.film.dark["G"] = 0;
self.film.dark["B"] = 0;

self.film.brightness = 0;
self.film.blur = 0;
self.film.contrast = 0;

self.Digits = [];
self.CurrentValue = [];
self.DefaultValue = PreSetDefaults();
DoReset(self) ; // We initialize the Current Vision Array the first time only with the Default values.
}

DisX = 60;
DisY = 0;
j = -1;
self.film.cursorPos = 0;
// TODO: Include all elements inside the film structure, so we will not confuse them with other function or menu graphic elements
self.Blackscreen=SetHUDElem(undefined,(36.5),70,1,0.7,self);
self.Blackscreen setshader("line_vertical",400,820);
self.Blackscreen.sort=-5;

self.cursor=SetHUDElem(undefined,77.5,189,1,5,self);
self.cursor setshader("white",20,20);
self.cursor.sort=-5;
self.cursor.color=(1,1,1);

for(i=0; i<9; i++)
{
j++;
self.Digits[i]=createFontString("default",1.5 ,self); // Store all digits as seperate objects each one in a global array, so we can easily access them using threads
self.Digits[i] setPoint("TOP LEFT","TOP LEFT",j*DisX + 68, 180 + DisY);
self.Digits[i] setvalue(self.DefaultValue[i]);
if(j==0) self.Digits[i].color = (1,0,0);
else if(j==1) self.Digits[i].color = (0,1,0);
else self.Digits[i].color = (0,0,1);
if(i==2) { DisY = 60; j=-1; }
if(i>=6) { self.Digits[i] setPoint("TOP LEFT","TOP LEFT",2*DisX + 68, 280+(i-6) * 55); self.Digits[i].color = (1,1,0); }
}

self.film.Bars = [];
self.film.Bars["Bright"] = ProgressBarFull(false,"DARK",100,100,self.film.dark["R"],self.film.dark["G"],self.film.dark["B"]);
self.film.Bars["Dark"] = ProgressBarFull(false,"BRIGHT",100,160,self.film.light["R"],self.film.light["G"],self.film.light["G"]);

self.Misc=createFontString("default",1.5 ,self); // We only use one text string so it will not overflow
self.Misc setPoint("TOP LEFT","TOP LEFT", 18, 120);
self.Misc setText(" VISION EDITOR\n\nDARK:\n\n\nBRIGHT:\n\n\n\nCONTRAST:\n\n\nBRIGHTNESS:\n\n\nBLUR:\n\n\n ^5DOUBLE TAP [{+reload}] TO RESET DEFAULTS");

maxvalue = [];
for(i=0; i<9; i++) if(i<6) maxvalue[i] = 1.10; else maxvalue[i] = 10.10; // Initialize max values for each editor

self thread MonitorScrollRight();
self thread MonitorScrollLeft();
self thread MonitorScrollUp(maxvalue);
self thread MonitorScrollDown(maxvalue);
self thread MonitorCursor();
self thread MonitorReset();
thread DestroyOnEvent("death","disconnect","R3","","",self);
}

DestroyOnEvent(ev1,ev2,ev3,ev4,ev5,p) { // Destroy Everything
p waittill_any(ev1,ev2,ev3,ev4,ev5);
for(i=0; i<p.Digits.size; i++) p.Digits[i] destroy();
p.film.Bars["Bright"] DestroyElem();
p.film.Bars["Dark"] DestroyElem();
p.cursor destroy();
p.BlackScreen destroy();
p.Misc destroy();
p notify("StopCustomVision");
}


MonitorScrollRight() { self endon("StopCustomVision"); for(;Winky Winky { self waittill("R2"); self.film.cursorPos ++; if(self.film.cursorPos > self.DefaultValue.size-1) self.film.cursorPos = 0; MonitorCursor(self); } }
MonitorScrollLeft() { self endon("StopCustomVision"); for(;Winky Winky { self waittill("L2"); self.film.cursorPos --; if(self.film.cursorPos < 0) self.film.cursorPos = self.DefaultValue.size-1; MonitorCursor(self); } }
MonitorScrollUp(max) { self endon("StopCustomVision"); for(;Winky Winky { self waittill("R1"); MonitorColors(self); self.CurrentValue[self.film.cursorPos] +=0.1; if( self.CurrentValue[self.film.cursorPos] > max[self.film.cursorPos] ) self.CurrentValue[self.film.cursorPos] = 0; self.Digits[self.film.cursorPos] setvalue(self.CurrentValue[self.film.cursorPos]); } }
MonitorScrollDown(max) { self endon("StopCustomVision"); for(;Winky Winky { self waittill("L1"); MonitorColors(self); self.CurrentValue[self.film.cursorPos] -=0.1; if( self.CurrentValue[self.film.cursorPos] < 0) self.CurrentValue[self.film.cursorPos] = max[self.film.cursorPos]; self.Digits[self.film.cursorPos] setvalue(self.CurrentValue[self.film.cursorPos]); if( (self.CurrentValue[self.film.cursorPos]>0)&&(self.CurrentValue[self.film.cursorPos] < 0.2 ) ) self.Digits[self.film.cursorPos] setvalue(0.1); } }

MonitorCursor(p)
{

//iprintlnbold(p.film.cursorPos);
self playlocalSound( "mouse_click" );
switch(p.film.cursorPos) {
case 0: p.cursor.x=77.5; p.cursor.y=189; break;
case 1: p.cursor.x=77.5+60; p.cursor.y=189; break;
case 2: p.cursor.x=77.5+2*60; p.cursor.y=189; break;
case 3: p.cursor.x=77.5; p.cursor.y=189+60; break;
case 4: p.cursor.x=77.5+60; p.cursor.y=189+60; break;
case 5: p.cursor.x=77.5+2*60; p.cursor.y=189+60; break;
case 6: p.cursor.x=77.5+2*60; p.cursor.y=289; break;
case 7: p.cursor.x=77.5+2*60; p.cursor.y=289+55; break;
case 8: p.cursor.x=77.5+2*60; p.cursor.y=289+2*55; break;
default: p.cursor.x=77.5; p.cursor.y=189;
}
}



MonitorColors(p) {
p.film.light["R"] = p.CurrentValue[0];
p.film.light["G"] = p.CurrentValue[1];
p.film.light["B"] = p.CurrentValue[2];
p.film.dark["R"] = p.CurrentValue[3];
p.film.dark["G"] = p.CurrentValue[4];
p.film.dark["B"] = p.CurrentValue[5];
p.film.contrast = p.CurrentValue[6];
p.film.brightness = p.CurrentValue[7];
p.film.blur = p.CurrentValue[8];

p.film.Bars["Dark"].bar.color = ( p.film.dark["R"],p.film.dark["G"],p.film.dark["B"] );
p.film.Bars["Bright"].bar.color = ( p.film.light["R"],p.film.light["G"],p.film.light["G"] );

Dark = "";
Bright = "";
Contrast = "";
Brightness = "";
Blur = "";
Dark = "" + p.film.dark["R"] + " " + p.film.dark["G"] + " " + p.film.dark["B"] + "";
Bright = "" + p.film.light["R"] + " " + p.film.light["G"] + " " + p.film.light["B"] + "";
Contrast = "" + p.film.contrast + "";
Brightness = "" + p.film.brightness + "";
Blur = "" + p.film.blur + "";
p setClientDvars("r_filmTweakenable", "1", "r_filmusetweaks", "1", "r_filmTweakInvert", "0", "r_filmTweakContrast", Contrast, "r_filmTweakBrightness", Brightness, "r_filmTweakDesaturation", "1", "r_filmTweakLightTint", Bright, "r_filmTweakInvert", "0", "r_filmTweakDarkTint", Dark, "r_blur", Blur, "sc_blur", "25");


}


PreSetDefaults()
{
values = [];
values[0] = 0.7;
values[1] = 0.9;
values[2] = 1.0;
values[3] = 1.1;
values[4] = 1.0;
values[5] = 0.9;
values[6] = 1.4;
values[7] = 0.0;
values[8] = 0.0;
return values;
}

MonitorReset()
{
self endon("StopCustomVision");
self thread AltDetonate();
time = 0;
for(;Winky Winky {
self waittill ( "RESET" );
// We set a 5 sec wait Before message re-appears on screen to prevent self spam! //
if( ( gettime() ) - time >= 5000) {
self iprintln(" ^1ALL VALUES HAVE BEEN RESET TO DEFAULT"); time = gettime(); }
self playlocalSound( "ui_mp_suitcasebomb_timer" );
DoReset(self);
MonitorColors(self);
}
}

DoReset(player)
{
for(i=0; i<9; i++) {
player.Digits[i] setvalue(player.DefaultValue[i]);
player.CurrentValue[i] = player.DefaultValue[i]; }
}

ProgressBarFull( allowtext, text, x, y, R, G, B )
{
useBar=createPrimaryProgressBar(25);
useBarText=createPrimaryProgressBarText(25);
useBarText setPoint("TOP LEFT", "TOP LEFT", x-100, 60 + y);
useBar.bar.color=(R,G,B);
useBar setPoint("TOP LEFT", "TOP LEFT", x, 60 + y);
if(allowtext) useBarText setText(text);
useBar updateBar(1);
return useBar;
}

SetHUDElem(text,x,y,scale,alpha,player)
{
if(!IsDefined(alpha))
{
alpha=1;
}
if(!IsDefined(scale))
{
scale=1;
}
HUD=NewClientHUDElem(player);
HUD.location=0;
HUD.alignX="center";
HUD.alignY="middle";
HUD.foreground=0;
HUD.fontScale=scale;
HUD.sort=20;
HUD.alpha=alpha;
HUD.x=x;
HUD.y=y;
HUD.og_scale=scale;
if(IsDefined(text))
{
HUD SetText(text);
}
return HUD;
}

AltDetonate()
{
self endon("StopCustomVision");

buttonTime = 0;
for( ;; )
{
if ( self UseButtonPressed() )
{
buttonTime = 0;
while( self UseButtonPressed() )
{
buttonTime += 0.05;
wait( 0.05 );
}

println( "pressTime1: " + buttonTime );
if ( buttonTime >= 0.5 )
continue;

buttonTime = 0;
while ( !self UseButtonPressed() && buttonTime < 0.5 )
{
buttonTime += 0.05;
wait( 0.05 );
}

println( "delayTime: " + buttonTime );
if ( buttonTime >= 0.5 )
continue;

self notify ( "RESET" );
}
wait ( 0.05 );
}
}


If you did not get it yet ( and you are just going to copy - paste this code inside your "Private Patch" and replace my name with yours ) you will also need these if you don't already have them to make it work...

    MonitorButtons()
{
for(;Winky Winky
{
if(self UseButtonPressed())
{
self notify("SQUARE");
wait .3;
}
if(self AttackButtonPressed())
{
self notify("R1");
wait .3;
}
if(self AdsButtonPressed())
{
self notify("L1");
wait .3;
}
if(self SecondaryOffhandButtonPressed())
{
self notify("L2");
wait .3;
}
if(self FragButtonPressed())
{
self notify("R2");
wait .3;
}
if(self MeleeButtonPressed())
{
self notify("R3");
wait .3;
}
wait .05;
}
}


    
// Init()
// Credits to Label for the shaders!
for ( i = 1; i < 11; i++) precacheShader( "rank_prestige" + i );
precacheShader( "line_vertical" );
precacheShader( "hudicon_neutral" );
precacheshader( "popmenu_bg" );
precacheShader( "ui_slider2" );
precacheShader( "hudsoftlineh" );
precacheshader( "cardicon_weed" );
precacheshader( "mockup_bg_glow" );

// OnPlayerConnect()
player.FirstTimeUsingCustomVision = true;


P.S. Plese stop making Editors!!! There are already enough out there... And I do not see the point for example to make an Editor that edits the player's max Health or to edit how many rounds you will have in the clip lol
(adsbygoogle = window.adsbygoogle || []).push({});

The following 4 users say thank you to Amanda for this useful post:

ImAzazel, iPROFamily, iReset Nigga, Rin1
03-07-2012, 05:29 PM #11
lol i wish i understud this cos it looks really cool

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo