OXP Concept - Laser Switch

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Dragonfire
---- E L I T E ----
---- E L I T E ----
Posts: 503
Joined: Sat Jun 11, 2011 7:46 pm

OXP Concept - Laser Switch

Post by Dragonfire »

I got an idea for an OXP that allows the player to switch between a military and mining laser on their forward. I know this would be very useful for a number of commanders, especially those with only one or two weapon facings.

The OXP would be a (relatively expensive) piece of equipment purchased at the station. When activated (via the "n" key), it would change the laser from military to mining, or mining to military. The player would have to have either a military or mining laser installed on forward to purchase this.

To maintain game balance, the equipment would need to do one or both of two things:

>Drain an energy bank.
>Overheat the initiated laser, preventing a rapid switch.

Thoughts? Code ideas?
User avatar
Okti
---- E L I T E ----
---- E L I T E ----
Posts: 700
Joined: Sun Sep 26, 2010 1:51 pm
Location: A GH shop, near witchpoint to Oresrati in Galaxy 8

Re: OXP Concept - Laser Switch

Post by Okti »

Dragonfire wrote:
I got an idea for an OXP that allows the player to switch between a military and mining laser on their forward. I know this would be very useful for a number of commanders, especially those with only one or two weapon facings.

The OXP would be a (relatively expensive) piece of equipment purchased at the station. When activated (via the "n" key), it would change the laser from military to mining, or mining to military. The player would have to have either a military or mining laser installed on forward to purchase this.

To maintain game balance, the equipment would need to do one or both of two things:

>Drain an energy bank.
>Overheat the initiated laser, preventing a rapid switch.

Thoughts? Code ideas?
Are you into scripting? Just look at the object model and you will see it is not possible and please only post that can be doable not concepts :?:
My OXP's
And Latest Mission Coyote's Run
Dragonfire
---- E L I T E ----
---- E L I T E ----
Posts: 503
Joined: Sat Jun 11, 2011 7:46 pm

Re: OXP Concept - Laser Switch

Post by Dragonfire »

Anyone else care to weigh in? I don't give up easily. :lol:

My thought would be to check the save file forward laser value, and then change that using the .js. I know a number of savefile changes are reflected immediately, so that should be fairly possible. (In fact, in a bit, I'll try it out.)

My question, more or less, is whether the laser can be overheated through code? That would be the ideal drawback.
User avatar
Okti
---- E L I T E ----
---- E L I T E ----
Posts: 700
Joined: Sun Sep 26, 2010 1:51 pm
Location: A GH shop, near witchpoint to Oresrati in Galaxy 8

Re: OXP Concept - Laser Switch

Post by Okti »

No comment :lol:
My OXP's
And Latest Mission Coyote's Run
User avatar
RyanHoots
---- E L I T E ----
---- E L I T E ----
Posts: 958
Joined: Fri May 20, 2011 8:10 pm
Location: Nowhere
Contact:

Re: OXP Concept - Laser Switch

Post by RyanHoots »

Dragonfire, I think you need Thargoid's help.
Image
Dragonfire
---- E L I T E ----
---- E L I T E ----
Posts: 503
Joined: Sat Jun 11, 2011 7:46 pm

Re: OXP Concept - Laser Switch

Post by Dragonfire »

Hoping that he'll post here, but I may wind up PMing him tonight. :)
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: OXP Concept - Laser Switch

Post by Thargoid »

He'll post here.

Okti's right - you can't award/remove lasers by scripting. You can check what weapon the ship has in each facing (player.ship.forwardWeapon / .aftWeapon / .portWeapon / .starboardWeapon) but all four are read-only.

If you try to award a laser (EQ_WEAPON_PULSE_LASER etc) by script it just returns false. Ditto for removal.

There are ways and means around it (to which Okti refers elsewhere if he means what I think he does) but they would come with extreme complications and wouldn't be worth the effort (and wouldn't work completely anyway).
Last edited by Thargoid on Tue Jul 26, 2011 8:00 pm, edited 1 time in total.
Dragonfire
---- E L I T E ----
---- E L I T E ----
Posts: 503
Joined: Sat Jun 11, 2011 7:46 pm

Re: OXP Concept - Laser Switch

Post by Dragonfire »

Hmm, okay, thanks for the input. Perhaps this just warrants another "n" triggered weapon as a backup for the military laser. I'll think on it more. Thanks, Thargoid.

While we're on the topic of lasers and scripting, IS it possible to change the laser temperature? I may end up scripting a "laser cooler" instead, that speeds up the laser cooling at the expense of a few energy banks.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: OXP Concept - Laser Switch

Post by Capt. Murphy »

Do a forum search for 'laser cooler' .... :wink:

Dragonfire, I'm surprised you haven't looking the scripting engine stuff on the wiki.

Take a look at these to get a grip on what properties are read only and what can be interacted with on your ship.

http://wiki.alioth.net/index.php/Oolite ... ce:_Player
http://wiki.alioth.net/index.php/Oolite ... ence:_Ship
http://wiki.alioth.net/index.php/Oolite ... PlayerShip
http://wiki.alioth.net/index.php/Oolite ... ce:_Entity
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: OXP Concept - Laser Switch

Post by JensAyton »

Okti wrote:
please only post that can be doable not concepts
The easiest way to find out what’s doable is to ask. And sometimes, when the answer is no, that turns out to be wrong. (But in this case, I’d be very surprised.)
Dragonfire
---- E L I T E ----
---- E L I T E ----
Posts: 503
Joined: Sat Jun 11, 2011 7:46 pm

Re: OXP Concept - Laser Switch

Post by Dragonfire »

Capt. Murphy wrote:
Do a forum search for 'laser cooler' .... :wink:

Dragonfire, I'm surprised you haven't looking the scripting engine stuff on the wiki.

Take a look at these to get a grip on what properties are read only and what can be interacted with on your ship.

http://wiki.alioth.net/index.php/Oolite ... ce:_Player
http://wiki.alioth.net/index.php/Oolite ... ence:_Ship
http://wiki.alioth.net/index.php/Oolite ... PlayerShip
http://wiki.alioth.net/index.php/Oolite ... ce:_Entity
Thank you, Murphy. I've been looking through those, but I've had a little trouble making heads or tails of it. (I'm juggling a number of other non-Oolite projects, atm, one of them programming.) I'll be sure to run that search pronto.

EDIT: Well, the end result of that laser cooler search seems to be much like with my Wyvern. Some like it, some don't, some hate it with a vengance. So...I'll try and script it, and if people don't want it, they won't download it. :)

Anyone who thinks it is a viable OXP (even if you don't want to download it yourself), comments and suggestions are more than welcome. If you hate the concept, just know that I already have seen the debate, and I'm moving ahead anyway. :3

As to game balance...it comes at a steep energy bank price, so you have to become more vulnerable to use it. It ain't free power. :P
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: OXP Concept - Laser Switch

Post by Capt. Murphy »

My point was more that it's been discussed quite a lot and as such if it was doable someone would probably have done it by now, rather than any controversy about the idea. My feeling as to any OXP idea is if at least a few people would want it then there is merit in releasing it. Personally I think emergency laser cooling would be a great addition the the game.

However if you look through those links I posted carefully you'll note that the only weapon related properties visible to script are what's in each slot and the primary weapon's range and all are read only. So basically we can't do anything with the players laser in script other than check what the player has got, and it's range. To do a 'laser cooler' properly would require something like a currentWeaponTemp property which is read/write.

What properties are and are not visible to script is set by the core game source code so any new properties would have to be implemented by the devs. You can request additions in the scripting requests thread, but I wouldn't get your hopes up because I think the feature freeze still applies until 1.76 and then who knows how development will progress after that.

edit 2 add - I get the impression that there is some fundamental reason that the devs haven't/ can't make more laser properties available - possibly something to do with the visible laser beam itself technically being a sub-entity of the ship.... (that may be wrong), and changing that would be a major rewrite of a big chunk of code.

Further edit to add -

Not sure if this would work but you could potentially have a feature in a particular ship by messing with view and weapon positions in the shipdata so that say all forward and side weapons and view positions actually face forward. Kind of would (badly) simulate cycling through 3 different (or 3 of the same) forward weapons. Downsides - you'll get anomolous view position console messages and you lose your side weapons and views, and it would have to be for a particular ship only.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: OXP Concept - Laser Switch

Post by Switeck »

When I first read this topic, I initially thought you meant something like this:
Semi-automatic/full-auto laser mode!
https://bb.oolite.space/viewtopic.php?f=6&t=10108

...which sadly is also impossible without the core game being modified. :(
It's being considered, but only if demand for it is higher.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: OXP Concept - Laser Switch

Post by JensAyton »

Capt. Murphy wrote:
Not sure if this would work but you could potentially have a feature in a particular ship by messing with view and weapon positions in the shipdata so that say all forward and side weapons and view positions actually face forward.
No. Weapon positions do not work that way.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: OXP Concept - Laser Switch

Post by Capt. Murphy »

Thanks Ahruman - that'll save Dragonfire some time then.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Post Reply