|  | 
	| FAQ
		 • Search • Login | 
	| 
 
 
 
	
	
		
			|   | Page 1 of 1 
 | [ 5 posts ] |  |   Pie menu & Shotgun reloads 
        
        
            | Author | Message |  
			| alexglitch 
					Joined: Mon Feb 07, 2011 5:06 am
 Posts: 23
   |   Pie menu & Shotgun reloadsSo 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 | 
					
					   |  
		|  |  
			| CaveCricket48 
					Joined: Tue Jun 12, 2007 11:52 pm
 Posts: 13144
 Location: Here
   |   Re: Pie menu & Shotgun reloadsWhich scripts are we talking about here? 
 
 |  
			| Mon Jun 18, 2012 3:36 am | 
					
					   |  
		|  |  
			| alexglitch 
					Joined: Mon Feb 07, 2011 5:06 am
 Posts: 23
   |   Re: Pie menu & Shotgun reloadsUsing 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 | 
					
					   |  
		|  |  
			| MrC121989 
					Joined: Wed Feb 10, 2010 12:41 pm
 Posts: 182
 Location: OMG where am i ?
   |   Re: Pie menu & Shotgun reloadsYep i'm having the same problem with more or less the same script.Here it is:
 
 
 Attachments: 
			
				 Script.lua [1.44 KiB]
			
			Downloaded 529 times |  
			| Sun Dec 09, 2012 7:34 pm | 
					
					   |  
		|  |  
			| CaveCricket48 
					Joined: Tue Jun 12, 2007 11:52 pm
 Posts: 13144
 Location: Here
   |   Re: Pie menu & Shotgun reloadsThis explains the issue and has the solution. 
 
 |  
			| Sun Dec 09, 2012 8:16 pm | 
					
					   |  
		|  |  
		|  |  
	
		
			|   | Page 1 of 1 
 | [ 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
 
 |  
   |