Data Realms Fan Forums
http://45.55.195.193/

Attachable Guns
http://45.55.195.193/viewtopic.php?f=1&t=17292
Page 1 of 1

Author:  Point.blank [ Sat Dec 05, 2009 4:24 am ]
Post subject:  Attachable Guns

The question I have is, how do you attach a gun to an actor (the head, to be exact), and wire it to fire when you press a key via Lua?
I think you have to make the emitter and attach it to the body part in question, but I'm stuck at the Lua bit, because I can't script for beans. Any help will be appreciated.

Author:  Grif [ Sat Dec 05, 2009 6:00 am ]
Post subject:  Re: Attachable Guns

The easiest way to attach something with lua is to not attach it at all. Some basic trigonometry can update the position relative to the head's rotation angle, and you can much more easily have an emitter fire when it's an unparented lua-created object.

Author:  411570N3 [ Mon Dec 07, 2009 7:27 am ]
Post subject:  Re: Attachable Guns

I think it's because when it's not attached you can just look for it in the tables of particles, whereas when it is you have to cycle through MOs to find it, which is apparently a bit more complicated.

Author:  Jon [ Thu Dec 10, 2009 1:51 pm ]
Post subject:  Re: Attachable Guns

You have to make an MOSRotating and create and update its position in lua. That way you can also aim.

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