UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Make Grenades Do Damage To Other Players?

broken avatar :(
Created 9 years ago
by jbird
0 Members and 1 Guest are viewing this topic.
2,824 views
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 4 years ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
×
jbird's Groups
Is there a way to make your grenades do 25 damage to other players?
broken avatar :(
  • steviewonder87
  • Deleted Member
×
broken avatar :(
steviewonder87
This user is deleted :(
You probably have to edit in callbackglobal.gsc, there's a section about damaging other players in there.
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 4 years ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
jbird's Groups
This is what I put so far, haven't tested anything yet
Code Snippet
Plaintext
if( isDefined( eAttacker ) )
{
if( isPlayer( eAttacker ) && self != eAttacker )
{
if( sMeansOfDeath == "MOD_GRENADE_SPLASH" )
{
sMeansOfDeath = "MOD_RIFLE_BULLET";
iDamage = 25;
self maps\_callbackglobal::finishPlayerDamageWrapper( eInflictor, eAttacker, finalDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime );
}

if( eAttacker meleeButtonPressed() )
{
self setVelocity( vectorToAngles( eAttacker.origin - self.origin ) ); // Not tested, you'll have to play around with this. Most likely won't push the player in the correct direction.

self setMoveSpeedScale( .3 );
wait( 1 );
self setMoveSpeedScale( 1 );
}

if( eAttacker attackButtonPressed() )
{
self setMoveSpeedScale( .3 );
wait( 1 );
self setMoveSpeedScale( 1 );
}
}

if( isDefined( self.ignoreAttacker ) && self.ignoreAttacker == eAttacker )
{
return;
}

if( isDefined( eAttacker.is_zombie ) && eAttacker.is_zombie )
{
self.ignoreAttacker = eAttacker;
self thread remove_ignore_attacker();
}

if( isDefined( eAttacker.damage_mult ) )
{
iDamage *= eAttacker.damage_mult;
}
eAttacker notify( "hit_player" );
}
I put it under player_damage_override in _zombiemode.gsc
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
need to see the whole thing really

thats only part of a function
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 4 years ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
jbird's Groups
Here is all of player_damage_override (I have some stuff in there for round restarting)
Code Snippet
Plaintext
player_damage_override( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime )
{
/*
if(self hasperk("specialty_armorvest") && eAttacker != self)
{
iDamage = iDamage * 0.75;
iprintlnbold(idamage);
}*/

if( sMeansOfDeath == "MOD_FALLING" )
{
sMeansOfDeath = "MOD_RIFLE_BULLET";
}

if( isDefined( eAttacker ) )
{
if( isPlayer( eAttacker ) && self != eAttacker )
{
if( sMeansOfDeath == "MOD_GRENADE_SPLASH" )
{
sMeansOfDeath = "MOD_RIFLE_BULLET";
iDamage = 25;
self maps\_callbackglobal::finishPlayerDamageWrapper( eInflictor, eAttacker, finalDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime );
}

if( eAttacker meleeButtonPressed() )
{
self setVelocity( vectorToAngles( eAttacker.origin - self.origin ) ); // Not tested, you'll have to play around with this. Most likely won't push the player in the correct direction.

self setMoveSpeedScale( .3 );
wait( 1 );
self setMoveSpeedScale( 1 );
}

if( eAttacker attackButtonPressed() )
{
self setMoveSpeedScale( .3 );
wait( 1 );
self setMoveSpeedScale( 1 );
}
}

if( isDefined( self.ignoreAttacker ) && self.ignoreAttacker == eAttacker )
{
return;
}

if( isDefined( eAttacker.is_zombie ) && eAttacker.is_zombie )
{
self.ignoreAttacker = eAttacker;
self thread remove_ignore_attacker();
}

if( isDefined( eAttacker.damage_mult ) )
{
iDamage *= eAttacker.damage_mult;
}
eAttacker notify( "hit_player" );
}

finalDamage = iDamage;

if( sMeansOfDeath == "MOD_PROJECTILE" || sMeansOfDeath == "MOD_PROJECTILE_SPLASH" || sMeansOfDeath == "MOD_GRENADE" || sMeansOfDeath == "MOD_GRENADE_SPLASH" )
{
if( self.health > 75 )
{
finalDamage = 75;
self maps\_callbackglobal::finishPlayerDamageWrapper( eInflictor, eAttacker, finalDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime );
return;
}
}

if( iDamage < self.health )
{
if ( IsDefined( eAttacker ) )
{
eAttacker.sound_damage_player = self;
}

//iprintlnbold(iDamage);
self maps\_callbackglobal::finishPlayerDamageWrapper( eInflictor, eAttacker, finalDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime );
return;
}
if( level.intermission )
{
level waittill( "forever" );
}

players = get_players();
count = 0;
for( i = 0; i < players.size; i++ )
{
if( players[i] == self || players[i].is_zombie || players[i] maps\_laststand::player_is_in_laststand() || players[i].sessionstate == "spectator" )
{
count++;
}
}

if( count < players.size )
{
self maps\_callbackglobal::finishPlayerDamageWrapper( eInflictor, eAttacker, finalDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime );
return;
}

self.intermission = true;

self thread maps\_laststand::PlayerLastStand( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime );
self player_fake_death();

if( count == players.size )
{
self maps\_laststand::laststand_take_player_weapons();

zombs = getaiarray("axis");
for(i=0;i<zombs.size;i++)
{
zombs[i] delete(); //removes all currently spawned in zombies
}

maps\_zombiemode_powerups::powerup_round_start(); //restarts the amount of powerups you can earn this round
array_thread( players, maps\_zombiemode_blockers_new::rebuild_barrier_reward_reset ); //restarts your barrier points this round
level thread [[level.round_spawn_func]](); //makes the amount of zombies restart to its original amount for the round

players = get_players();
for( i = 0; i < players.size; i++ ) //respawns you back in and gives you your weapons back
{
players[i] spectator_respawn();
players[i] [[level.spawnPlayer]]();
while(1)
{
if(players[i] hasWeapon("zombie_colt"))
{
players[i] maps\_laststand::laststand_giveback_player_weapons();
if( isDefined( players[i].has_altmelee ) && players[i].has_altmelee )
{
players[i] SetPerk( "specialty_altmelee" );
}
level thread award_grenades_for_survivors(); //get 2 extra grenades when you spawn back in, optional
break;
}
wait(0.05);
}
}
iprintlnbold("You have been given another chance"); //message letting you know the round restarted, optional
}
else
{
self maps\_callbackglobal::finishPlayerDamageWrapper( eInflictor, eAttacker, finalDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, modelIndex, psOffsetTime );
}
}
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 7 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I will never understand how you think of these kinds of bullshit workarounds.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 7 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
Signature
×
liamsa669's Groups
liamsa669's Contact & Social Links
25 damage to other players?
just make a waittill gernade fired then a waittill for the explode
Code Snippet
Plaintext
		self waittill( "grenade_fire", grenade, weapName );

self waittill( "explode", position );
now just do damage to people in a certain radius

edit:
heres an example of what mine would look like:
Code Snippet
Plaintext
functname(){
  for(;;){
    players = get_players();
    for(i=0;i<players.size;i++){
      players[i] grenade_logic();
    }
}
grenade_logic(){
  self waittill( "grenade_fire" , grenade , weapName );
  //if( weapName == "zombie_black_hole_bomb" ) //this can be used for specific grenades
  grenade waittill( "explode" , position );
  players = get_players();
  for( u=0;u<players.size;u++ ){
    if( distance( players[u] , position ) <= 30){
      //player[u] shellshock( "grenade" , 3 ); //this will shellshock the player
      zombies = getaiarray( "axis" ,  "all" );
      player[u] dodamage(25 , ( 0 , 0 , 0 ) , zombies[0] , "grenade"); // the last parameter might be wrong, im not shure if it wanted the entity or type or MOD_*
    }
  }
}
}
Last Edit: June 19, 2015, 06:38:23 pm by liamsa669
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 4 years ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
jbird's Groups
just make a waittill gernade fired then a waittill for the explode
Code Snippet
Plaintext
		self waittill( "grenade_fire", grenade, weapName );

self waittill( "explode", position );
now just do damage to people in a certain radius

edit:
heres an example of what mine would look like:
Code Snippet
Plaintext
functname(){
  for(;;){
    players = get_players();
    for(i=0;i<players.size;i++){
      players[i] grenade_logic();
    }
}
grenade_logic(){
  self waittill( "grenade_fire" , grenade , weapName );
  //if( weapName == "zombie_black_hole_bomb" ) //this can be used for specific grenades
  grenade waittill( "explode" , position );
  players = get_players();
  for( u=0;u<players.size;u++ ){
    if( distance( players[u] , position ) <= 30){
      //player[u] shellshock( "grenade" , 3 ); //this will shellshock the player
      zombies = getaiarray( "axis" ,  "all" );
      player[u] dodamage(25 , ( 0 , 0 , 0 ) , zombies[0] , "grenade"); // the last parameter might be wrong, im not shure if it wanted the entity or type or MOD_*
    }
  }
}
}

Couldn't you use radiusdamage instead and use the origin of the grenade?

Also, I tested and theres two problems: the grenade damages me no matter how far away it is and it doesnt seem i can get damaged from another grenade until i have rehealed
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 13 May 2015
Last active: 9 years ago
Posts
49
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
BakedXTHC's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
BakedXTHC's Contact & Social Linkskieran.gronbachBakedXTHC
Could there be a way to edit a config file for friendly fire? If so it might be able to be changed in there?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 27 January 2015
Last active: 7 years ago
Posts
337
Respect
Forum Rank
Perk Hacker
Primary Group
Member
×
liamsa669's Groups
liamsa669's Contact & Social Links
Couldn't you use radiusdamage instead and use the origin of the grenade?

Also, I tested and theres two problems: the grenade damages me no matter how far away it is and it doesnt seem i can get damaged from another grenade until i have rehealed
ok ill run some tests and tell u a revised script... also radius damage should work

 
Loading ...