AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2] Increase Demoman Pipe Bomb's Detonation Time? (https://forums.alliedmods.net/showthread.php?t=248142)

Splerp 09-13-2014 10:49

[TF2] Increase Demoman Pipe Bomb's Detonation Time?
 
Hello again,

I'm trying to create a Demoman's pipe bomb for pyros to airblast around. Everything is working fine, but is there a way to change how quickly the grenade explodes? I was hoping to either "reset" the countdown for detonation when it gets airblasted, or just disable detonation until it hits the ground (where it would immediately explode).

Is it also possible to make the grenade "spin" when it gets spawned (Like when the grenade launcher shoots one; see here at 00:30 for what I mean)?

As usual, thanks for any help you can provide.


Spawning method (condensed code, so might not be completely accurate)
Spoiler

floube 09-13-2014 18:17

Re: [TF2] Increase Demoman Pipe Bomb's Detonation Time?
 
Have you tried to set m_flDetonateTime?

I guess, rotation would work by setting the pipes angles every frame probably.

friagram 09-13-2014 18:22

Re: [TF2] Increase Demoman Pipe Bomb's Detonation Time?
 
Gross, you could set it's angular rotation...
Probably requires an sdkcall though.

Splerp 09-13-2014 19:58

Re: [TF2] Increase Demoman Pipe Bomb's Detonation Time?
 
Quote:

Originally Posted by floube (Post 2198238)
Have you tried to set m_flDetonateTime?

I guess, rotation would work by setting the pipes angles every frame probably.

I tried just now and it didn't have any effect. Here's another thread where someone else had the same problem: https://forums.alliedmods.net/showthread.php?t=175889
I might change the angles every frame if I can't find another solution.

Quote:

Originally Posted by friagram (Post 2198240)
Gross, you could set it's angular rotation...
Probably requires an sdkcall though.

There's a "m_vecAngVelocity" data property for tf_projectile_pipe, but setting it didn't seem to have any effect.

Looking in the datamaps dump file, there's one entry that looks like this:
Code:

- CBaseGrenadeTumbleThink (FunctionTable)(0 Bytes)
Will I need to follow through this process to be able to use it? (Finding Virtual Offsets)

Splerp 09-21-2014 04:09

Re: [TF2] Increase Demoman Pipe Bomb's Detonation Time?
 
Hi everyone,

I've been trying to work out how to increase the pipebomb detonation time but have had no luck so far. I blundered through DHooks, finding offsets, and signature scanning but I'm feeling completely lost. Is anyone able to point me in the right direction?


I used the method outlined here (and here) and found some functions that looked promising:
PHP Code:

CTFWeaponBaseGrenadeProj::SetDetonateTimerLength(float)
CTFWeaponBaseGrenadeProj::ShouldNotDetonate(void)
CTFGrenadeLauncher::ResetDetonateTime(void

But none of them link to a vtable, so normal offsets can't be used? Is there another way I can access them?

WildCard65 09-21-2014 13:31

Re: [TF2] Increase Demoman Pipe Bomb's Detonation Time?
 
Quote:

Originally Posted by Splerp (Post 2201875)
Hi everyone,

I've been trying to work out how to increase the pipebomb detonation time but have had no luck so far. I blundered through DHooks, finding offsets, and signature scanning but I'm feeling completely lost. Is anyone able to point me in the right direction?


I used the method outlined here (and here) and found some functions that looked promising:
PHP Code:

CTFWeaponBaseGrenadeProj::SetDetonateTimerLength(float)
CTFWeaponBaseGrenadeProj::ShouldNotDetonate(void)
CTFGrenadeLauncher::ResetDetonateTime(void

But none of them link to a vtable, so normal offsets can't be used? Is there another way I can access them?

I think you would need an extension to detour the calls... IDK

Splerp 12-03-2014 22:55

Re: [TF2] Increase Demoman Pipe Bomb's Detonation Time?
 
Hi again, sorry for reviving an old thread but since it's related to the same problem I thought I'd bring this one up again.

This past week I've reattempted this and have been trying to create an extension (using Asherkin's Dodgeball extension and cutting it back) which sets the pipebomb detonation time limit using SetDetonateTimerLength(). The problem I think I'm having is finding the correct signature for that function - the part that looks like "\x55\x8B\xEC\x8B\x45\x08\x8D\x50\xFF\x83\xFA \x09". This is the text I have:

PHP Code:

...
"Signatures"
{
    ...
    
"SetDetonateTimerLength"
    
{
        
"library"               "server"
        "windows"               "\x01\x89\xE5\xF3\x0F\x10\x45\x0C\xF3\x0F\x58\x40\x0C\x8B\x45\x08\xF3\x0F\x11\x80\xE0\x04\x00\x00\x4D\xC3"
        "linux"                 "@_ZN24CTFWeaponBaseGrenadeProj22SetDetonateTimerLengthEf"
    
}


When I run the server (on windows), I get this error:
Code:

Sigscan for SetDetonateTimerLength failed - Disabling detour to prevent crashes
Does anyone know how I can get the correct signature for this function, or if that error means I've done something wrong elsewhere? I've tried following this process: https://wiki.alliedmods.net/Signature_scanning but got super lost.

Are there any places I can go for more information about creating extensions in general aside from this page?

Michalplyoutube 12-04-2014 06:37

Re: [TF2] Increase Demoman Pipe Bomb's Detonation Time?
 
Why not just use sticky arm time bonus and make it -1 so it will be longer to arm

WildCard65 12-04-2014 09:23

Re: [TF2] Increase Demoman Pipe Bomb's Detonation Time?
 
Quote:

Originally Posted by Michalplyoutube (Post 2231055)
Why not just use sticky arm time bonus and make it -1 so it will be longer to arm

There is: sticky arm time penalty

Root_ 12-04-2014 10:21

Re: [TF2] Increase Demoman Pipe Bomb's Detonation Time?
 
You may want to try something I created for DoD:S.
As far as I know you can prevent grenades from detonating using something like that.
Code:
#include <sdkhooks> public OnEntityCreated(entity, const String:classname[]) {     // When molotov in CS:GO have been thrown     if (StrEqual(classname, "molotov_projectile", false))     {         // You wont deal with molotov projectile after its just created         CreateTimer(0.1, Timer_OnMolotovCreated, EntIndexToEntRef(entity), TIMER_FLAG_NO_MAPCHANGE)     } } public Action:Timer_OnMolotovCreated(Handle:timer, any:ref) {     // Why timer? Because entity may be created but not spawned yet     new molotov  = EntRefToEntIndex(ref)     if (molotov != INVALID_ENT_REFERENCE)     {         // Set think to -1 to prevent molotov from exploding in air         SetEntProp(molotov, Prop_Data, "m_nNextThinkTick", -1)     } } ... public MyFunc() {     // I think setting NextThinkTick wont do anything, but let it be     SetEntProp(molotov, Prop_Data, "m_nNextThinkTick", 1)     // When you 'damage' its projectile, its exploding!     // forums.alliedmods.net/showthread.php?p=1985693#post1985693     SetEntProp(molotov, Prop_Data, "m_takedamage", 2)     SetEntProp(molotov, Prop_Data, "m_iHealth", 1)     SDKHooks_TakeDamage(molotov, 0, 0, 1.0) }


All times are GMT -4. The time now is 12:07.

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