Intercepting user key presses
Moderators: winston, another_commander
Re: Intercepting user key presses
EquipmentDestroyed is a bit of a strange beast. It was intended for equipment destroyed by enemy fire, but no amount of enemy fire will destroy any equipment in unrestricted mode.
I'm not convinced about using that event to flag up a side effect of using equimpent the awy it was intended...
However, there might be some reworking of the way equipment is affected by enemy fire for 1.77!
I'm not convinced about using that event to flag up a side effect of using equimpent the awy it was intended...
However, there might be some reworking of the way equipment is affected by enemy fire for 1.77!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Re: Intercepting user key presses
I still think that even the current state is pretty cool - the list of features is impressive and OXPs have already soooo much possibilities. We only have to use them and if we can manage to avoid clashes the future is bright .-) So whenever this comes as shiny new feature - I'm pretty sure we'll see some more cool new stuff - Oolite rocks!Kaks wrote:@Svengali: indeed, and that's in the rapidly growing 1.77 TODO list already! ;)
Re: Intercepting user key presses
About the only other single-shot item I can think of is the Escape Pod...but it already has a mountain of code tied to its behavior, some of which may not be accessible via .js ...like how long the delay is before docking.
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: Intercepting user key presses
Again, although I thought I was clear, the equipment array in a saved game is always sorted alphabetically, so every saved game that has the same equipment will have it in exactly the same order. I would suggest, without testing, that the order in-game depends on the order the associated scripts are successfully loaded? (AAA Aaron Aardvark's Advanced Weapons.OXP)Kaks wrote:@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...
Re: Intercepting user key presses
Thank you for the extra clarity!
This seems to contradict what Switeck's been reporting, so I'm fairly puzzled as to why Switeck would see different things from you...
This seems to contradict what Switeck's been reporting, so I'm fairly puzzled as to why Switeck would see different things from you...
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Re: Intercepting user key presses
All I said was:
"I'm already fighting with a list of 10-20 primable equipment items in no particular order in my most upgraded ship. Even using CTRL+Shift+N to go backwards through the list only helps a little. Doubly sucks that some of my ships have the equipment in different order."
I guess I didn't study it long enough to determine the order.
While on the subject, the F5 screen does seem to show equipment "in no particular order" (that I can tell) as well.
"I'm already fighting with a list of 10-20 primable equipment items in no particular order in my most upgraded ship. Even using CTRL+Shift+N to go backwards through the list only helps a little. Doubly sucks that some of my ships have the equipment in different order."
I guess I didn't study it long enough to determine the order.
While on the subject, the F5 screen does seem to show equipment "in no particular order" (that I can tell) as well.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Intercepting user key presses
Clearly it shows first the built-in equipment and then OXP equipment, I guess in order of OXP name (which is not necessarily the same as the equipment name).Switeck wrote:While on the subject, the F5 screen does seem to show equipment "in no particular order" (that I can tell) as well.
Re: Intercepting user key presses
I didn't find a description for the shipHitByECM event handler in the wiki, but I tried to use it (I made a few modifications to missile spoof.oxp*), and it works!Kaks wrote:About ecm, you can use the shipHitByECM event handler to figure out which ship activated said ECM: it's not that simple, and it could be prone to errors: create a global variable with a ecm timestamp & blast remaining as a unique identifier, update that variable as the last line inside the event handler.
Is there a reason why it is not mentioned in the wiki?
*
EDIT:
errrm... uuuh.... huh??? How come I didn't see that?Eric Walch wrote:No idea were you looked, but it is described here on the ship handlers page. And that seems the first place to look for it. And according to the history. I added it 7 Okt 2011.
SORRY!!!
Guess I need some sleep Too much oolite + to less sleep is not good for my brain and my eyes (so it seems)
EDIT2:
*BTW, my modifications don't work, at least not how they should. I should have read the full post before messing around with it! The missile spoof now also gets activated if another ship fires an ECM, and even worse, it fires up to 4 times for a single ECM! (because of the 4 pulses). And I already wondered why it uses so much fuel! So I'm thinking now about doing it how Kaks suggested. Hmm, a "whom" would be nice
EDIT3:
added a primeable equipment instead and made the oxp configurable via global variable:
- $autoFire:
- if set to true, all you have to do is buy the equipment. It will automatically launch the flares if a missile is fired at your ship. No priming nescessary / possible.
- if set to false, you need to manually launch the flares by priming the equipment via shift-n and activating it with n.
Last edited by GGShinobi on Mon Jan 21, 2013 7:57 pm, edited 3 times in total.
忍 knowing that enough is enough, you'll always have enough.
Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Intercepting user key presses
No idea were you looked, but it is described here on the ship handlers page. And that seems the first place to look for it. And according to the history. I added it 7 Okt 2011.GGShinobi wrote:I didn't find a description for the shipHitByECM event handler in the wiki, ....
Is there a reason why it is not mentioned in the wiki?
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Intercepting user key presses
Did that idea ever get off the ground?Kaks wrote: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.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- Cody
- Sharp Shooter Spam Assassin
- Posts: 16081
- Joined: Sat Jul 04, 2009 9:31 pm
- Location: The Lizard's Claw
- Contact:
Re: Intercepting user key presses
This would be useful, even though I don't have too many primable items of kit - it would need to be compact, though. Icons?Diziet Sma wrote:Did that idea ever get off the ground?Kaks wrote: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.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
And any survivors, their debts I will certainly pay. There's always a way!
- Tricky
- ---- E L I T E ----
- Posts: 821
- Joined: Sun May 13, 2012 11:12 pm
- Location: Bradford, UK. (Anarchic)
Re: Intercepting user key presses
Would be very helpful to know if I have a fuel tank primed when I have a ship targetted. A bit useless hitting 'M', "Huh? Why isn't a missile winging it's way to that ship. Oh no, I've just wasted 3LY of a fuel pod." Untarget with 'U', reselect with 'Y', retarget with 'R', find enemy ship and line up in sights...El Viejo wrote:This would be useful, even though I don't have too many primable items of kit - it would need to be compact, though. Icons?Diziet Sma wrote:Did that idea ever get off the ground?Kaks wrote: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.