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

Members Online

»
0 Active | 81 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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
Category: CoDUO Mapping
CoD United Offensive mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: SCRIPT EFFECT HELP
adam57
General Member
Since: May 15, 2007
Posts: 23
Last: Aug 23, 2018
[view latest posts]
Level 1
Category: CoDUO Mapping
Posted: Tuesday, Jun. 16, 2009 08:31 am
hello all

i add a lot of stuff in gfm mod (adding flash bang ,cocktail ,gazmustard and other sound and effect.

and adding effect when your life is under 10%

i have this in my server.cfg

// Activation ou désactivation (1 = actif) (defaut 1)
set scr_fd_healthymode "1"

// Pourcentage du seuil de vie en dessous duquel le joueur entend son coeur battre
set scr_fd_healthymin "10"

// Pourcentage de chance de plainte du joueur blesse se déplacant
set scr_fd_rdmpain "80"





bleeding()
{
self endon("death");

while (isalive(self))
{
wait 5;

if (self.health < level.fd_healthymin)
{
self.laststance = self getstance();
self.bleeding = true;
while (self.health < level.fd_healthymin)
{
self shellshock("mc_hit6", 3);
self playlocalsound("heartbeat");
self disableweapon();

if ((randomint(100) < level.fd_rdmpain) && (self.laststance != self getstance())) thread painsound("bleeding");
wait 1;
}
self.bleeding = undefined;
wait 1;
}
if (self.health > level.fd_healthymin)
{
self enableweapon();
}
}

}

its ok run
but i want to add player lost live slowy 10% to 0% and dead its possible???

thanks for your help..

Adam


Share |
playername
Preferred Member
Since: Aug 24, 2006
Posts: 821
Last: Apr 15, 2011
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Wednesday, Jun. 17, 2009 01:50 pm
Yes, while they are bleeding, you can slowly decrease their health. Once it reaches 0%, call the death function. However, in order for the obituatry to work properly, you might have to store who last put damage on that person. So, in the gametype's damage function, set something like "self.last_damage = eAttaker;". This way, you can call the killed function easier.

Here is something I came up for the decreased health.
Code:

bleeding()
{
self endon("death");

timer = 0;

while (isalive(self))
{
wait 5;

if (self.health < level.fd_healthymin)
{
self.laststance = self getstance();
self.bleeding = true;
while (self.health < level.fd_healthymin)
{
self shellshock("mc_hit6", 3);
self playlocalsound("heartbeat");
self disableweapon();

if(timer == 5)  // decrease health every 5 seconds.
{
self.health -= 1; // Take of 1 health every time
timer = 0;
}
else
timer++; // increase timer

if ((randomint(100) < level.fd_rdmpain) && (self.laststance != self getstance())) thread painsound("bleeding");
wait 1;
}
self.bleeding = undefined;
wait 1;
}
if (self.health > level.fd_healthymin)
{ 
self enableweapon();
}
}

}
nullFew tips for coding.
1. Keep the script as short as possible.
2. Don't comment every line. Only comment portions where they may be needed to point something out.
3. Don't over complicate the script, keep it organized and easy to read.

These help you find simple errors and makes it easy to make changes.
Share |
adam57
General Member
Since: May 15, 2007
Posts: 23
Last: Aug 23, 2018
[view latest posts]
Level 1
Category: CoDUO Mapping
Posted: Wednesday, Jun. 17, 2009 07:10 pm
hello mate
i'll try if it s ok and work and i tell you

thanks for the help

Share |
adam57
General Member
Since: May 15, 2007
Posts: 23
Last: Aug 23, 2018
[view latest posts]
Level 1
Category: CoDUO Mapping
Posted: Thursday, Jun. 18, 2009 12:47 pm
hello

decrease healt work perfectly
but i don't see the killed fonction in gametype

here my HQ.gsc
http://perso.numericable.fr/antonywar/hq.gsc

thank's for the help

Share |
playername
Preferred Member
Since: Aug 24, 2006
Posts: 821
Last: Apr 15, 2011
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Thursday, Jun. 18, 2009 01:52 pm
Hello again,
In the "Callback_PlayerDamage" function, you need to say who last damaged the person. Underneth the seasefire mode stuff, add:
Code:

self.lastDamage["eInflictor"] = eInflictor;
self.lastDamage["eAttacker"] = eAttacker;
self.lastDamage["iDamage"] = iDamage;
self.lastDamage["sMeansOfDeath"] = sMeansOfDeath;
self.lastDamage["sWeapon"] = sWeapon;
self.lastDamage["vDir"] = vDir;
self.lastDamage["sHitLoc"] = sHitLoc;


Now, for the killing part, when the player bleeds to death, you can make your own function and call it like this:
Code:

kill_player()
{
eInflictor = self.lastDamage["eInflictor"];
attacker = self.lastDamage["eAttacker"];
iDamage = self.lastDamage["iDamage"];
sMeansOfDeath = self.lastDamage["sMeansOfDeath"];
sWeapon = self.lastDamage["sWeapon"];
vDir = self.lastDamage["vDir"];
sHitLoc = self.lastDamage["sHitLoc"];

self thread Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc)
}
nullFew tips for coding.
1. Keep the script as short as possible.
2. Don't comment every line. Only comment portions where they may be needed to point something out.
3. Don't over complicate the script, keep it organized and easy to read.

These help you find simple errors and makes it easy to make changes.
Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Thursday, Jun. 18, 2009 02:04 pm
Just had a quick look at your script playername and see that wordfilter on the forums has replaced parts of your script with poo-poo, that - will more than likely cause it to crash,

self.lastDamage["poo-pooLoc"] = poo-pooLoc;
Share |
playername
Preferred Member
Since: Aug 24, 2006
Posts: 821
Last: Apr 15, 2011
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Thursday, Jun. 18, 2009 03:17 pm
Lol all because of "s.Hit" - the . Lets see if I can fix that. Thanks for covering me rasta :P

Try this instead.
Damage function stuff
Code:

self.lastDamage["eInflictor"] = eInflictor;
self.lastDamage["eAttacker"] = eAttacker;
self.lastDamage["iDamage"] = iDamage;
self.lastDamage["sMeansOfDeath"] = sMeansOfDeath;
self.lastDamage["sWeapon"] = sWeapon;
self.lastDamage["vDir"] = vDir;
self.lastDamage["HitLoc"] = s HitLoc; // Change this to s HitLoc without the space


Kill function
Code:

kill_player()
{
eInflictor = self.lastDamage["eInflictor"];
attacker = self.lastDamage["eAttacker"];
iDamage = self.lastDamage["iDamage"];
sMeansOfDeath = self.lastDamage["sMeansOfDeath"];
sWeapon = self.lastDamage["sWeapon"];
vDir = self.lastDamage["vDir"];
HitLoc = self.lastDamage["HitLoc"];

self thread Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, HitLoc)
}


edited on Jun. 18, 2009 11:20 am by playername
nullFew tips for coding.
1. Keep the script as short as possible.
2. Don't comment every line. Only comment portions where they may be needed to point something out.
3. Don't over complicate the script, keep it organized and easy to read.

These help you find simple errors and makes it easy to make changes.
Share |
adam57
General Member
Since: May 15, 2007
Posts: 23
Last: Aug 23, 2018
[view latest posts]
Level 1
Category: CoDUO Mapping
Posted: Thursday, Jun. 18, 2009 06:51 pm
playername writes...
Quote:
Lol all because of "s.Hit" - the . Lets see if I can fix that. Thanks for covering me rasta :P

Try this instead.
Damage function stuff
Code:

self.lastDamage["eInflictor"] = eInflictor;
self.lastDamage["eAttacker"] = eAttacker;
self.lastDamage["iDamage"] = iDamage;
self.lastDamage["sMeansOfDeath"] = sMeansOfDeath;
self.lastDamage["sWeapon"] = sWeapon;
self.lastDamage["vDir"] = vDir;
self.lastDamage["HitLoc"] = s HitLoc; // Change this to s HitLoc without the space


Kill function
Code:

kill_player()
{
eInflictor = self.lastDamage["eInflictor"];
attacker = self.lastDamage["eAttacker"];
iDamage = self.lastDamage["iDamage"];
sMeansOfDeath = self.lastDamage["sMeansOfDeath"];
sWeapon = self.lastDamage["sWeapon"];
vDir = self.lastDamage["vDir"];
HitLoc = self.lastDamage["HitLoc"];

self thread Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, HitLoc)
}


edited on Jun. 18, 2009 11:20 am by playername



hello and thanks for the answer..

but sorry where i add damage and kill function with this

Code:
bleeding()
{
self endon("death");

timer = 0;

while (isalive(self))
{
wait 5;

if (self.health < level.fd_healthymin)
{
self.laststance = self getstance();
self.bleeding = true;
while (self.health < level.fd_healthymin)
{
self shellshock("mc_hit6", 3);
self playlocalsound("heartbeat");
self disableweapon();

if(timer == 5)  // decrease health every 5 seconds.
{
self.health -= 1; // Take of 1 health every time
timer = 0;
}
else
timer++; // increase timer

if ((randomint(100) < level.fd_rdmpain) && (self.laststance != self getstance())) thread painsound("bleeding");
wait 1;
}
self.bleeding = undefined;
wait 1;
}
if (self.health > level.fd_healthymin)
{ 
self enableweapon();
}
}

}


sorry im bad[banghead]
Share |
playername
Preferred Member
Since: Aug 24, 2006
Posts: 821
Last: Apr 15, 2011
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Thursday, Jun. 18, 2009 07:19 pm
OOO sorry, kinda forgot that part.

Code:

bleeding()
{
self endon("death");

timer = 0;

while (isalive(self))
{
wait 5;

if (self.health < level.fd_healthymin)
{
self.laststance = self getstance();
self.bleeding = true;
while (self.health < level.fd_healthymin)
{
self shellshock("mc_hit6", 3);
self playlocalsound("heartbeat");
self disableweapon();

if(timer == 5)  // decrease health every 5 seconds.
{
self.health -= 1; // Take of 1 health every time
timer = 0;
}
else
timer++; // increase timer

if(self.health <= 0)
self thread kill_player();

if ((randomint(100) < level.fd_rdmpain) && (self.laststance != self getstance())) thread painsound("bleeding");
wait 1;
}
self.bleeding = undefined;
wait 1;
}
if (self.health > level.fd_healthymin)
{ 
self enableweapon();
}
}

}


Also, is the bleeding function in the hq.gsc? If not you need to add the kill_player function to the same .gsc as it and change the player killed line to this.
Code:

self thread maps\mp\gametypes\hq::Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, HitLoc);
nullFew tips for coding.
1. Keep the script as short as possible.
2. Don't comment every line. Only comment portions where they may be needed to point something out.
3. Don't over complicate the script, keep it organized and easy to read.

These help you find simple errors and makes it easy to make changes.
Share |
adam57
General Member
Since: May 15, 2007
Posts: 23
Last: Aug 23, 2018
[view latest posts]
Level 1
Category: CoDUO Mapping
Posted: Thursday, Jun. 18, 2009 09:37 pm
hello mate
thanks i try this
Code:
bleeding()
{
self endon("death");<br />
<br />
timer = 0;<br />
<br />
while (isalive(self))
{
wait 5;<br />
<br />
if (self.health < level.fd_healthymin)
{
self.laststance = self getstance();
self.bleeding = true;
while (self.health < level.fd_healthymin)
{
self shellshock("mc_hit6", 3);
self playlocalsound("heartbeat");
self disableweapon();<br />
<br />
if(timer == 5)  // decrease health every 5 seconds.
{
self.health -= 1; // Take of 1 health every time
timer = 0;
}
else
timer++; // increase timer<br />
<br />
if(self.health <= 0)
self thread maps\mp\gametypes\hq::Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, HitLoc);<br />
<br />
if ((randomint(100) < level.fd_rdmpain) && (self.laststance != self getstance())) thread painsound("bleeding");
wait 1;
}
self.bleeding = undefined;
wait 1;
}
if (self.health > level.fd_healthymin)
{ 
self enableweapon();
}
}<br />
<br />
}

but i have this error

Code:
******* script runtime error *******
pair has unmatching types 'undefined' and 'string': (file 'maps\mp\gametypes\hq.gsc', line 909)
 if(sHitLoc == "head" && sMeansOfDeath != "MOD_MELEE")<br />
<br />
            *
called from:
(file 'maps\mp\gametypes\_effets.gsc', line 532)
self thread maps\mp\gametypes\hq::Callback_PlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, HitLoc);<br />
<br />
            *
called from:
(file 'maps\mp\gametypes\_effets.gsc', line 535)
wait 1;<br />
<br />
*
************************************
********************
ERROR: script runtime error
(see console for details


Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty : CoDUO Mapping

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

»