Weapons safety toggle and ECM

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
Bicorn
Dangerous
Dangerous
Posts: 80
Joined: Wed Jun 18, 2025 8:47 am

Weapons safety toggle and ECM

Post by Bicorn »

I think the ECM system should count as a "weapon" for the purpose of the weapon systems off/on toggle. Even if it doesn't count as a crime, I still can't imagine all the NPC ships around a station appreciate getting blasted with the ECM jamming signal when I fat-finger a key; it also makes conceptual sense, as like the guns and missiles it's a system you're only supposed to use in combat.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6856
Joined: Wed Feb 28, 2007 7:54 am

Re: Weapons safety toggle and ECM

Post by another_commander »

Makes sense. I'll make the change shortly and you should be able to test a binary containing it later today.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6856
Joined: Wed Feb 28, 2007 7:54 am

Re: Weapons safety toggle and ECM

Post by another_commander »

Done. You can find the inclusion of ECM in the weapons that get toggled on/off in pre-release 1.91.0.7679-250703-49e991a.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2789
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: Weapons safety toggle and ECM

Post by Wildeblood »

https://wiki.alioth.net/index.php/Oolit ... emsToggled

Describes the related JS event thus:

The weaponsSystemsToggled handler is called whenever the player toggles their weapons systems on or off. The state parameter contains the new state of the weapons systems

this.weaponsSystemsToggled = function(state : boolean)
{
// Your code here
}

The parameter passed is not, however, truly a Boolean value, it contains a number 0 or 1, rather than true or false. player.ship.weaponsOnline , however, does contain a value of true or false. I imagine this was deliberate, as using 0 or 1 allows the possibility of detail being added in future, e.g. 1 = lasers online, 2 = lasers and missiles online, etc. all of which pass as true-ish in JS.

On the off chance it wasn't deliberate, I mention it now.
"Must keep this response efficient to preserve remaining context."
Bicorn
Dangerous
Dangerous
Posts: 80
Joined: Wed Jun 18, 2025 8:47 am

Re: Weapons safety toggle and ECM

Post by Bicorn »

Question - can you have both Oolite 1.90 and 1.91 on the same machine (on Windows) or will they interfere with each other?
Also, are 1.90 saves transferrable to 1.91?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 5232
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Weapons safety toggle and ECM

Post by phkb »

Bicorn wrote: Thu Jul 03, 2025 9:35 pm
Question - can you have both Oolite 1.90 and 1.91 on the same machine (on Windows) or will they interfere with each other?
Also, are 1.90 saves transferrable to 1.91?
Yes to both. As long as you don't install them in the same folder, you can have as many installations of Oolite as you like. They will each have their own AddOns and ManagedAddOns folders.
You can certainly transfer a 1.90 save to 1.91. Not sure about going the other way though - haven't tried that one.
Post Reply