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

[TF2] Trigger rocket explosion


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 02-19-2014 , 17:39   [TF2] Trigger rocket explosion
Reply With Quote #1

Hi guys!

I have a "tf_projectile_rocket" and I'd like to make it explode whenever I want to. It does not accept the input "explode". Furthermore I have tried to call "RocketTouch(CBaseEntity *)" where I specified the rocket itself as the collision partner. This seems to work sometimes, on all the other occasions the explosion seems to take place where the last explosion did and not where the rocket currently is.

As always I'm more than thankful for any ideas.

House
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 02-20-2014 , 07:13   Re: [TF2] Trigger rocket explosion
Reply With Quote #2

This might work for you.
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 02-20-2014 , 19:11   Re: [TF2] Trigger rocket explosion
Reply With Quote #3

Works.

Thank you Root.






PS: ROOOOOOOOOOOOOOOOOOOOOOOOOOOT
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 02-28-2014 , 19:24   Re: [TF2] Trigger rocket explosion
Reply With Quote #4

Okay, I'm going to have to take that back.
Either it never worked or it stopped working now. The rocket seems to just disappear.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 02-28-2014 , 20:28   Re: [TF2] Trigger rocket explosion
Reply With Quote #5

I tried to make something like this in my Homing Rocket plugin, but no luck :/

You always can destroy it (input "Kill" or something) and create a (fake) HL2 explosion.
__________________
Leonardo is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 02-28-2014 , 21:28   Re: [TF2] Trigger rocket explosion
Reply With Quote #6

Yeah the issue is that I'd like to keep this as simple as possible and furthermore later on identify the explosions with the rockets and with the attacker (which would be the "ownerEntity" prop).
I'd like to have/find some kind of unused prop actually intended for or which I could use to "tag" the explosion entities.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 03-01-2014 , 03:20   Re: [TF2] Trigger rocket explosion
Reply With Quote #7

AFAIK there are no netprop to explode rocket just in time. You can try this way, but its untested.
Code:
#define DELAY 3.0 #include <sdkhooks> public OnEntityCreated(entity, const String:classname[]) {     if (strncmp(classname, "tf_projectile_", 14) == 0) // Compare first 14 characters and hook projectiles only         SDKHook(entity, SDKHook_SpawnPost, OnEntitySpawned); // ... when it's just spawned } public OnEntitySpawned(entity) {     SetEntProp(entity, Prop_Data, "m_nNextThinkTick", -1); // It will block grenades exploding for demoman. May also help with rocket projectiles     CreateTimer(DELAY, Timer_ExplodeProjectile, EntIndexToEntRef(entity), TIMER_FLAG_NO_MAPCHANGE); } public Action:Timer_ExplodeProjectile(Handle:timer, any:ref) {     new entity  = EntRefToEntIndex(ref)     if (entity != INVALID_ENT_REFERENCE)     {         SetEntProp(entity, Prop_Data, "m_nNextThinkTick", 1); // this will trigger demoman grenades to be exploded just now         SetEntProp(entity, Prop_Data, "m_takedamage", 2);         SetEntProp(entity, Prop_Data, "m_iHealth", 1);         SDKHooks_TakeDamage(entity, 0, 0, 1.0);     } }
Otherwise you have to teleport breakable entity at the rocket position.
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 03-01-2014 , 14:49   Re: [TF2] Trigger rocket explosion
Reply With Quote #8

May I ask why this should work particularly?
From what I can see, all you do is disable the rocket's "cronjobbed" logic.

So far I am fine with creating explosions by myself. The issue I am having with the "solution" is that I am looking for a prop I can use to "tag" the explosions to the rocket's entity, so I can identify what caused the kill without having to have a global adt-array to store and link the entities together.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 03-01-2014 at 14:51.
Dr. Greg House is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 03-02-2014 , 02:47   Re: [TF2] Trigger rocket explosion
Reply With Quote #9

Quote:
Originally Posted by Dr. Greg House View Post
So far I am fine with creating explosions by myself. The issue I am having with the "solution" is that I am looking for a prop I can use to "tag" the explosions to the rocket's entity, so I can identify what caused the kill without having to have a global adt-array to store and link the entities together.
You mean like setting the env_explosion's m_hOwnerEntity datamap? (oh, and dispatching the TeamNum key)

Although that's more for setting the player rather the rocket.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 03-02-2014 at 03:05.
Powerlord is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 03-02-2014 , 03:46   Re: [TF2] Trigger rocket explosion
Reply With Quote #10

Quote:
Originally Posted by Dr. Greg House View Post
Yeah the issue is that I'd like to keep this as simple as possible and furthermore later on identify the explosions with the rockets and with the attacker (which would be the "ownerEntity" prop).
I'd like to have/find some kind of unused prop actually intended for or which I could use to "tag" the explosion entities.
AHEM.

:p

And yes.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 03-02-2014 at 04:00.
Dr. Greg House 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 03:41.


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