Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » hooking reload
hooking reload [message #475252] Thu, 27 September 2012 01:38 Go to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
is it possible to hook a reload (when manual or automatic)?

Owner of kambot TT server

kambot.freeforums.org
Re: hooking reload [message #475253 is a reply to message #475252] Thu, 27 September 2012 02:02 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3555
Registered: February 2003
Karma: 0
General (3 Stars)

No its not possible to hook weapon reload (not in 4.0 anyway)


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: hooking reload [message #475254 is a reply to message #475252] Thu, 27 September 2012 02:14 Go to previous messageGo to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
would it be possible to create it somehow or is it useless to do?

would be nice to be able to adjust ammo of specific weapons


Owner of kambot TT server

kambot.freeforums.org
Re: hooking reload [message #475257 is a reply to message #475252] Thu, 27 September 2012 04:34 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
Whenever I have needed to do anything scripts related based on current weapon ammo I have just used a timer that fires off very rapidly (resetting it each time it fires) and used the scripts API to check the current bullet count. It's not the most efficient thing in the world but you can detect reloads by seeing when the bullet count increases from the previous check. If the weapon doesn't fire bullets more rapidly than your timer you can also determine if it was a manual reload (previous bullet count >1) or an automatic one.

http://steamsignature.com/card/1/76561197975867233.png
Re: hooking reload [message #475364 is a reply to message #475252] Fri, 28 September 2012 00:39 Go to previous messageGo to next message
robbyke is currently offline  robbyke
Messages: 348
Registered: September 2010
Location: Belgium
Karma: 0
Recruit
that will work was just hoping there was a better way

Owner of kambot TT server

kambot.freeforums.org
Re: hooking reload [message #475376 is a reply to message #475364] Fri, 28 September 2012 05:52 Go to previous message
Jerad2142 is currently offline  Jerad2142
Messages: 3805
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
It's not a bad way by any means (yeah it would be if we had hooks but we don't), you'd have to be on a really shitty server before a timer with a delay of 0.1 looping though 127 playerIDs (1 - 127) ever has any real impact.

Previous Topic: Feel like making something
Next Topic: destroy all vehicles
Goto Forum:
  


Current Time: Sat Apr 13 09:07:18 MST 2024

Total time taken to generate the page: 0.00717 seconds