View unanswered posts | View active topics It is currently Tue Apr 16, 2024 7:38 pm



Reply to topic  [ 8 posts ] 
 changing picture with lua for an instance 
Author Message

Joined: Sun Aug 07, 2011 3:09 am
Posts: 18
Reply with quote
Post changing picture with lua for an instance
im 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
Profile
User avatar

Joined: Wed Feb 17, 2010 12:07 am
Posts: 1545
Location: That small peaceful place called Hell.
Reply with quote
Post Re: changing picture with lua for an instance
Changing 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
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: changing picture with lua for an instance
I 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
Profile
User avatar

Joined: Wed Feb 17, 2010 12:07 am
Posts: 1545
Location: That small peaceful place called Hell.
Reply with quote
Post Re: changing picture with lua for an instance
The 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
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: changing picture with lua for an instance
You 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
Profile WWW

Joined: Sun Aug 07, 2011 3:09 am
Posts: 18
Reply with quote
Post Re: changing picture with lua for an instance
and 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
Profile
User avatar

Joined: Tue Nov 17, 2009 7:38 pm
Posts: 909
Location: France
Reply with quote
Post Re: changing picture with lua for an instance
You 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
Profile

Joined: Sun Aug 07, 2011 3:09 am
Posts: 18
Reply with quote
Post Re: changing picture with lua for an instance
aaaah ty


Mon Aug 08, 2011 2:57 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.044s | 17 Queries | GZIP : Off ]