View unanswered posts | View active topics It is currently Thu Jan 09, 2025 10:17 pm



Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
 Weapon fire mode 
Author Message
User avatar

Joined: Wed Feb 14, 2007 4:56 am
Posts: 43
Reply with quote
Post Weapon fire mode
Don't know if this has been talked about before since it is rather hard to search for and I am pressed for time.

But would it be possible to attach (or whatever) a lua script to a weapon which would allow it to have different modes of firing (semi,auto etc) one possible way to do this would be to, at the press of a button, remove the currently held gun and replace it with a different one that looks the same but fires slightly differently. I can not try this out by cause of my pitiful lua skills but I was hoping someone more experienced might be able to give it a look.

-Munchkin


Sun Aug 09, 2009 7:50 pm
Profile WWW
User avatar

Joined: Thu Feb 12, 2009 1:47 am
Posts: 1182
Reply with quote
Post Re: Weapon fire mode
viewtopic.php?f=61&t=14644

The assault rifle has a grenade launcher, if that's what you want.


Sun Aug 09, 2009 8:02 pm
Profile
User avatar

Joined: Wed Feb 14, 2007 4:56 am
Posts: 43
Reply with quote
Post Re: Weapon fire mode
not to bad, but I was thinking more of a toggle change, you press the button once and it changes to semi, you press it again and it turns back to auto (or whatever, more accurately what i would like to do with this involves completely changing the type of shot fired not just the rate).


Sun Aug 09, 2009 9:04 pm
Profile WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Weapon fire mode
Add a second global list to track state and add some toggle code, then done.


Sun Aug 09, 2009 11:25 pm
Profile
User avatar

Joined: Wed Feb 14, 2007 4:56 am
Posts: 43
Reply with quote
Post Re: Weapon fire mode
:)

read the first post mate my lua is "pitiful" I can't do that. I was hoping someone might be able to give me enough to go on to make myself (I am a quick learner but I don't really want to learn lua, I need enough space in my hard drive of a brain to remember my python...the coding language not the snake)


Mon Aug 10, 2009 12:12 am
Profile WWW
User avatar

Joined: Mon Mar 23, 2009 6:24 am
Posts: 8
Reply with quote
Post Re: Weapon fire mode
Couldn't you make 2 weapons, each with a different firemode, then on the purchase of the gun, you get 2 weapons, one with per say auto and the other semi. That way you switch weapons to "toggle" the mode. I know its not exactly what you mean but it can be done without lua.


Tue Aug 11, 2009 10:39 pm
Profile
User avatar

Joined: Wed Feb 14, 2007 4:56 am
Posts: 43
Reply with quote
Post Re: Weapon fire mode
There are many problems with this method: Double the cost, double the weight, and, most importantly, this adds one more weapon which you need to switch between when trying to change to say grenades or something. It adds a lot of trouble. Doing it by lua would avoid this problem.


Tue Aug 11, 2009 10:53 pm
Profile WWW
User avatar

Joined: Mon Mar 23, 2009 6:24 am
Posts: 8
Reply with quote
Post Re: Weapon fire mode
True it does add more weapons to switch through, but you can make the 2nd rate cost 0, and weight 0.


Tue Aug 11, 2009 11:05 pm
Profile
User avatar

Joined: Sat Aug 23, 2008 3:48 pm
Posts: 48
Reply with quote
Post Re: Weapon fire mode
Except the second gun would have it's own ammo count.


Wed Aug 12, 2009 1:09 am
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: Weapon fire mode
[quote="Munchkin9"]read the first post mate my lua is "pitiful" I can't do that.[quote]
well, nothing of the nature of what you want can be acomplished without scripting.


Wed Aug 12, 2009 1:11 am
Profile WWW
User avatar

Joined: Fri May 11, 2007 4:30 pm
Posts: 1040
Location: England
Reply with quote
Post Re: Weapon fire mode
pffft come on you guys, make the gun shoot a mosrot called "tempshot" or whatever, add an luascript to the gun that makes "tempshot" 'turn into' the shot you want (copy velocity, rotation, position to the new round and remove "tempshot" from the scene), default it to mode 1 and when a button is released change to mode 2, when button released again go back to mode 1.


Wed Aug 12, 2009 1:18 am
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: Weapon fire mode
3POK_PHALE wrote:
http://www.datarealms.com/forum/viewtopic.php?f=61&t=14644

The assault rifle has a grenade launcher, if that's what you want.

Wadda think I did?


Wed Aug 12, 2009 5:18 am
Profile
User avatar

Joined: Thu Feb 12, 2009 1:47 am
Posts: 1182
Reply with quote
Post Re: Weapon fire mode
I think you probably mapped a key to fire an AEmitter that emits an MOSR explosive. Too lazy to look at the code right now, so I'm simply speculating.


Wed Aug 12, 2009 5:22 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: Weapon fire mode
Nope. He did exactly what robolee did except it becam a grenade when crouching.


Wed Aug 12, 2009 8:10 am
Profile WWW
User avatar

Joined: Wed Feb 14, 2007 4:56 am
Posts: 43
Reply with quote
Post Re: Weapon fire mode
Am still looking for toggable

Quote:
well, nothing of the nature of what you want can be accomplished without scripting.


I am well aware of that which is why I was hoping someone would be interesting of creating a sort of base script of this or implement it into a weapon which I could then look at (with their permission) and use. Need I mention fame and fortune that would come from this :grin: ?


Wed Aug 12, 2009 4:37 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 20 posts ]  Go to page 1, 2  Next

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.049s | 13 Queries | GZIP : Off ]