Data Realms Fan Forums
http://868000.nnhp.asia/

Actor specific infinite ammo?
http://868000.nnhp.asia/viewtopic.php?f=1&t=46250
Page 1 of 1

Author:  gridbull [ Wed Feb 21, 2018 9:13 pm ]
Post subject:  Actor specific infinite ammo?

Is it possIble to make a gun unreloadable unless being used by a specific actor? And when that actor uses it, the gun gets infinite ammo. (fed from an ammo box on his back)
I know it will undoubtedly involve lua, I just can't find an example of it ever being done before.

Thanks in advance!

Author:  CaveCricket48 [ Wed Feb 21, 2018 11:58 pm ]
Post subject:  Re: Actor specific infinite ammo?




I don't think you can make a gun unreloadable, but you can give the gun a script that constantly deletes new magazines after the first one is spent. Then, stop deleting them when the gun is used by the correct actor (check its PresetName).

-1 RoundCount on magazines is used to give them infinite ammo, but I believe there might've been issues with changing RoundCount from infinite to finite, or vice versa. I don't remember, something to test.

Author:  gridbull [ Thu Feb 22, 2018 12:12 am ]
Post subject:  Re: Actor specific infinite ammo?

Sounds good, I'll write something up and test it out, then post the results here. Thanks for the advice, as always.

Author:  Bad Boy [ Thu Feb 22, 2018 5:28 pm ]
Post subject:  Re: Actor specific infinite ammo?

CaveCricket48 wrote:
I don't think you can make a gun unreloadable, but you can give the gun a script that constantly deletes new magazines after the first one is spent. Then, stop deleting them when the gun is used by the correct actor (check its PresetName).
You might also be able to constantly set the actor's control state reloading to false, though I seem to recall issues trying to force some states (such as movement) off from items rather than from the actor whose state is being set.

Author:  gridbull [ Thu Feb 22, 2018 9:04 pm ]
Post subject:  Re: Actor specific infinite ammo?

I wonder, is it a better idea to put the script in the actor instead of he gun, and set the gun's innate ammo max to zero.

Author:  CaveCricket48 [ Sat Feb 24, 2018 5:49 am ]
Post subject:  Re: Actor specific infinite ammo?

Probably doesn't matter too much what the script is attached to.

Also testing out what Bad Boy mentioned could simplify some things if you can prevent the reloading action.

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