Forums » Suggestions
Can we get +shoot4 and +shoot5 ?
I know we have weapon groups... but... still...
Could you give an example where this might be usefull?
For ships that have > 3 ports
Yes but what kind of load out would you want?
Hmm. 1 diff trigger for every port on a rag? That's one whacked-out loadout.
That;s like..
-railgun mk2
-sunflare
-gauss cannon
-AGT
-chaos swarms/lmine launcher
Making a 'rainbow' of auto-aim and damage capability does not work well. 2 triggers are enough for me in most situations...
That;s like..
-railgun mk2
-sunflare
-gauss cannon
-AGT
-chaos swarms/lmine launcher
Making a 'rainbow' of auto-aim and damage capability does not work well. 2 triggers are enough for me in most situations...
aye.
Usually you set up with a gun trigger, a missle trigger and sometimes one for mines. with 3 shoots and 6 groups you can setup 18 combinations for each ship.... Its a rare day when I even use more then 2 triggers and a single group even on a rag. Currently I dont even have a shoot3 - for a rag like fusion suggestted Id just use 4 different weapon groups all tied to shoot1 and have shoot 2 tied to a gun like the agt !OR! have 3 agt and 3 gauss groups with the flare,swarms and rails as shoot1....
agt gauss - shoot2
shoot1
rail 1 4
flare 2 5
swarm 3 6
1-6 = groups
Theres just so many ways to set things up having two more triggers really would not be all that useful. I realise at first glance having a variety might seem like a good idea but in the heat of combat you really want to keep things as simple as possible. Too many choices can become a distraction and actually hurt you.
Just dont tie mines to missles as they tend to detonate on release....
Usually you set up with a gun trigger, a missle trigger and sometimes one for mines. with 3 shoots and 6 groups you can setup 18 combinations for each ship.... Its a rare day when I even use more then 2 triggers and a single group even on a rag. Currently I dont even have a shoot3 - for a rag like fusion suggestted Id just use 4 different weapon groups all tied to shoot1 and have shoot 2 tied to a gun like the agt !OR! have 3 agt and 3 gauss groups with the flare,swarms and rails as shoot1....
agt gauss - shoot2
shoot1
rail 1 4
flare 2 5
swarm 3 6
1-6 = groups
Theres just so many ways to set things up having two more triggers really would not be all that useful. I realise at first glance having a variety might seem like a good idea but in the heat of combat you really want to keep things as simple as possible. Too many choices can become a distraction and actually hurt you.
Just dont tie mines to missles as they tend to detonate on release....
what does it matter what the load out is? each of you is talking about your own personal preference. that's fine and i respect that. but my personal preference is a fire trigger for each tube.
there isn't even a lua interface to firing a tube beyond the +shoot variants. i'd be content with the lua interface. i'm trying to write a plugin to simulate additional tube firing by automagically switching to a weapon group before firing. this hasn't faired so well thus far.
so even if a +shoot4 is... "invented," it's not like either of you will be forced to use it. so why not have it?
there isn't even a lua interface to firing a tube beyond the +shoot variants. i'd be content with the lua interface. i'm trying to write a plugin to simulate additional tube firing by automagically switching to a weapon group before firing. this hasn't faired so well thus far.
so even if a +shoot4 is... "invented," it's not like either of you will be forced to use it. so why not have it?
because it is not a simple thing and the to-do list for the devs is a bit long.....
As I said before what exactly are you trying to use, maybe we can suggest a way to get what you want.
For instance you could write a bind to fire shoot2 each time the weapon group was selected and then bind each weapon in a different group to shoot2 that way you could effectively have shoot 1 thru 6. Even with out the bind just tie each weapon to shoot 2 in a different group and then change the group as needed.
As I said before what exactly are you trying to use, maybe we can suggest a way to get what you want.
For instance you could write a bind to fire shoot2 each time the weapon group was selected and then bind each weapon in a different group to shoot2 that way you could effectively have shoot 1 thru 6. Even with out the bind just tie each weapon to shoot 2 in a different group and then change the group as needed.
I didn't mean to imply that the devs should drop their current agenda to do my bidding. Every suggestion I make here is implicitly prefaced with "when the devs are able to get to it."
Whether or not +shoot4, etc is nontrivial I don't really know for sure.
I honestly don't have a specific... "plan" for +shoot4 any different than I would have a plan for +shoot3 assuming we only had +shoot1 and +shoot2
I'm attempting to make a lua plugin to simulate this but there have been some complications with correctly handling the release and press events (since those only seem to be supported via +/- binds)
Whether or not +shoot4, etc is nontrivial I don't really know for sure.
I honestly don't have a specific... "plan" for +shoot4 any different than I would have a plan for +shoot3 assuming we only had +shoot1 and +shoot2
I'm attempting to make a lua plugin to simulate this but there have been some complications with correctly handling the release and press events (since those only seem to be supported via +/- binds)
Should be completely doable with aliases. I don't remember the commands for changing groups around but something along the lines of:
/alias +shoot4 "'set weapon 4 to group 1'; +shoot1"
/alias -shoot4 "'set weapon group back'; -shoot1"
Should get the trick done.
/alias +shoot4 "'set weapon 4 to group 1'; +shoot1"
/alias -shoot4 "'set weapon group back'; -shoot1"
Should get the trick done.
Eldrad, I've been attempting to write a Lua plugin for that behavior and it's a bit more complex than at first glance. Your solution is sound, but will only work if you fire one tube at a time. What I have discovered is that the game mechanics for weapon groups and tube do not permit (easily) multiplexing shots for tubes not within the same weapon group. (btw the command you are looking for to change the weapon group is "weapon#", e.g. "weapon1", "weapon2"... )
Mouse buttons seem to act slightly different than keys. Primarily, pressing and holding the mouse button does not "repeat" the button like a key press. The event is only sent once. That is why +shoot1 is designed to repeat -until- the release event is handled instead of only firing off 1 shot.
So if you have a command for +shoot4, +shoot5... etc (the plugin I wrote actually enables 18 tubes, so you have +firetube1, +firetube18), and you begin firing... tube 1, it will work. But as soon as you begin firing a tube that is in another weapon group, you run into a slight problem. Once you switch over to the other weapon group, it applies to the first tube fired as well. So "tubes" in weapon groups *cannot* be multiplexed that way.
The only solution I have come up with is to have timers schedule when to switch the weapon group back and forth to multiplex the shots correctly. This is fairly complex because you need to know precisely the rate of fire for the weapon in the tube. You can, of course, get this information from the game and parse it out dynamically. This is not exactly trivial.
For reference, here's the lua code I have thus far for trying to simulate extended tube fire.
[edit: removed code, see Eldrad's post for a working solution]
To reiterate, the above code will work and you can actually use +firetube1, +firetube10, +firetube18, etc. But, don't try to simultaneously fire tubes that aren't in the same group. You could fire +firetube1, 2, 3 simultaneously without problem. But if you try to fire (with the code above) +firetube1, 4, 10 simultaneously in that specific order what will happen is the weapons in the last group selected (+firetube10 uses group 4) are the ones that will fire.
You might notice there is some beginning structure for the weapon group timer multiplexing. I stopped once I realized how complex the solution was becoming and hoped to discover a better way before I spent too much time with it. I have other more useful plugins to finish writing.
Mouse buttons seem to act slightly different than keys. Primarily, pressing and holding the mouse button does not "repeat" the button like a key press. The event is only sent once. That is why +shoot1 is designed to repeat -until- the release event is handled instead of only firing off 1 shot.
So if you have a command for +shoot4, +shoot5... etc (the plugin I wrote actually enables 18 tubes, so you have +firetube1, +firetube18), and you begin firing... tube 1, it will work. But as soon as you begin firing a tube that is in another weapon group, you run into a slight problem. Once you switch over to the other weapon group, it applies to the first tube fired as well. So "tubes" in weapon groups *cannot* be multiplexed that way.
The only solution I have come up with is to have timers schedule when to switch the weapon group back and forth to multiplex the shots correctly. This is fairly complex because you need to know precisely the rate of fire for the weapon in the tube. You can, of course, get this information from the game and parse it out dynamically. This is not exactly trivial.
For reference, here's the lua code I have thus far for trying to simulate extended tube fire.
[edit: removed code, see Eldrad's post for a working solution]
To reiterate, the above code will work and you can actually use +firetube1, +firetube10, +firetube18, etc. But, don't try to simultaneously fire tubes that aren't in the same group. You could fire +firetube1, 2, 3 simultaneously without problem. But if you try to fire (with the code above) +firetube1, 4, 10 simultaneously in that specific order what will happen is the weapons in the last group selected (+firetube10 uses group 4) are the ones that will fire.
You might notice there is some beginning structure for the weapon group timer multiplexing. I stopped once I realized how complex the solution was becoming and hoped to discover a better way before I spent too much time with it. I have other more useful plugins to finish writing.
<speculation type="pure" mode="completely wrong">
I suspect that the underlying code for +shoot1, 2 and 3 is a lua function, perhaps FireActiveShipPortID(#), but that the function isn't limited by any sort of delay. Instead, the +shoot# structure uses some scheduling technique, a timer, to determine when to fire based on weapon delay.
That, at least would explain why the function isn't exposed/available for plugin use. I can't imagine another reason why there isn't a direct interface for activating a port...
Of course this is pure speculation, and I'm completely wrong.
</speculation>
I suspect that the underlying code for +shoot1, 2 and 3 is a lua function, perhaps FireActiveShipPortID(#), but that the function isn't limited by any sort of delay. Instead, the +shoot# structure uses some scheduling technique, a timer, to determine when to fire based on weapon delay.
That, at least would explain why the function isn't exposed/available for plugin use. I can't imagine another reason why there isn't a direct interface for activating a port...
Of course this is pure speculation, and I'm completely wrong.
</speculation>
I suspect that it is actually not in lua at all, because it predates integrating lua, and there just never was a reason for the devs to use it from lua. (i am totally guessing too)
It would indeed be nice to be able to fire specific weapon, regardless of whether it's in a group or not, plus a lua function for it, but... well i'd say it's not a high priority.
Whole group interface is quite unintuitive i find.
Anyhow i think it should be quite possible to work around this in lua, tho possibly, as you say, non trivial.
It would indeed be nice to be able to fire specific weapon, regardless of whether it's in a group or not, plus a lua function for it, but... well i'd say it's not a high priority.
Whole group interface is quite unintuitive i find.
Anyhow i think it should be quite possible to work around this in lua, tho possibly, as you say, non trivial.
Ahhh the problem is the commands I was looking for doesn't exist. I thought there was a way to change what weapons were in what group while in flight (instead of just being able to change which groups were set to which triggers).
This is my first time writing anything in lua so I probably screwed stuff up (also haven't tested this at all and don't have Vendetta installed on this computer)... but once the following's edited to remove all my screw ups I think it'd work.
Edit: This allows you to create as many firing keys as you want with any group of ports (just alias to a list of +fire_port#)... it won't work well when a single port is bound to multiple keys (pressing both buttons and then releasing one would stop firing). If someone wanted to have such things work perfectly just allow firing_list to have duplication and only remove the first instance of a port. If ConfigureWeaponGroup doesn't handle repeats well keep a second list which is a copy of the firing_list with duplications removed.
EDITED: Replaced the code with code that mostly works... though the end result has a couple problems 1) it doesn't actually shoot not sure why (though when you manually shoot that does work as expected) 2) The key releases are often missed sometimes they're not but most of the time they are... or possibly the function's not working on the key releases?
EDITED AGAIN: First problem fixed. Sometimes works perfectly but it often doesn't recognize key releases. When it does recognize them the behavior seems to be correct.
FINAL EDIT?: Ok it works now... just bind +fire_port_# to the keys you want or make aliases with any number of +fire_port_# in the alias and bind the aliases to keys (if two keys both control the same port releasing either key will stop firing that port... if you really want that not to happen I can change it)
local firing_list = {}
local function fire_on() gkinterface.GKProcessCommand('+shoot2 1') end
local function fire_off() gkinterface.GKProcessCommand('+shoot2 0') end
local function press_fire(port)
local found = false
for i in ipairs(firing_list) do
if firing_list[i ] == port then
found = true
end
end
if not found then
table.insert(firing_list, port)
ConfigureWeaponGroup(0, firing_list)
fire_off() -- This line may not be needed
fire_on()
end
end
local function release_fire(port)
for i in ipairs(firing_list) do
if firing_list[i ] == port then
table.remove(firing_list, i)
end
end
ConfigureWeaponGroup(0, firing_list)
if #firing_list == 0 then
fire_off()
end
end
RegisterUserCommand("+fire_port_1", function() press_fire(2) end)
RegisterUserCommand("+fire_port_2", function() press_fire(3) end)
RegisterUserCommand("+fire_port_3", function() press_fire(4) end)
RegisterUserCommand("+fire_port_4", function() press_fire(5) end)
RegisterUserCommand("+fire_port_5", function() press_fire(6) end)
RegisterUserCommand("-fire_port_1", function() release_fire(2) end)
RegisterUserCommand("-fire_port_2", function() release_fire(3) end)
RegisterUserCommand("-fire_port_3", function() release_fire(4) end)
RegisterUserCommand("-fire_port_4", function() release_fire(5) end)
RegisterUserCommand("-fire_port_5", function() release_fire(6) end)
This is my first time writing anything in lua so I probably screwed stuff up (also haven't tested this at all and don't have Vendetta installed on this computer)... but once the following's edited to remove all my screw ups I think it'd work.
Edit: This allows you to create as many firing keys as you want with any group of ports (just alias to a list of +fire_port#)... it won't work well when a single port is bound to multiple keys (pressing both buttons and then releasing one would stop firing). If someone wanted to have such things work perfectly just allow firing_list to have duplication and only remove the first instance of a port. If ConfigureWeaponGroup doesn't handle repeats well keep a second list which is a copy of the firing_list with duplications removed.
EDITED: Replaced the code with code that mostly works... though the end result has a couple problems 1) it doesn't actually shoot not sure why (though when you manually shoot that does work as expected) 2) The key releases are often missed sometimes they're not but most of the time they are... or possibly the function's not working on the key releases?
EDITED AGAIN: First problem fixed. Sometimes works perfectly but it often doesn't recognize key releases. When it does recognize them the behavior seems to be correct.
FINAL EDIT?: Ok it works now... just bind +fire_port_# to the keys you want or make aliases with any number of +fire_port_# in the alias and bind the aliases to keys (if two keys both control the same port releasing either key will stop firing that port... if you really want that not to happen I can change it)
local firing_list = {}
local function fire_on() gkinterface.GKProcessCommand('+shoot2 1') end
local function fire_off() gkinterface.GKProcessCommand('+shoot2 0') end
local function press_fire(port)
local found = false
for i in ipairs(firing_list) do
if firing_list[i ] == port then
found = true
end
end
if not found then
table.insert(firing_list, port)
ConfigureWeaponGroup(0, firing_list)
fire_off() -- This line may not be needed
fire_on()
end
end
local function release_fire(port)
for i in ipairs(firing_list) do
if firing_list[i ] == port then
table.remove(firing_list, i)
end
end
ConfigureWeaponGroup(0, firing_list)
if #firing_list == 0 then
fire_off()
end
end
RegisterUserCommand("+fire_port_1", function() press_fire(2) end)
RegisterUserCommand("+fire_port_2", function() press_fire(3) end)
RegisterUserCommand("+fire_port_3", function() press_fire(4) end)
RegisterUserCommand("+fire_port_4", function() press_fire(5) end)
RegisterUserCommand("+fire_port_5", function() press_fire(6) end)
RegisterUserCommand("-fire_port_1", function() release_fire(2) end)
RegisterUserCommand("-fire_port_2", function() release_fire(3) end)
RegisterUserCommand("-fire_port_3", function() release_fire(4) end)
RegisterUserCommand("-fire_port_4", function() release_fire(5) end)
RegisterUserCommand("-fire_port_5", function() release_fire(6) end)
You can change weapon groups in flight.
Also this won't work
RegisterUserCommand("+fire_port_1", press_fire(1))
you need to do
RegisterUserCommand("+fire_port_1", function() press_fire(1) end)
Also this won't work
RegisterUserCommand("+fire_port_1", press_fire(1))
you need to do
RegisterUserCommand("+fire_port_1", function() press_fire(1) end)
Tested out and rewrote the plugin it works now assuming you don't want multiple keys to control 1 port.
Nice job Eldrad.
I didn't think weapon groups would work that way. The reason I didn't pursue that route was because I thought it would result in weapons in the group firing at the same time... (and relative to their delay after that) i.e. no chain firing.
I'm still not sure how it is able to compensate for this to allow for chain firing.
The only downside I can see to this solution is the slight delay at the beginning when you fire the first time.
I didn't think weapon groups would work that way. The reason I didn't pursue that route was because I thought it would result in weapons in the group firing at the same time... (and relative to their delay after that) i.e. no chain firing.
I'm still not sure how it is able to compensate for this to allow for chain firing.
The only downside I can see to this solution is the slight delay at the beginning when you fire the first time.