Data Realms Fan Forums
http://45.55.195.193/

Multiplie weapon modes
http://45.55.195.193/viewtopic.php?f=1&t=14811
Page 1 of 1

Author:  Lizardheim [ Wed May 20, 2009 2:30 pm ]
Post subject:  Multiplie weapon modes

I was thinking for my mod that i wanted the weapons to have different modes, like full auto and semi auto.
Iwas also thinking of grenade launchers attached to the bottom of the machinegun, i know keybinding is possible in lua and that i could make different emitters with lua.
Just one question, is this possible?

Author:  Grif [ Wed May 20, 2009 2:44 pm ]
Post subject:  Re: Multiplie weapon modes

Kinda?

Look at my zombie barf mod for one example of a key binding (though in this case it's actually a jetpack binding) can be used to switch weapon modes.

If you don't mind a custom actor, you can bind it to just about any function, including crouching and sharpaiming.

Author:  Lizardheim [ Wed May 20, 2009 2:48 pm ]
Post subject:  Re: Multiplie weapon modes

Just using this as my own personal dumping ground.
My god someone should go back in time and hand me a dictionairy...
Attachment:
AA12.rte.rar [24.15 KiB]
Downloaded 164 times

Author:  Darlos9D [ Wed May 20, 2009 2:53 pm ]
Post subject:  Re: Multiplie weapon modes

I'm actually way ahead of you here. Or not, considering that you can't do this sort of thing yet.

The problem is that you can't run scripts on things attached to actors. That means everything on the actor besides their torso, including any held weapons. So no, you can't just do "press button, change 'fire mode' variable in weapon" like I'm sure you're thinking about, or else I would have done it already.

Now, you could potentially base the code on the actor rather than the gun, but for that to work reliably you'd basically have to have it so the actor itself shoots stuff out (by spawning projectiles with lua) and any gun would be just for show. This'd be interesting for some kind of large machine with multiple weapons that doesn't ever switch weapons, but it'd be pretty useless for a regular actor.

Author:  Lizardheim [ Wed May 20, 2009 3:08 pm ]
Post subject:  Re: Multiplie weapon modes

Could i have the actor to just be able to use that function when the weapon is out?

Author:  Grif [ Thu May 21, 2009 5:59 am ]
Post subject:  Re: Multiplie weapon modes

No, because guns, when held, are treated as attachables and completely away from our control.

Add a script to a gun that looks like this:

function Update(self)
self:Activate();
end

While you're holding it, nothing happens. As soon as you drop it? It shoots all over the place.

Author:  CrazyMLC [ Thu May 21, 2009 6:15 am ]
Post subject:  Re: Multiplie weapon modes

How about something like this.
If (Self:IsAttached() == true) and (UInputMan:KeyHeld(_)) then
Then somehow activate some emitter...

Author:  411570N3 [ Thu May 21, 2009 8:33 am ]
Post subject:  Re: Multiplie weapon modes

The point they're trying to make is is that when anything's attached the Lua to go with it is completely ignored. In fact, any Lua even trying to mess with said attached parts won't work either.

Author:  Geti [ Mon Dec 06, 2010 2:35 am ]
Post subject:  Re: Multiplie weapon modes

you can actually find the gun with a MOID search, store it in a variable and call gun:Update() if you so choose. This does require a global HDFirearm updater but whatever.

Author:  411570N3 [ Mon Dec 06, 2010 2:44 am ]
Post subject:  Re: Multiplie weapon modes

Yeah, but be careful with it. Update being run twice causes a crash.

Author:  Coops [ Mon Dec 06, 2010 3:55 am ]
Post subject:  Re: Multiplie weapon modes

I am literally working on a Mod just like this.

It is quite hard and there are plenty of limits to it but yes it is feasible. Certain things like scopes are not as much though as the damn Sharplength is Read-Only..

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