Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 6 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Screen as if you're unconcious
Carl21221
General Member
Since: Apr 13, 2006
Posts: 134
Last: Jul 31, 2015
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Tuesday, Apr. 1, 2008 10:48 pm
How would i go about making the screen turn black as if you are unconcious or knocked out? An example would be on the level where you are a president being dragged through a town by two people on CoD4, but i want to make it for CoD2.
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Tuesday, Apr. 1, 2008 11:19 pm
new HUD element, full screen, black. Transparecy works too (eg. fading from black slowly).

taken from ac130_credits.gsc:

Code:
fadeOverlay( material )
{
	duration = 5;
	
	overlay = newHudElem();
	overlay.x = 0;
	overlay.y = 0;
	overlay setshader ( material, 640, 480);
	overlay.alignX = "left";
	overlay.alignY = "top";
	overlay.horzAlign = "fullscreen";
	overlay.vertAlign = "fullscreen";
	overlay.alpha = 1;
	
	overlay fadeOverTime( duration );
	overlay.alpha = 0;
	MusicStop( duration );
	
	wait duration;
	overlay destroy();
}


function call:
thread fadeOverlay( "black" );

necessary:
precacheshader("black"); // found it below the fadeOverlay call?!

you may change the script.
Share |
Carl21221
General Member
Since: Apr 13, 2006
Posts: 134
Last: Jul 31, 2015
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Tuesday, Apr. 1, 2008 11:33 pm
just tried this. its all fine apart from it says: uninitialised variable "meterial". how do i "initialize" it?

Edit: Nevermind, i just recopied your script over the one i previously copied and it worked :)

Thanks alot mate [thumbs_up]

edited on Apr. 1, 2008 07:39 pm by Carl21221
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»