Data Realms Fan Forums
http://45.55.195.193/

Pie menu & Shotgun reloads
http://45.55.195.193/viewtopic.php?f=73&t=31253
Page 1 of 1

Author:  alexglitch [ Sat Jun 16, 2012 6:58 am ]
Post subject:  Pie menu & Shotgun reloads

So I was trying to make a shotgun that uses the reload script and have multiple types of ammo via the pie menu. Now this is where things go wrong: the gun keeps reloading round past the mag capacity, which is out of the range and cause an infinite reloading action, unless halted by shooting the gun.

Now since I'm still a complete noob at LUA, can somebody please tweak either the pie menu script, or the reload script (preferably the pie menu) so that every time the shotgun changes its ammo type, you have to dump the ammo and start reloading from the beginning? (just like cocking out the old shells and start loading new shells). Thanks in advance!

Author:  CaveCricket48 [ Mon Jun 18, 2012 3:36 am ]
Post subject:  Re: Pie menu & Shotgun reloads

Which scripts are we talking about here?

Author:  alexglitch [ Mon Jun 18, 2012 11:55 am ]
Post subject:  Re: Pie menu & Shotgun reloads

Using Base.rte/Scripts/ShotgunReload.lua along with the PieMenu script copied from the Coalition Rocket Launcher, with the respective magazines changed, of course.

The bug comes when you have full ammo and you want to change the ammo type, which causes the shotgun to reload infinitely until triggered. The result is a bigger-than-normal mag and a chance of blowing your pc up if you let it happen continously (maybe not that bad).

In my opinion, maybe you guys should add something like "gun.IsEmpty() = true;" in the PieMenu script before the "gun:reload();", but I tried that and it didn't work, so I have to ask you guys how to do it because I'm still a lua illiterate.

Author:  MrC121989 [ Sun Dec 09, 2012 7:34 pm ]
Post subject:  Re: Pie menu & Shotgun reloads

Yep i'm having the same problem with more or less the same script.
Here it is:

Attachments:
Script.lua [1.44 KiB]
Downloaded 388 times

Author:  CaveCricket48 [ Sun Dec 09, 2012 8:16 pm ]
Post subject:  Re: Pie menu & Shotgun reloads

This explains the issue and has the solution.

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