[WIP] [UPDATE] Weapon Rotator OXP 0.3.2

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

Moderators: winston, another_commander

User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: [WIP] Weapon Rotator OXP 0.1.1

Post by Lone_Wolf »

What do you intend to do with the decrease in laser temperature during the rotation time ?

Both stopping the decrease and continuing will imo require an explanation/handwavium.

(No idea if it's possible to stop the decrease temporarily)
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Commander McLane
---- E L I T E ----
---- 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: [WIP] Weapon Rotator OXP 0.1.1

Post by Commander McLane »

Lone_Wolf wrote:
What do you intend to do with the decrease in laser temperature during the rotation time ?

Both stopping the decrease and continuing will imo require an explanation/handwavium.

(No idea if it's possible to stop the decrease temporarily)
Laser temperature cannot be messed with by script. I'm also curious how this one is tackled. A quick test shows that neither removing nor replacing a weapon influences the weapon temperature. In other words: rotating your weapons will not replace your overheated front laser with a cool side laser. The usual decrease just goes on as if no weapon was switched.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: [WIP] Weapon Rotator OXP 0.1.1

Post by Smivs »

I see that as a good thing - it avoids an obvious cheat! It could easily be explained way with a bit of handwavium like all the lasers have a common componant which gets hot with use, and when switching from say a mining laser to a military laser this componant is still hot and needs to cool down.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [WIP] Weapon Rotator OXP 0.1.1

Post by spara »

How about allowing the rotation of the weapons only if they are cooled down? Would make sense to me.
User avatar
holgerb
Average
Average
Posts: 12
Joined: Wed Mar 06, 2013 2:12 am

Re: [WIP] Weapon Rotator OXP 0.1.1

Post by holgerb »

spara wrote:
How about allowing the rotation of the weapons only if they are cooled down? Would make sense to me.
That would be a possible logical solution. I just saw that the LTs are read-only, so keeping them stuck to their appropriate laser, as I intended, will not work. Anyway, allowing rotation only, like you suggested spara, when they are cool, or maybe below a certain threshold, so that after the time they take to rotate, they will have cooled down anyway.

A threshold sounds nice to me, as it would make sense to rotate a "handwarm" laser, but forbid to rotate a boiling hot one.

What d'you think?
User avatar
holgerb
Average
Average
Posts: 12
Joined: Wed Mar 06, 2013 2:12 am

Re: [WIP] Weapon Rotator OXP 0.1.1

Post by holgerb »

I'm still wondering about what a good pricing would be...

If you think of it like a good tripod, which could easily exceed the costs of a medium camera. And then it should be a device that really has to be earned. So currently I'm thinking it might be better to raise the prices:

low budget device: ~3500-4500
pro device: ~ >8000

Suggestions?
User avatar
holgerb
Average
Average
Posts: 12
Joined: Wed Mar 06, 2013 2:12 am

Re: [WIP] Weapon Rotator OXP 0.1.1

Post by holgerb »

User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: [WIP] Weapon Rotator OXP 0.1.1

Post by Lone_Wolf »

The this.playerBoughtEquipment code looks weird to me.
It almost seems as if it immediately removes the equipment everytime it's bought AND gives a full refund.
Note : i haven't looked yet at the 1.77 equipment scripts, so it's possible i misunderstand how those work together with the worldscript.

Also your this.something naming could lead to problems, check https://bb.oolite.space/viewtopic.php?f=4&t=12149 (especially page 3).

As for the pricing : I have a feeling both may be to low, and there should be a bigger gap between low budget and pro version.

Apart from a higher break down for the LB version, you could also link the breakage chance to the cost of the laser setup.
example :
pulse lasers should have a low breaking chance as they are relatively simple/cheap.
military lasers and mining lasers should have a much higher chance.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
holgerb
Average
Average
Posts: 12
Joined: Wed Mar 06, 2013 2:12 am

Re: [WIP] Weapon Rotator OXP 0.1.1

Post by holgerb »

Lone_Wolf wrote:
The this.playerBoughtEquipment code looks weird to me.
It almost seems as if it immediately removes the equipment everytime it's bought AND gives a full refund.
Note : i haven't looked yet at the 1.77 equipment scripts, so it's possible i misunderstand how those work together with the worldscript.
This is to refund an already bought WP. Suppose you have the low budget version of the WP already installed. Now you buy the expensive version. You shall not have both of them installed concurrently. So your current one is removed, and refunded. The newly bought one then is installed. Sort of like if you buy a new front laser. I'd like to subtract a percentage according to it's wearlevel, but that's not yet implemented. I'd like to store the number of invocations in the saved player file somehow, or just take the ships wearlevel.
Lone_Wolf wrote:
Also your this.something naming could lead to problems, check https://bb.oolite.space/viewtopic.php?f=4&t=12149 (especially page 3).
Yepp, thanks I found the page already. I've changed it, but it might not yet have been pushed to github. I check-in quite frequently but push a little less frequently.
Lone_Wolf wrote:
As for the pricing : I have a feeling both may be to low, and there should be a bigger gap between low budget and pro version.

Apart from a higher break down for the LB version, you could also link the breakage chance to the cost of the laser setup.
example :
pulse lasers should have a low breaking chance as they are relatively simple/cheap.
military lasers and mining lasers should have a much higher chance.
That sounds like a good idea :) I'll figure out a formula for the wearlevel for the next release.

Holger
User avatar
holgerb
Average
Average
Posts: 12
Joined: Wed Mar 06, 2013 2:12 am

Re: [WIP] Weapon Rotator OXP 0.1.1

Post by holgerb »

Lone_Wolf wrote:
The this.playerBoughtEquipment code looks weird to me.
It almost seems as if it immediately removes the equipment everytime it's bought AND gives a full refund.
Note : i haven't looked yet at the 1.77 equipment scripts, so it's possible i misunderstand how those work together with the worldscript.
Well you're right, there actually was a bug in the code. While not noticable, once you had bought one version, it messed up the repair process and initialization. Fixed now, see Readme for details.
User avatar
holgerb
Average
Average
Posts: 12
Joined: Wed Mar 06, 2013 2:12 am

Re: [WIP] [UPDATE] Weapon Rotator OXP 0.2.0

Post by holgerb »

I released the new version 0.2.0. It comes with a bunch of new features and a few bugfixes. From the Readme:

Download (new link):
Sorry :oops: , accidentally instead of uploading a new version I uploaded a new file and removed the old file, thus invalidating the download link. Here's the new link:

https://www.box.com/s/882u5f8sah1uz4rcqm8z

Features:
  • Add a different damage probability to the LB and HQ version, leading to the LB version getting damaged three times as othen as normal equipment. The HQ version is more stable than normal equipment.
  • Add different sounds for both versions. The sounds are now split into start, loop and ending sound, thus allowing for a variable length of rotation.
  • The description of the lowcost device has been altered to sound like a cheap translation of a non-native speaker, like the descriptions often to be found in cheap imitations of products.
  • Add a different rotation time for both versions of the WR. The HQ device now rotates quite fast, while the LB device drags endlessly.
  • Add an operation counter, remembering the number of invocations. This is currently used in the refund calculation. It will in future also determine the malfunction probability of the LB device.
  • Increase the prices and add a bigger gap between both devices. Inexperienced pilots won't be able to get the original equipment to early.
  • Use special crosshairs indicating the rotation direction. The new crosshairs consist of 4 arrows in a row, in either left or right direction.
Bugfixes:
  • Fix the check of the equipment presence. Due to a misunderstanding the function EquipmentInfo.infoForKey("EQ_XXX") had been used to determine, whether an equipment is present. This is wrong, it justs reveals, if the equipment is known at all to Oolite. To find out whether it is attached to the ship, we have to use player.ship.equipmentStatus. This created an issue in the playerBoughtEquipment event, leading to an unwanted refund when repairing a damaged WR. It also messed up the initialization process, leading to the wrong equipment being used at startup.
  • Rename custom functions to _XXX. While this is not really a bug it is still best practice and avoids future collisions with new event handlers.
Misc: Thanks for all the good ideas. Have fun. Testing and bug reports greatly appreciated.

Holger
User avatar
holgerb
Average
Average
Posts: 12
Joined: Wed Mar 06, 2013 2:12 am

Re: [WIP] [UPDATE] Weapon Rotator OXP 0.3.2

Post by holgerb »

Alright, just before easter there's a new release including the long awaited auto-rotator. This includes a lot of code refactoring. It should now conform to the OXP development practice.

Here's an excerpt of the changelog:

Features:
- The main feature of this new version is the added autorotator. It is sold
at a market price of 2890.0 Cr, with a damage probability of 1.0. The
autorotator when invoked with 'n', stores the current weapon rotator
position. On a red alert it automatically rotates to the stored position.
- Forbid rotating, if at least one of the lasers is too hot. The LB version
needs a temperature below 0.1, HQ below 0.25, which is the green temperature
level in the laser temp gauge.
- Account for a damaged WR in refund, when buying a new device. If the player
instead of repairing a damaged device buys the alternative WR the refund is
cut by half.

Changes
- Reorder the stopping and starting of the sound to avoid a possible gap.
The loop sound is now started before the start is stopped. The same way
the finish sound is started, before the loop is stopped. This is to avoid
a possible gap of silence.
- Change variable names to start with '_'. While this was already done for
functions, it wasn't for variables.
- Work heavily on restructuring the code to be more readable and better
documented.

Bugfixes:
- Fix the floating point calculation jitter in refund calculation. When the
usage count is 0 and the WP is exchanged (HQ<->LB) the full market value is
refunded. The calculation function returned something a little less than 1
due to floating point rounding errors. This lead to a refund just a little
less than the original value when replacing a brand new WR.

Have fun and Happy Easter!

Holger
User avatar
Josef
Competent
Competent
Posts: 60
Joined: Sat May 29, 2021 6:20 pm
Location: Wien

Re: [WIP] [UPDATE] Weapon Rotator OXP 0.3.2

Post by Josef »

Hi everybody,
does anybody know, how much that equipment costs and at what TL it is possible to buy it?
Josef
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 462
Joined: Mon Sep 17, 2018 5:01 pm

Re: [WIP] [UPDATE] Weapon Rotator OXP 0.3.2

Post by Milo »

After you download an OXP, you can use the expansion manager to extract it.

Switch the expansion manager to “list installed” mode, highlight the OXP in the list, and press ‘x’ on your keyboard. It will extract a copy of all the OXP files into your AddOns folder (the screen in the expansion manager will explain this too). This does not affect the OXP itself, it’s just a copy.

You can look in there, specifically look for an equipment.plist file in the Config sub-folder instead the OXP. You can open plist files with any text editor. It will show you the price and tech level for every piece of equipment in the OXP.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5372
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [WIP] [UPDATE] Weapon Rotator OXP 0.3.2

Post by Cholmondely »

Josef wrote: Sun Jul 18, 2021 4:30 pm
Hi everybody,
does anybody know, how much that equipment costs and at what TL it is possible to buy it?
Allow me, Sir, to introduce you to the entrails of this oxp:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>

  <array>
    <integer>7</integer>
    <integer>38300</integer>
    <string>Bore &amp; Ratter Weapon Rotator</string>
    <string>EQ_LB_WEAPON_ROTATOR</string>
    <string>This is famus Bore &amp; Ratter weapon rottator. It weapon clockweise or anticlockweise circles through your front, afft, coreboard and pord weapon mounds. You nedd in combat situation without it. It helps perfactly to stitch betwen your lasers, do ring mining and fighting coombat.</string>
    <dict>
      <key>available_to_all</key>     <true/>
      <key>script</key>               <string>WeaponRotator-LowBudgetEquipment.js</string>
      <key>damage_probability</key>   <real>3.0</real>
    </dict>
  </array>

  <array>
    <integer>11</integer>
    <integer>92500</integer>
    <string>Bore &amp; Ratter Weapon Rotator</string>
    <string>EQ_HQ_WEAPON_ROTATOR</string>
    <string>The Bore &amp; Ratter weapon rotator circles your weapons clockwise or anticlockwise through your front, aft, storeboard and port weapon mounts. This high precision equipment will help you in combat situations, during mining or in all other situations. It ensures that you will always have the weapon of your choice up front.</string>
    <dict>
      <key>available_to_all</key>     <true/>
      <key>script</key>               <string>WeaponRotator-HighQualityEquipment.js</string>
      <key>damage_probability</key>   <real>0.75</real>
    </dict>
  </array>

  <array>
    <integer>11</integer>
    <integer>28900</integer>
    <string>Emergency autorotator</string>
    <string>EQ_AUTOMATIC_WEAPON_ROTATOR</string>
    <string>This device plugs into your status system and your "Bore &amp; Ratter" weapon rotator. In case of a hostile alert condition, it rotates your weapons automatically to a previously stored combat position.</string>
    <dict>
      <key>available_to_all</key>         <true/>
      <key>script</key>                   <string>WeaponRotator-AutoRotatorEquipment.js</string>
      <key>damage_probability</key>       <real>1.0</real>
      <key>requires_any_equipment</key>   <array>
                                            <string>EQ_LB_WEAPON_ROTATOR</string>
                                            <string>EQ_HQ_WEAPON_ROTATOR</string>
                                          </array>
    </dict>
  </array>

<!--
  <array>
    <integer>11</integer>
    <integer>100</integer>
    <string>Weapon Rotator Shielding</string>
    <string>EQ_SHIELD_WEAPON_ROTATOR</string>
    <string>This additional shield system protects your "Bore &amp; Ratter" weapon rotator from laser fire.</string>
    <dict>
      <key>available_to_all</key>     <true/>
      <key>script</key>               <string>WeaponRotator-RotatorShieldEquipment.js</string>
      <key>damage_probability</key>   <real>0.25</real>
    </dict>
  </array>
-->

</array>
</plist>

Beware the spelling mistakes! Oh - and the decicredit snare - and the TL which is one off the actual!
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Post Reply