View unanswered posts | View active topics It is currently Tue Oct 01, 2024 11:10 pm



Reply to topic  [ 4 posts ] 
 Attachable Guns 
Author Message
User avatar

Joined: Sat May 02, 2009 4:52 am
Posts: 254
Reply with quote
Post 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.


Sat Dec 05, 2009 4:24 am
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post 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.


Sat Dec 05, 2009 6:00 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post 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.


Mon Dec 07, 2009 7:27 am
Profile WWW
User avatar

Joined: Thu Aug 06, 2009 8:34 pm
Posts: 143
Reply with quote
Post Re: Attachable Guns
You have to make an MOSRotating and create and update its position in lua. That way you can also aim.


Thu Dec 10, 2009 1:51 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 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.052s | 15 Queries | GZIP : Off ]