Data Realms Fan Forums
http://forums.datarealms.com/

changing picture with lua for an instance
http://forums.datarealms.com/viewtopic.php?f=73&t=25012
Page 1 of 1

Author:  Themanaic [ Sun Aug 07, 2011 9:24 am ]
Post subject:  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.

Author:  Coops [ Sun Aug 07, 2011 4:52 pm ]
Post subject:  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.

Author:  Grif [ Sun Aug 07, 2011 10:56 pm ]
Post subject:  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.

Author:  Coops [ Sun Aug 07, 2011 10:58 pm ]
Post subject:  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.

Author:  TheLastBanana [ Sun Aug 07, 2011 11:27 pm ]
Post subject:  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.

Author:  Themanaic [ Mon Aug 08, 2011 1:44 am ]
Post subject:  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

Author:  Mehman [ Mon Aug 08, 2011 2:00 am ]
Post subject:  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.

Author:  Themanaic [ Mon Aug 08, 2011 2:57 pm ]
Post subject:  Re: changing picture with lua for an instance

aaaah ty

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/