Raised This Month: $32 Target: $400
 8% 

Detonate rocket/sticky/pipe on proximity?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 12-09-2014 , 13:25   Detonate rocket/sticky/pipe on proximity?
Reply With Quote #1

The proximity part is easy, but how in the world would one go about forcing a single projectile to explode?

I have no clue how to SDK call, so I figure I'd just destroy the projectile and make a manual explosion.

But I only know how to make the explosion hit people through walls.
__________________

Last edited by Chdata; 12-09-2014 at 13:25.
Chdata is offline
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 12-09-2014 , 13:51   Re: Detonate rocket/sticky/pipe on proximity?
Reply With Quote #2

Quote:
Originally Posted by Chdata View Post
The proximity part is easy, but how in the world would one go about forcing a single projectile to explode?

I have no clue how to SDK call, so I figure I'd just destroy the projectile and make a manual explosion.

But I only know how to make the explosion hit people through walls.
This could work for rockets and maybe pipes, not sure about stickies

PHP Code:
// When you 'damage' its projectile, its exploding!
// forums.alliedmods.net/showthread.php?p=1985693#post1985693
    
SetEntProp(molotovProp_Data"m_takedamage"2)
    
SetEntProp(molotovProp_Data"m_iHealth"1)
    
SDKHooks_TakeDamage(molotov001.0
__________________
Pelipoika is offline
turtsmcgurts
SourceMod Donor
Join Date: Jul 2011
Old 12-09-2014 , 22:55   Re: Detonate rocket/sticky/pipe on proximity?
Reply With Quote #3

this looks exactly like what you're trying to do, should show you how sdkcalls work as well.
turtsmcgurts is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 12-10-2014 , 01:43   Re: Detonate rocket/sticky/pipe on proximity?
Reply With Quote #4

Eh I guess I'll try that plugin again.

Last I tried it (after hearing that the new offset was found), it still didn't really work. Half a year old now.
__________________
Chdata is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 12-27-2014 , 19:18   Re: Detonate rocket/sticky/pipe on proximity?
Reply With Quote #5

PHP Code:
stock DetonateProjectile(iEnt)
{
    
SetEntProp(iEntProp_Data"m_nNextThinkTick"1);
    
SetEntProp(iEntProp_Data"m_takedamage"2);
    
SetEntProp(iEntProp_Data"m_iHealth"1);
    
SDKHooks_TakeDamage(iEnt001.0);

Tried that, it just silently removes rockets.
__________________

Last edited by Chdata; 12-27-2014 at 19:29.
Chdata is offline
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Old 12-28-2014 , 07:10   Re: Detonate rocket/sticky/pipe on proximity?
Reply With Quote #6

you could just remove the entity and create an explosion.

Kill the entity:
Code:
AcceptEntityInput(entity, "Kill");
create an explosion:
Code:
#define spirite "spirites/zerogxplode.spr"

stock DoExplosion(owner, damage, radius, Float:pos[3])
{
    new explode = CreateEntityByName("env_explosion");
    if(!IsValidEntity(explode))
        return;
    DispatchKeyValue(explode, "targetname", "explode");
    DispatchKeyValue(explode, "spawnflags", "2");
    DispatchKeyValue(explode, "rendermode", "5");
    DispatchKeyValue(explode, "fireballsprite", spirite);

    SetEntPropEnt(explode, Prop_Data, "m_hOwnerEntity", owner);
    SetEntProp(explode, Prop_Data, "m_iMagnitude", damage);
    SetEntProp(explode, Prop_Data, "m_iRadiusOverride", radius);

    TeleportEntity(explode, pos, NULL_VECTOR, NULL_VECTOR);
    DispatchSpawn(explode);
    ActivateEntity(explode);
    AcceptEntityInput(explode, "Explode");
    AcceptEntityInput(explode, "Kill");
}
I already have working code for one of our races for warcraft that does something like your asking, just let me know if you need more information.

Our code auto detonates when someone steps on our stickies, although it wouldn't take much to modify it for proximity.
__________________

Last edited by El Diablo War3Evo; 12-28-2014 at 07:21.
El Diablo War3Evo is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 12-28-2014 , 20:14   Re: Detonate rocket/sticky/pipe on proximity?
Reply With Quote #7

Oooh alright.

Also 146hu is apparently the default dist for rocket/nade explosion radius.
__________________
Chdata is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode