Author |
Topic: SCRIPT EFFECT HELP |
adam57 |
General Member Since: May 15, 2007 Posts: 23 Last: Aug 23, 2018 [view latest posts] |
|
|
|
playername |
|
Preferred Member Since: Aug 24, 2006 Posts: 821 Last: Apr 15, 2011 [view latest posts] |
|
|
|
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. |
|
|
|
adam57 |
General Member Since: May 15, 2007 Posts: 23 Last: Aug 23, 2018 [view latest posts] |
|
|
|
adam57 |
General Member Since: May 15, 2007 Posts: 23 Last: Aug 23, 2018 [view latest posts] |
|
|
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
|
|
|
|
playername |
|
Preferred Member Since: Aug 24, 2006 Posts: 821 Last: Apr 15, 2011 [view latest posts] |
|
|
|
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. |
|
|
|
Mystic |
|
General Member Since: Apr 10, 2004 Posts: 6147 Last: Apr 15, 2018 [view latest posts] |
|
|
|
|
|
playername |
|
Preferred Member Since: Aug 24, 2006 Posts: 821 Last: Apr 15, 2011 [view latest posts] |
|
|
|
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. |
|
|
|
adam57 |
General Member Since: May 15, 2007 Posts: 23 Last: Aug 23, 2018 [view latest posts] |
|
|
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 |
|
|
|
playername |
|
Preferred Member Since: Aug 24, 2006 Posts: 821 Last: Apr 15, 2011 [view latest posts] |
|
|
|
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. |
|
|
|
adam57 |
General Member Since: May 15, 2007 Posts: 23 Last: Aug 23, 2018 [view latest posts] |
|
|
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
|
|
|
|