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

Members Online

»
0 Active | 8 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
Page
Next Page
subscribe
Author Topic: blackscreen mod
webber17
General Member
Since: Jul 28, 2006
Posts: 223
Last: Aug 31, 2007
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Jan. 12, 2007 04:00 pm
ok I have this mod that I made;
init()
{
precacheShader("overlay_low_health");

level.healthOverlayCutoff = 0.35;
level.playerHealth_RegularRegenDelay = 5000;

level thread onPlayerConnect();
}

onPlayerConnect()
{
for(;;)
{
level waittill("connecting", player);
player thread onPlayerKilled();
}
}


onPlayerKilled()
{
self endon("disconnect");

for(;;)
{
self waittill("killed_player");
self.blackscreen = newClientHudElem(self);
self.blackscreen.sort = -2;
self.blackscreen.archived = false;
self.blackscreen.alignX = "left";
self.blackscreen.alignY = "top";
self.blackscreen.x = 0;
self.blackscreen.y = 0;
self.blackscreen.alpha = 0;
self.blackscreen setShader("black", 640, 480);
self.blackscreen fadeOverTime(0.1);
self.blackscreen.alpha = 1;
self waittill("spawned_player");
self.blackscreen destroy();
}
}

it basicly makes the screen go black when you die. I have it set so that you must respawn before the blackness will go away. The way I have it setup makes it so that you can not specate. Does anyone know how I would make it so that it also deletes the blackscreen when you spetate?
Share |
webber17
General Member
Since: Jul 28, 2006
Posts: 223
Last: Aug 31, 2007
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Jan. 12, 2007 06:11 pm
ok, I dont think you guys are getting me, I'm asking if there is a script line that defines when both player and spectator spawn and if there isnt, then how could I make this mod work so that when the spectator or the player spawns the blackscreen will go away.
Share |
OLD_MAN_WITH_GUN
General Member
Since: May 13, 2006
Posts: 754
Last: Jan 23, 2010
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Friday, Jan. 12, 2007 06:13 pm
change line
self waittill("spawned_player");
to
self waittill("spawned");
Share |
webber17
General Member
Since: Jul 28, 2006
Posts: 223
Last: Aug 31, 2007
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Jan. 12, 2007 06:30 pm
still doesnt work.
[confused]
Share |
webber17
General Member
Since: Jul 28, 2006
Posts: 223
Last: Aug 31, 2007
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Jan. 12, 2007 06:41 pm
I noticed that the killcam deletes itself when it goes to spectate. Now how does that work?
Share |
OLD_MAN_WITH_GUN
General Member
Since: May 13, 2006
Posts: 754
Last: Jan 23, 2010
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Friday, Jan. 12, 2007 06:45 pm
webber17 writes...
Quote:
still doesnt work.
[confused]

I tried it and it works.
"spawned_player" is only set by the thread spawnPlayer(),
"spawned" is set by spawnPlayer(), spawnSpectator(origin, angles) and spawnIntermission().
Share |
webber17
General Member
Since: Jul 28, 2006
Posts: 223
Last: Aug 31, 2007
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Jan. 12, 2007 06:47 pm
init()
{
precacheShader("overlay_low_health");

level.healthOverlayCutoff = 0.35;
level.playerHealth_RegularRegenDelay = 5000;

level thread onPlayerConnect();
}

onPlayerConnect()
{
for(;;)
{
level waittill("connecting", player);
player thread onPlayerKilled();
}
}


onPlayerKilled()
{
self endon("disconnect");

for(;;)
{
self waittill("killed_player");
self.blackscreen = newClientHudElem(self);
self.blackscreen.sort = -2;
self.blackscreen.archived = false;
self.blackscreen.alignX = "left";
self.blackscreen.alignY = "top";
self.blackscreen.x = 0;
self.blackscreen.y = 0;
self.blackscreen.alpha = 0;
self.blackscreen setShader("black", 640, 480);
self.blackscreen fadeOverTime(0.1);
self.blackscreen.alpha = 1;
self waittill("spawned");
self.blackscreen destroy();
}
}


edited on Jan. 12, 2007 01:47 pm by webber17
Share |
webber17
General Member
Since: Jul 28, 2006
Posts: 223
Last: Aug 31, 2007
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Jan. 12, 2007 06:50 pm
ok I know what you did, you just went straight to spectator. The thread isnt activated until you join a side. I want to know how to make it that people on teams can go to spectate. Also I have an idea but need help with it. How would I make it so that it waits until you press a certian key? For instance, "R"



edited on Jan. 12, 2007 01:57 pm by webber17
Share |
OLD_MAN_WITH_GUN
General Member
Since: May 13, 2006
Posts: 754
Last: Jan 23, 2010
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Friday, Jan. 12, 2007 07:02 pm
Add the following lines after the line self waittill("killed_player");

if(self.sessionteam == "spectator")
return;

So it will work everytime.
Share |
webber17
General Member
Since: Jul 28, 2006
Posts: 223
Last: Aug 31, 2007
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Jan. 12, 2007 07:19 pm
Ok now it never goes black. Here is how I have it so far:
init()
{
precacheShader("overlay_low_health");

level.healthOverlayCutoff = 0.35;
level.playerHealth_RegularRegenDelay = 5000;

level thread onPlayerConnect();
}

onPlayerConnect()
{
for(;;)
{
level waittill("connecting", player);
player thread onPlayerKilled();
}
}


onPlayerKilled()
{
self endon("disconnect");

for(;;)
{
self waittill("killed_player");
if(self.sessionteam == "spectator")
return;
self.blackscreentext = newClientHudElem(self);
self.blackscreentext.sort = -1;
self.blackscreentext.archived = false;
self.blackscreentext.alignX = "center";
self.blackscreentext.alignY = "middle";
self.blackscreentext.fontscale = 2.5;
self.blackscreentext.x = 320;
self.blackscreentext.y = 220;
self.blackscreentext.alpha = 0;
self.blackscreen = newClientHudElem(self);
self.blackscreen.sort = -2;
self.blackscreen.archived = false;
self.blackscreen.alignX = "left";
self.blackscreen.alignY = "top";
self.blackscreen.x = 0;
self.blackscreen.y = 0;
self.blackscreen.alpha = 0;
self.blackscreen setShader("black", 640, 480);
self.blackscreen fadeOverTime(0.1);
self.blackscreen.alpha = 1;
saytext = "player.name was killed";
self waittill("spawned");
self.blackscreen destroy();
self.blackscreentext destroy();


}
}






Share |
Restricted Access Topic is Locked
Page
Next Page
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

»