| Author | 
            Message | 
        
        
			| 
				
				 Munchkin9 
				
				
					 Joined: Wed Feb 14, 2007 4:56 am Posts: 43
				 
				 
			 | 
			
				
				  Weapon fire mode  
					
						Don't know if this has been talked about before since it is rather hard to search for and I am pressed for time.
  But would it be possible to attach (or whatever) a lua script to a weapon which would allow it to have different modes of firing (semi,auto etc) one possible way to do this would be to, at the press of a button, remove the currently held gun and replace it with a different one that looks the same but fires slightly differently. I can not try this out by cause of my pitiful lua skills but I was hoping someone more experienced might be able to give it a look.
  -Munchkin 
					
  
			 | 
		
		
			| Sun Aug 09, 2009 7:50 pm | 
			
				
					 
					
					 
				    
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Disst 
				
				
					 Joined: Thu Feb 12, 2009 1:47 am Posts: 1182
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						viewtopic.php?f=61&t=14644The assault rifle has a grenade launcher, if that's what you want.  
					
  
			 | 
		
		
			| Sun Aug 09, 2009 8:02 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Munchkin9 
				
				
					 Joined: Wed Feb 14, 2007 4:56 am Posts: 43
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						not to bad, but I was thinking more of a toggle change, you press the button once and it changes to semi, you press it again and it turns back to auto (or whatever, more accurately what i would like to do with this involves completely changing the type of shot fired not just the rate). 
					
  
			 | 
		
		
			| Sun Aug 09, 2009 9:04 pm | 
			
				
					 
					
					 
				    
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 mail2345 
				
				
					 Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						Add  a second global list to track state and add some toggle code, then done. 
					
  
			 | 
		
		
			| Sun Aug 09, 2009 11:25 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Munchkin9 
				
				
					 Joined: Wed Feb 14, 2007 4:56 am Posts: 43
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						 read the first post mate my lua is "pitiful"  I can't do that. I was hoping someone might be able to give me enough to go on to make myself (I am a quick learner but I don't really want to learn lua, I need enough space in my hard drive of a brain to remember my python...the coding language not the snake)  
					
  
			 | 
		
		
			| Mon Aug 10, 2009 12:12 am | 
			
				
					 
					
					 
				    
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Spiritlol 
				
				
					 Joined: Mon Mar 23, 2009 6:24 am Posts: 8
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						Couldn't you make 2 weapons, each with a different firemode, then on the purchase of the gun, you get 2 weapons, one with per say auto and the other semi. That way you switch weapons to "toggle" the mode. I know its not exactly what you mean but it can be done without lua. 
					
  
			 | 
		
		
			| Tue Aug 11, 2009 10:39 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Munchkin9 
				
				
					 Joined: Wed Feb 14, 2007 4:56 am Posts: 43
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						There are many problems with this method: Double the cost, double the weight, and, most importantly, this adds one more weapon which you need to switch between when trying to change to say grenades or something. It adds a lot of trouble. Doing it by lua would avoid this problem. 
					
  
			 | 
		
		
			| Tue Aug 11, 2009 10:53 pm | 
			
				
					 
					
					 
				    
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Spiritlol 
				
				
					 Joined: Mon Mar 23, 2009 6:24 am Posts: 8
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						True it does add more weapons to switch through, but you can make the 2nd rate cost 0, and weight 0. 
					
  
			 | 
		
		
			| Tue Aug 11, 2009 11:05 pm | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Ramma 
				
				
					 Joined: Sat Aug 23, 2008 3:48 pm Posts: 48
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						Except the second gun would have it's own ammo count. 
					
  
			 | 
		
		
			| Wed Aug 12, 2009 1:09 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Geti 
				
				
					 Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						[quote="Munchkin9"]read the first post mate my lua is "pitiful"  I can't do that.[quote] well, nothing of the nature of what you want can be acomplished without scripting. 
					
  
			 | 
		
		
			| Wed Aug 12, 2009 1:11 am | 
			
				
					 
					
					 
				    
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 robolee 
				
				
					 Joined: Fri May 11, 2007 4:30 pm Posts: 1040 Location: England
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						pffft come on you guys, make the gun shoot a mosrot called "tempshot" or whatever, add an luascript to the gun that makes "tempshot" 'turn into' the shot you want (copy velocity, rotation, position to the new round and remove "tempshot" from the scene), default it to mode 1 and when a button is released change to mode 2, when button released again go back to mode 1. 
					
  
			 | 
		
		
			| Wed Aug 12, 2009 1:18 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 mail2345 
				
				
					 Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						3POK_PHALE wrote: http://www.datarealms.com/forum/viewtopic.php?f=61&t=14644
  The assault rifle has a grenade launcher, if that's what you want. Wadda think I did?  
					
  
			 | 
		
		
			| Wed Aug 12, 2009 5:18 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Disst 
				
				
					 Joined: Thu Feb 12, 2009 1:47 am Posts: 1182
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						I think you probably mapped a key to fire an AEmitter that emits an MOSR explosive. Too lazy to look at the code right now, so I'm simply speculating. 
					
  
			 | 
		
		
			| Wed Aug 12, 2009 5:22 am | 
			
				
					 
					
					 
				  
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 411570N3 
				
				
					 Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						Nope. He did exactly what robolee did except it becam a grenade when crouching. 
					
  
			 | 
		
		
			| Wed Aug 12, 2009 8:10 am | 
			
				
					 
					
					 
				    
			 | 
    	
		
	
	
		  | 
	
	
			| 
				
				 Munchkin9 
				
				
					 Joined: Wed Feb 14, 2007 4:56 am Posts: 43
				 
				 
			 | 
			
				
				  Re: Weapon fire mode  
					
						Am still looking for toggable Quote: well, nothing of the nature of what you want can be accomplished without scripting. I am well aware of that which is why I was hoping someone would be interesting of creating a sort of base script of this or implement it into a weapon which I could then look at (with their permission) and use. Need I mention fame and fortune that would come from this     ?  
					
  
			 | 
		
		
			| Wed Aug 12, 2009 4:37 pm | 
			
				
					 
					
					 
				    
			 | 
    	
		
	
	
		  | 
	
	
	
		 |