Page 3 of 3
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 8:53 pm
by Kaks
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!
Re: Intercepting user key presses
Posted: Mon Jan 02, 2012 9:20 pm
by Svengali
Kaks wrote:@Svengali: indeed, and that's in the rapidly growing 1.77 TODO list already! ;)
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!
Re: Intercepting user key presses
Posted: Tue Jan 03, 2012 12:04 am
by Switeck
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.
Re: Intercepting user key presses
Posted: Wed Jan 04, 2012 7:55 am
by Wildeblood
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...
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)
Re: Intercepting user key presses
Posted: Wed Jan 04, 2012 11:59 am
by Kaks
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...
Re: Intercepting user key presses
Posted: Wed Jan 04, 2012 5:35 pm
by Switeck
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.
Re: Intercepting user key presses
Posted: Wed Jan 04, 2012 8:15 pm
by Commander McLane
Switeck wrote:While on the subject, the F5 screen does seem to show equipment "in no particular order" (that I can tell) as well.
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).
Re: Intercepting user key presses
Posted: Mon Jan 21, 2013 2:10 pm
by GGShinobi
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.
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!
Is there a reason why it is not mentioned in the wiki?
*
my modification remove the "auto firing" of the ecm (now I have to do it myself) andI reduced the chance for some missiles to lose their lock on my ship.
EDIT:
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.
errrm... uuuh.... huh???
How come I didn't see that?
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.
[/size]
Re: Intercepting user key presses
Posted: Mon Jan 21, 2013 2:44 pm
by Eric Walch
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?
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.
Re: Intercepting user key presses
Posted: Mon Jan 21, 2013 2:53 pm
by Diziet Sma
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.
Did that idea ever get off the ground?
Re: Intercepting user key presses
Posted: Mon Jan 21, 2013 2:58 pm
by Cody
Diziet Sma wrote: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.
Did that idea ever get off the ground?
This would be useful, even though I don't have too many primable items of kit - it would need to be compact, though. Icons?
Re: Intercepting user key presses
Posted: Mon Jan 21, 2013 10:03 pm
by Tricky
El Viejo wrote:Diziet Sma wrote: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.
Did that idea ever get off the ground?
This would be useful, even though I don't have too many primable items of kit - it would need to be compact, though. Icons?
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...