View unanswered posts | View active topics It is currently Thu Mar 28, 2024 10:12 pm



Reply to topic  [ 6 posts ] 
 Actor specific infinite ammo? 
Author Message
User avatar

Joined: Sun Sep 17, 2017 11:17 pm
Posts: 35
Reply with quote
Post 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!


Wed Feb 21, 2018 9:13 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post 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.


Wed Feb 21, 2018 11:58 pm
Profile
User avatar

Joined: Sun Sep 17, 2017 11:17 pm
Posts: 35
Reply with quote
Post 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.


Thu Feb 22, 2018 12:12 am
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post 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.


Thu Feb 22, 2018 5:28 pm
Profile
User avatar

Joined: Sun Sep 17, 2017 11:17 pm
Posts: 35
Reply with quote
Post 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.


Thu Feb 22, 2018 9:04 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13143
Location: Here
Reply with quote
Post 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.


Sat Feb 24, 2018 5:49 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.057s | 17 Queries | GZIP : Off ]