Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » PowerupGameObj::Grant() and C4GameObj::Detonate()
PowerupGameObj::Grant() and C4GameObj::Detonate() [message #470397] Sun, 01 July 2012 03:57 Go to next message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
After talking to StealthEye he told me that ::Grant() isn't jump hooked to the FDS' function, instead the function calling them being replaced completely (::Think() for both IIRC), and it seems to be the same for C4GameObj::Detonate().

Could a jump hook for the FDS' original functions for these replacements be added, so I can grab the address of 4.0's replacement functions in memory by checking the JMP at the start of the original functions?

PowerupGameObj::Grant() is at 0x006F1100
and C4GameObj::Detonate() is at 0x0070BE90

I'm not sure if the 4.0 replacement functions are called in 4.0's replacement ::Think().


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #470398 is a reply to message #470397] Sun, 01 July 2012 04:05 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
BTW these functions also aren't call-able from an SSGM plugin.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Sun, 01 July 2012 04:08]

Report message to a moderator

Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #470535 is a reply to message #470397] Mon, 02 July 2012 10:23 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
bump

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #470543 is a reply to message #470397] Mon, 02 July 2012 11:25 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

It's on the bug tracker.

BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #470606 is a reply to message #470397] Tue, 03 July 2012 00:42 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
Does the TT replacement of PowerupGameObj::Think() call PowerupGameObj::Grant()? As I think actually granting can also be done with PowerupGameObjDef::Grant(), but I'm not sure.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #470614 is a reply to message #470397] Tue, 03 July 2012 03:54 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3556
Registered: February 2003
Karma: 0
General (3 Stars)

I can confirm that both PowerUpGameObj::Think and PowerUpGameObj::Grant are (or should be baring bugs) 100% identical to the stock functions.

PowerUpGameObj::Grant does something like this:
Get_Definition().Grant( obj, this );

if ( WeaponBag != NULL )
if ( obj->Get_Weapon_Bag()->Move_Contents( WeaponBag ) )
Set_State( PowerUpGameObj::STATE_GRANTING );

if ( State == STATE_GRANTING )
Send CUSTOM_EVENT_POWERUP_GRANTED to all scripts on the PowerUpGameObj

Note that this is the only place in the stock code that I can find that sends CUSTOM_EVENT_POWERUP_GRANTED


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #470616 is a reply to message #470397] Tue, 03 July 2012 04:26 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
Okay, thanks that'll mean I can write a blockable powerup grant hook when a future version of 4.0 gets released.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #471681 is a reply to message #470397] Sat, 14 July 2012 07:55 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3556
Registered: February 2003
Karma: 0
General (3 Stars)

ok, C4GameObj::Detonate has been hooked for the next release.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #471721 is a reply to message #470397] Sun, 15 July 2012 01:21 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
And the other one?

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #471723 is a reply to message #470397] Sun, 15 July 2012 02:02 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3556
Registered: February 2003
Karma: 0
General (3 Stars)

Given what you said about PowerUpGameObjDef::Grant, I didn't think there was a need for PowerUpGameObj::Grant


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #471724 is a reply to message #470397] Sun, 15 July 2012 02:11 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
Well I'm not sure which of those functions gets called when a player picks up a PowerupGameObj, I know the original Think() function calls PowerupGameObj::Grant() though. From your earlier reply stating that Grant() sends the 'powerup picked up' custom, it should that's the function that should be called.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Sun, 15 July 2012 02:14]

Report message to a moderator

Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #471725 is a reply to message #470397] Sun, 15 July 2012 03:59 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3556
Registered: February 2003
Karma: 0
General (3 Stars)

ok, hooked PowerUpGameObj::Grant.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: PowerupGameObj::Grant() and C4GameObj::Detonate() [message #471726 is a reply to message #470397] Sun, 15 July 2012 04:06 Go to previous message
iRANian is currently offline  iRANian
Messages: 4300
Registered: April 2011
Karma: 0
General (4 Stars)
Thanks a bunch I really appreciate it.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Previous Topic: fps drop
Next Topic: CommandLineParser::getInt() doesn't work with negative integers
Goto Forum:
  


Current Time: Mon Jul 15 20:54:41 MST 2024

Total time taken to generate the page: 0.00842 seconds