Data Realms Fan Forums
http://forums.datarealms.com/

Call a function on reload
http://forums.datarealms.com/viewtopic.php?f=73&t=46000
Page 1 of 1

Author:  WobbaWoo [ Fri Oct 30, 2015 9:57 pm ]
Post subject:  Call a function on reload

I'm trying to make a weapon with magazines taped together, which makes every other reload faster. I'm not very familiar with Cortex Command's API, and the wiki isn't all that helpful. This was the best I could do, but I'm pretty sure I'm doing it wrong:

Code:
function Update(self)
   if self:IsReloading() then
      stuff
   end
end

Author:  johiah [ Fri Oct 30, 2015 10:13 pm ]
Post subject:  Re: Call a function on reload

Couldn't you just edit the reload time and clip of a gun? Or am I misunderstanding.

Author:  WobbaWoo [ Fri Oct 30, 2015 10:58 pm ]
Post subject:  Re: Call a function on reload

I want the reloading to go something like this: fast (flipping taped magazines and loading second one) - slow (both mags are empty now) - fast - slow - fast - slow, ad infinitum. If you don't understand what I mean, I'm referring to "jungle style" (taped or clipped together) magazines.

Author:  WobbaWoo [ Mon Nov 02, 2015 6:20 am ]
Post subject:  Re: Call a function on reload

Bump

Author:  Abdul Alhazred [ Tue Nov 03, 2015 9:43 am ]
Post subject:  Re: Call a function on reload

Have you tried using this function: http://wiki.datarealms.com/LuaDocs/Held ... eReloading ?

Something like this
Code:
function Update(self)
   if self:DoneReloading() then
      if self.ReloadTime >= 2000 then
        self.ReloadTime = 1000
      else
        self.ReloadTime = 2000
      end
   end
end


I have not tested this code btw.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/