Page 2 of 3
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 1:17 am
by Kaks
I believe the energy bomb - the player-only super weapon - is not going to be actively supported in versions after 1.76, as already mentioned quite a few times IIRC, but for other player actions I believe there's an event that js can react to. All NPCs events, again IIRC, are also available for scripts to interact with. If there are events we missed, do please tell us.
And yes, having 10 or more primable items on board is quite unwieldly.
There was some thought of limiting the amount of primable equipment on a per-ship basis, analogous to the way missile slots work, including a 'sell all primable equipment' option when in the F3 screen. It's an option we might revisit...
Anyway, one thing that is very likely to happen in trunk is the addition of a new HUD 'dial' to specifically display the primed equipment name, rather than relying on the player remembering which equipment was primed while in the middle of a fight.
Finally, each piece of equipment is a customisation to your ship, and I believe the order you bought your custom equipment influences the order your equimpent is shown to you. Each ship gets extra individuality this way, which is - in my opinion - a fairly good thing.
Mind you, if what you're saying is that the order of primable equipment changes randomly from savegame to savegame then that would be a bug, and we'll try and investigate what's going on there.
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 1:42 am
by Switeck
The energy bomb needs to stay in strict mode if nothing else.
I don't believe the order is changing from reload to reload, but I'm not sure the order follows the order I bought the equipment in.
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 8:32 am
by Cmdr. Maegil
Other reasons for wanting to intercept key presses could be for instance to:
-answer to queries or comply with an order to power down the weapons;
-if the player is already injecting away but the throttle increase or the jump drive are still being pressed, the engine could be forced into overload - increasing the speed, but putting the engine and the whole ship at severe risk of imminent damage or destruction;
-or even to fire simultaneously the main weapon and additional scripted laser subentities - a true multi laser.
These are just some quick thoughts, I'm certain the fertile minds that abound in this August forum can come up with many more.
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 9:29 am
by DaddyHoggy
Kaks wrote:I believe the energy bomb - the player-only super weapon - is not going to be actively supported in versions after 1.76, as already mentioned quite a few times IIRC, but for other player actions I believe there's an event that js can react to. All NPCs events, again IIRC, are also available for scripts to interact with. If there are events we missed, do please tell us.
And yes, having 10 or more primable items on board is quite unwieldly.
There was some thought of limiting the amount of primable equipment on a per-ship basis, analogous to the way missile slots work, including a 'sell all primable equipment' option when in the F3 screen. It's an option we might revisit...
Anyway, one thing that is very likely to happen in trunk is the addition of a new HUD 'dial' to specifically display the primed equipment name, rather than relying on the player remembering which equipment was primed while in the middle of a fight.
Finally, each piece of equipment is a customisation to your ship, and I believe the order you bought your custom equipment influences the order your equimpent is shown to you. Each ship gets extra individuality this way, which is - in my opinion - a fairly good thing.
Mind you, if what you're saying is that the order of primable equipment changes randomly from savegame to savegame then that would be a bug, and we'll try and investigate what's going on there.
Could a "list" be saved in the save file - so you go to a Primeable-equipment sub-screen (somewhere!) arrange your equipment (like a BIOS bootlist) and then this is saved to the save file, so next time your equipment is always in the order you want it?
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 11:06 am
by Kaks
One at a time, please!
@Switeck: OXPs don't work in strict mode, so there's no need for oxps to react to strict mode only stuff.
@Cmdr. Maegil:
- I thought there already was an event triggered by securing/unsecuring weapons, but maybe not. And I thought you can already tell when the injector key is pressed, I seem to (mis-?)remember BGS doing something in that regard...
And hopefully the fertile minds abounding in this august forum will also come up with innovative ways to solve as-yet-unspecified issues! The js api being relatively new, only a handful of (amazing, IMO) OXPs do more than just scratch the surface of what's actually possible, and - in any case - there's nothing to stop people from contributing to trunk - that's how I became a developer!
@Daddy Hoggy: sure, that's already what's happening inside the save file, and you can use a text editor to swap things 'round, unless I'm very, very much mistaken.
A rearrange primable equipment and/or missiles sub screen is yet to be written, and might not see the light of day with the present GUI code, but maybe someone less timid than me will provide the code for such a thing...
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 1:57 pm
by Cmdr. Maegil
Kaks wrote:I thought there already was an event triggered by securing/unsecuring weapons, but maybe not. And I thought you can already tell when the injector key is pressed, I seem to (mis-?)remember BGS doing something in that regard...
My point is that a lot of options would open if the controls themselves could be used as input for JS. I believed these ideas impracticable for lack of handlers, but as I said, these are just loose ideas for anyone who likes them to work upon when, or if ever, they become possible.
In the example above, the origin was in HPA2 when Norman Mosser jury-rigged the Azure Sunset's jump drive to force jump even under mass lock - causing a "spacequake" that wiped out the pursuing Federal fleet and nearly destroyed his own ship, but allowed him to escape.
Gamewise, this could translate as the possibility to intentionally force a mass-lock release by simultaneously activating the injectors, the jump drive and trying to accelerate - predictably resulting in damage to the drive, and whatever additional mayhem the OXPer might devise.
The js api being relatively new, only a handful of (amazing, IMO) OXPs do more than just scratch the surface of what's actually possible, and
JS is still new, but it's also what permits OXPs to go further both in imagination and immersion... It's indeed a precious tool!
And hopefully the fertile minds abounding in this august forum will also come up with innovative ways to solve as-yet-unspecified issues! (...) in any case - there's nothing to stop people from contributing to trunk - that's how I became a developer!
There is one thing, and an important one - the knowledge. I wish I could help, and undoubtedly so do many others, but you know what they say about teaching new tricks to old dogs; to boot, programming is often too hard a trick...
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 2:54 pm
by Svengali
Kaks wrote:And yes, having 10 or more primable items on board is quite unwieldly.
There was some thought of limiting the amount of primable equipment on a per-ship basis, analogous to the way missile slots work, including a 'sell all primable equipment' option when in the F3 screen. It's an option we might revisit... :)
I'd guess a multi-EQ script could help too, similiar to the CCL_Comms script, and would shorten the list. Could be splitted into categories, etc... for faster access. It only needs someone to write it .-)
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 3:25 pm
by Wildeblood
Kaks wrote:@Daddy Hoggy: sure, that's already what's happening inside the save file, and you can use a text editor to swap things 'round, unless I'm very, very much mistaken.
You're very, very much mistaken. There's no separate list of prime-able equipment in a save-game file*, only the main list of equipment keys, which are always sorted into alphabetical order. Prime-able equipment appears listed in the order it is purchased/awarded, but when re-loading a saved game that order must be lost. That sucks, man.
* Unless it's hidden among the trumbles, or something.
Addendum: Just tried it to make sure, using a save-game with about 15 prime-able items where I know what order they were in yesterday. They come up in a scrambled, random order when re-loading a saved game.
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 5:07 pm
by Switeck
Kaks wrote:@Switeck: OXPs don't work in strict mode, so there's no need for oxps to react to strict mode only stuff.
It seems a shame to convert the energy bomb from its own special key to using the same activation key as all other primable equipment. And this is what will happen (it will be made into an OXP) if it's totally removed. If it's just set to strict mode only, an OXP can undo that as far as I know...and my point still stands.
But besides that very marginal example that I came up with at the spur of the moment and now dominates my responses, a lot of options would open if the controls themselves could be used as input for JS. CCL is really marginal for entering "keycodes" (security passes, passwords, etc) or a calculator-like function OXP.
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 5:47 pm
by Thargoid
One thought, you could just check if the player is equipped with it via a timer, and then act accordingly if the status changes from yes to no (ie it's been used). Need to be a little careful though as I think some OXPs remove it (Random Hits or Assassins I think, and perhaps others).
Also as a total flier (as I'm not near a machine with the game installed to check) - does using the energy bomb (or any other piece of equipment which is a single-shot, like the galactic hyperdrive) trigger an equipmentDamaged or more likely an equipmentDestroyed event when activated? And if not, should it (probably destroyed)?
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 6:19 pm
by Svengali
Switeck wrote:CCL is really marginal for entering "keycodes" (security passes, passwords, etc) or a calculator-like function OXP.
CCL contains a (
documented) keyboard since the first released version (used in OXPConfig, Vector and Cabal_Common_MaterialsFinder).
As it is using a model it is limited to player.ship.docked. And mouse support is also not available, but already
requested.
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 7:23 pm
by DaddyHoggy
Switeck wrote:It seems a shame to convert the energy bomb from its own special key to using the same activation key as all other primable equipment. And this is what will happen (it will be made into an OXP) if it's totally removed. If it's just set to strict mode only, an OXP can undo that as far as I know...and my point still stands.
OXPs don't/can't run in strict mode - or have I misunderstood the statement.
(PS it's been a long time since I played in strict mode - so if my above statement is true - I'm presuming cool visual stuff - like the Griff's ships wouldn't work either?)
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 8:25 pm
by Switeck
I don't mean running the game in strict mode.
I meant the coding in equipment.plist:
An OXP can change that to false so that equipment will be available NOT in strict mode.
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 8:39 pm
by Kaks
Switeck wrote:It seems a shame to convert the energy bomb from its own special key to using the same activation key as all other primable equipment. And this is what will happen (it will be made into an OXP) if it's totally removed. If it's just set to strict mode only, an OXP can undo that as far as I know...and my point still stands.
But besides that very marginal example that I came up with at the spur of the moment and now dominates my responses, a lot of options would open if the controls themselves could be used as input for JS. CCL is really marginal for entering "keycodes" (security passes, passwords, etc) or a calculator-like function OXP.
Be as it may, in the future we're not expecting the energy bomb in unrestricted mode, so we're not going out of our way just to support oxp interactions with it.
Back to js and key presses: it seems you're asking for a sensible way of allowing all oxps access to all the keys, and somehow avoid conflicts between all oxps wanting to react in different and possibly conflicting ways to - say - pressing the letter w. That's a lot easier said than done, but if anyone wants to code such a thing, please do! In other words, you're more than welcome to submit such a patch!
@Wildeblood: does the scrambled order change every time you load the savegame, or is the scrambled order the same scrambled order every time? I believe Switeck said that for him the scrambled order is consistent per savegame, but different savegames result in different scrambled orders...
@Thargoid: galactic jumps can easily be detected via js already, so that problem's already solved!
@Svengali: indeed, and that's in the rapidly growing 1.77 TODO list already!
@DH: that's right. Strict mode - no BGS or Griff ships, no buying other ships, no contracts & passengers, no a bunch of other stuff!
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 8:45 pm
by Thargoid
Kaks wrote:@Thargoid: galactic jumps can easily be detected via js already, so that problem's already solved!
I know, but it was the only other single-use item I could think of offhand. And if such situations triggered the equipmentDestroyed event, then it should apply for all such.