| Author | Message | 
        
			| Themanaic 
					Joined: Sun Aug 07, 2011 3:09 am
 Posts: 18
   |   changing picture with lua for an instanceim trying to say is that i have 0 ammo for a weapon, can i have the picture change? i don't want it to be reloading yet though. 
 
 | 
		
			| Sun Aug 07, 2011 9:24 am | 
					
					   | 
	
	
		|  | 
	
			| Coops 
					Joined: Wed Feb 17, 2010 12:07 am
 Posts: 1545
 Location: That small peaceful place called Hell.
   |   Re: changing picture with lua for an instanceChanging the frame of a weapon seems impossible as far as I'm concerned (Or maybe I haven't tried enough). Although what you can do is make an attachable and attach it to the weapon with lua and you can change the frame of that instead of the weapon. There are also sprite animation modes for HDFirearms via ini. I dont know if they can do what your looking for though. Code: SpriteAnimMode
 0 = NOANIM
 1 = ALWAYSLOOP
 2 = ALWAYSRANDOM
 3 = ALWAYSPINGPONG
 4 = LOOPWHENMOVING
 5 = LOOPWHENOPENCLOSE
 6 = PINGPONGOPENCLOSE
 
You can try each one and see if they do what you want. If they don't then you can try my method.
 
 | 
		
			| Sun Aug 07, 2011 4:52 pm | 
					
					   | 
	
	
		|  | 
	
			| Grif REAL AMERICAN HERO 
					Joined: Sat Jan 27, 2007 10:25 pm
 Posts: 5655
   |   Re: changing picture with lua for an instanceI think that HDFirearms are very specifically hardcoded to only use frames 000 and 001. Specifically, 000 at all times except when firing, and 001 when firing. The only exception is weapons with .ini spinup.
 That said, as Coops pointed out, making the actual weapon invisible and adding an attachable with the weapon's sprite is probably your best bet.
 
 
 | 
		
			| Sun Aug 07, 2011 10:56 pm | 
					
					   | 
	
	
		|  | 
	
			| Coops 
					Joined: Wed Feb 17, 2010 12:07 am
 Posts: 1545
 Location: That small peaceful place called Hell.
   |   Re: changing picture with lua for an instanceThe problem with that though is the weapon will show up behind the actor holding the weapon.
 A work around to that is to just attach it to the weapon in INI and find the attachable in lua and change it from there.
 
 
 | 
		
			| Sun Aug 07, 2011 10:58 pm | 
					
					   | 
	
	
		|  | 
	
			| TheLastBanana DRL Developer 
					Joined: Wed Dec 13, 2006 5:27 am
 Posts: 3138
 Location: A little south and a lot west of Moscow
   |   Re: changing picture with lua for an instanceYou can force an object's frame in Lua (MOSprite.Frame). I don't know if the hardcoding will override it, though. 
 
 | 
		
			| Sun Aug 07, 2011 11:27 pm | 
					
					     | 
	
	
		|  | 
	
			| Themanaic 
					Joined: Sun Aug 07, 2011 3:09 am
 Posts: 18
   |   Re: changing picture with lua for an instanceand im am sorry but i don't know lua and wish for coding in which to change the frame.
 trying to make the rocket on the end of a RPG disappear when there is no ammo in the clip of one,  i know i an make the rocket into  null on the end but when there is no ammo or reloading then i want just space
 
 
 | 
		
			| Mon Aug 08, 2011 1:44 am | 
					
					   | 
	
	
		|  | 
	
			| Mehman 
					Joined: Tue Nov 17, 2009 7:38 pm
 Posts: 909
 Location: France
   |   Re: changing picture with lua for an instanceYou don't need lua for that, make the magazine have the sprite of the rocket, the proper offset and Discardable = 0 (or 1 I don't remember), this way it will dissapear when it is fired and will reappear when fully reloaded. 
 
 | 
		
			| Mon Aug 08, 2011 2:00 am | 
					
					   | 
	
	
		|  | 
	
			| Themanaic 
					Joined: Sun Aug 07, 2011 3:09 am
 Posts: 18
   |   Re: changing picture with lua for an instanceaaaah ty 
 
 | 
		
			| Mon Aug 08, 2011 2:57 pm | 
					
					   | 
	
	
		|  | 
	
	
		|  |