Data Realms Fan Forums
http://45.55.195.193/

Need help on attachment + Lua.
http://45.55.195.193/viewtopic.php?f=73&t=17911
Page 1 of 1

Author:  adasx10 [ Mon Feb 22, 2010 9:49 am ]
Post subject:  Need help on attachment + Lua.

Can an attachment increase "SharpLength" or change firing sound and when destroyed change back to normal, like a silencer or a scope.

Author:  Lizardheim [ Mon Feb 22, 2010 4:11 pm ]
Post subject:  Re: Need help on attachment + Lua.

You could play a sound when the round is spawned through Lua i think.

Author:  Azukki [ Thu Feb 25, 2010 7:00 am ]
Post subject:  Re: Need help on attachment + Lua.

Pretty sure it'd be simplest for you to make a separate near-duplicate weapon with the alterations you want instead of messing with attachables.
Tell a little more about the premise of the need of attaching suppressors or whatever?

Author:  adasx10 [ Thu Feb 25, 2010 11:37 am ]
Post subject:  Re: Need help on attachment + Lua.

Azukki wrote:
Pretty sure it'd be simplest for you to make a separate near-duplicate weapon with the alterations you want instead of messing with attachables.
Tell a little more about the premise of the need of attaching suppressors or whatever?


I need a sniper scope attachment that increase the "SharpLength" of a gun, and when destroyed change back. I really don't know how to explain it in detail.

Author:  Mind [ Thu Feb 25, 2010 11:29 pm ]
Post subject:  Re: Need help on attachment + Lua.

Cave would be good at this, but what you should do is make it so when the actor goes to like gold dig mode, it destroys gun w/o scope, and makes a copy of the current gun except with the gun and inverse when u do gold dig again.

Edit: Cuz unfortunately you can't actually change the sharplength value of a gun. D:

Author:  Azukki [ Fri Feb 26, 2010 6:55 am ]
Post subject:  Re: Need help on attachment + Lua.

Ohhh.
You want your gun's scope to be able to break off, that's why you want an attachable.
Now it seems really stupid that I didn't understand before. I thought you wanted to add the attachable during gameplay or something like that.

Anyways, you could make the scope an attachable, and then give the scope a custom break wound, and then an emission of that wound could activate a script that swaps out the gun for another version of the gun with no scope attached, and less sharp length.

Pretty sure that will work, but I'm certain it won't be easy.

You'll reload when your scope is shot off, unfortunately.

I can do the .ini for you but I can't do the Lua to replace the gun when it's in an actor's inventory.



If you don't mind if the scope can be shot off by shooting anywhere on the weapon, and the actor dropping the weapon when it breaks, then this can be done very easily in .ini modding.

Author:  411570N3 [ Fri Feb 26, 2010 7:10 am ]
Post subject:  Re: Need help on attachment + Lua.

Could you make a script that checks if the correct object has gibbed nearby recently and automatically reload based on that? Since you only need it to automatically reload when freshly gibbed and on the ground, you could run the script directly on the gun.

Author:  Azukki [ Sat Feb 27, 2010 7:15 am ]
Post subject:  Re: Need help on attachment + Lua.

Uhhh, that would be kind of complex, dunno how you would go about that exactly. Might be possible.

I know that if you did the Lua route I mentioned (which would likely be easier than the Lua you just suggested) of switching weapons in an actor's inventory, you could force him to reload afterward easily enough, and/or drop the weapon, if you want to do that.
With that dual mode template out there, swapping an actor's weapons would mostly just be a case of applying that script from a third party object. (the emission particle with the script, as I said)

I might be able to do it but I might not bother trying.

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