View unanswered posts | View active topics It is currently Thu Dec 26, 2024 3:57 am



Reply to topic  [ 5 posts ] 
 Pie menu & Shotgun reloads 
Author Message
User avatar

Joined: Mon Feb 07, 2011 5:06 am
Posts: 23
Reply with quote
Post 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!


Sat Jun 16, 2012 6:58 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Pie menu & Shotgun reloads
Which scripts are we talking about here?


Mon Jun 18, 2012 3:36 am
Profile
User avatar

Joined: Mon Feb 07, 2011 5:06 am
Posts: 23
Reply with quote
Post 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.


Mon Jun 18, 2012 11:55 am
Profile
User avatar

Joined: Wed Feb 10, 2010 12:41 pm
Posts: 182
Location: OMG where am i ?
Reply with quote
Post 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
Sun Dec 09, 2012 7:34 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Pie menu & Shotgun reloads
This explains the issue and has the solution.


Sun Dec 09, 2012 8:16 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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.045s | 14 Queries | GZIP : Off ]