Posts: 719
Threads: 69
Joined: Nov 2010
Reputation:
76
11-27-2011, 04:36
(This post was last modified: 11-27-2011, 06:02 by master131.)
I've got a problem with damage, it doesn't react to bullet damage, only explosive damage.
eg.
Code: riot setCanDamage(true);
riot.team = self.team;
riot.owner = self;
riot.health = 100;
riot.maxhealth = 100;
riot waittill("damage", damage, attacker);
iPrintLn(attacker.name + " hurt the riot shield guy with " + damage + " damage!"); // This only appears on explosion and stuns, not bullets?
EDIT - It's probably because the body is not solid... I'm using an invisible care package for now, it's not a very good solution since if the model starts proning, the carepackage is still standing up.
A casual conversation between barata and I about Nukem.
Posts: 5,135
Threads: 241
Joined: Nov 2010
Reputation:
100
11-27-2011, 07:40
(This post was last modified: 11-27-2011, 07:49 by Pozzuh.)
Doesn't matter if the model is solid, sentry guns are also non solid. Does the waittill not work for bullet damage, or doesn't the guy die?
Also, x.health is bugged with setcandamage(). Just modify the sentry gun damage script:
Code: sentry_handleDamage()
{
self endon( "death" );
level endon( "game_ended" );
self.health = level.sentrySettings[ self.sentryType ].health;
self.maxHealth = level.sentrySettings[ self.sentryType ].maxHealth;
self.damageTaken = 0; // how much damage has it taken
while ( true )
{
self waittill( "damage", damage, attacker, direction_vec, point, meansOfDeath, modelName, tagName, partName, iDFlags, weapon );
// don't allow people to destroy equipment on their team if FF is off
if ( !maps\mp\gametypes\_weapons::friendlyFireCheck( self.owner, attacker ) )
continue;
if ( IsDefined( iDFlags ) && ( iDFlags & level.iDFLAGS_PENETRATION ) )
self.wasDamagedFromBulletPenetration = true;
// up the damage for airstrikes, stealth bombs, and bomb sites
switch( weapon )
{
case "artillery_mp":
case "stealth_bomb_mp":
damage *= 4;
break;
case "bomb_site_mp":
damage = self.maxHealth;
break;
}
if ( meansOfDeath == "MOD_MELEE" )
self.damageTaken += self.maxHealth;
modifiedDamage = damage;
if ( isPlayer( attacker ) )
{
attacker maps\mp\gametypes\_damagefeedback::updateDamageFeedback( "sentry" );
if ( attacker _hasPerk( "specialty_armorpiercing" ) )
{
modifiedDamage = damage * level.armorPiercingMod;
}
}
// in case we are shooting from a remote position, like being in the osprey gunner shooting this
if( IsDefined( attacker.owner ) && IsPlayer( attacker.owner ) )
{
attacker.owner maps\mp\gametypes\_damagefeedback::updateDamageFeedback( "sentry" );
}
if( IsDefined( weapon ) )
{
switch( weapon )
{
case "ac130_105mm_mp":
case "ac130_40mm_mp":
case "stinger_mp":
case "javelin_mp":
case "remote_mortar_missile_mp":
case "remotemissile_projectile_mp":
self.largeProjectileDamage = true;
modifiedDamage = self.maxHealth + 1;
break;
case "artillery_mp":
case "stealth_bomb_mp":
self.largeProjectileDamage = false;
modifiedDamage += ( damage * 4 );
break;
case "bomb_site_mp":
case "emp_grenade_mp":
self.largeProjectileDamage = false;
modifiedDamage = self.maxHealth + 1;
break;
}
}
self.damageTaken += modifiedDamage;
if ( self.damageTaken >= self.maxHealth )
{
thread maps\mp\gametypes\_missions::vehicleKilled( self.owner, self, undefined, attacker, damage, meansOfDeath, weapon );
if ( isPlayer( attacker ) && (!IsDefined(self.owner) || attacker != self.owner) )
{
attacker thread maps\mp\gametypes\_rank::giveRankXP( "kill", 100, weapon, meansOfDeath );
attacker notify( "destroyed_killstreak" );
if ( IsDefined( self.UAVRemoteMarkedBy ) && self.UAVRemoteMarkedBy != attacker )
self.UAVRemoteMarkedBy thread maps\mp\killstreaks\_remoteuav::remoteUAV_processTaggedAssist();
}
if ( IsDefined( self.owner ) )
self.owner thread leaderDialogOnPlayer( level.sentrySettings[ self.sentryType ].voDestroyed );
self notify ( "death" );
return;
}
}
}
Posts: 719
Threads: 69
Joined: Nov 2010
Reputation:
76
waittill doesn't work for bullet damage. That's why I have to use an invisible CP.
A casual conversation between barata and I about Nukem.
Posts: 3,535
Threads: 420
Joined: Dec 2010
Reputation:
106
(11-27-2011, 09:46)master131 Wrote: waittill doesn't work for bullet damage. That's why I have to use an invisible CP.
Yes, when it crawls or prone, rotate the carepackage.
Posts: 592
Threads: 67
Joined: Apr 2012
Reputation:
17
When will you release this mod?
I'm need this, this will be funny on a server
|