I am using Hyperspace Hangar and ShipVersion and Ship Configuration, and after I purchased a new ship and sold the old one, I have two different version equipments on the same ship. (When I try to remove the equipment via console, it comes back. Maybe related to how I got stuck with it?)
Aha. This is subtle. It's actually because of Ship Respray, I think! I did not realize the entityPersonality is used by ShipVersion OXP (in its $ShipVersion_Int function) as a default method of deriving the ship version if the ship's scriptInfo doesn't have a shipversion property (mine doesn't). I changed the personality through Ship Respray out of curiosity, having no idea what I was in for. I wonder if the ship when originally purchased had a scriptInfo shipversion property and lost it when I put it through the hangar.
[RELEASE] Hyperspace Hangar OXP
Moderators: winston, another_commander
Re: [RELEASE] Hyperspace Hangar OXP
Some shaders use the entityPersonality to pick the color scheme for the ship.
I think that (the double SHIP_VERSION equip after re-spray) happens even for "brand-new" ships, just bought.... and I think scriptInfo is read-only and linked to the dataKey of the ship, I don't know of anyway to change it without changing the ship's dataKey (which EscortDeck sometimes does to usable derelicts, trying to get a player-enabled version)
I usually edit the savefile and remove all SHIP_VERSION equips, the correct one will be re-inserted by ShipVersion upon load
- phkb
- Impressively Grand Sub-Admiral
- Posts: 4830
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: [RELEASE] Hyperspace Hangar OXP
One of the dangers of having ship properties used in two different ways by OXP's...
Most of Griff's normal-mapped ships use entityPersonality to control the colour of the ship, which is how Ship Respray is expecting it to be used. If ShipVersion is doing something else with the property I'm not sure what the best solution is (other than flagging Ship Respray as being incompatible with ShipVersion - which might be the safest thing to do).
Most of Griff's normal-mapped ships use entityPersonality to control the colour of the ship, which is how Ship Respray is expecting it to be used. If ShipVersion is doing something else with the property I'm not sure what the best solution is (other than flagging Ship Respray as being incompatible with ShipVersion - which might be the safest thing to do).
If you need to do that, it tells me that ShipVersion has a problem with it's setup routine.
Re: [RELEASE] Hyperspace Hangar OXP
ShipVersion could replace its use of entityPersonality with logic like this in the ship purchase event handler and elsewhere that currently keys off entityPersonality (possibly only the function I mentioned before?):
If there is a scriptInfo, use that.
If there is a missionVariable, use that. (Would need an update to Ship Storage Helper.)
If there is an existing EQ_SHIPVERSION_##, save the number in a mission variable, and use that.
If there isn’t any of those, put a random value in a mission variable, and use that.
Note the internal ShipVersion value is represented as an integer from 10 to 100 representing 1.0 to 10.0.
If there is a scriptInfo, use that.
If there is a missionVariable, use that. (Would need an update to Ship Storage Helper.)
If there is an existing EQ_SHIPVERSION_##, save the number in a mission variable, and use that.
If there isn’t any of those, put a random value in a mission variable, and use that.
Note the internal ShipVersion value is represented as an integer from 10 to 100 representing 1.0 to 10.0.
Re: [RELEASE] Hyperspace Hangar OXP
Yep, ShipVersion could remove all EQ_SHIP_VERSIONnn and then re-calculate the ship version and re-insert the correct equipment...
Actually, the mess with ShipRespray would be solved if ShipVersion only re-calculated the ship version if it didn't find any stored info on that, i.e., it used the ship's personality to obtain the ship version just once, stored the calculated value (it could be as an equipment as it's today) and never looked at the ship's personality again unless as a fail safe if the stored value was lost (if the player want to cheat, let him cheat, he would only be cheating himself)
Hyperspace Hangar OXP v1.17.0
Hyperspace Hangar v1.17.0 is available on the Expansion Manager and here
Changes:
The depreciation of the trade-in value when selling through HH is controlled by the variable this._shipDepreciation defined at the top of Scripts/hyperhangar.js, if anyone cares to customize how much it's depreciated... if many people tell me they are doing so, I will create a libconfig option to do it through Config fo AddOns at Station Interfaces.
The Ship in Transit issue was done due to the total in-game elapsed time when the player transferred a bunch of ships to the current system... the player had to choose the ships to be brought in one at a time and the game clock would advance as each one was chosen... as if the player had to wait for one ship to arrive before ordering the next one brought.
I think having to actually spend the in-game time until the ordered ship(s) arrives is more immersive: it leads you to pay attention to how long you spent in-station while your ship was in the shop for repairs or equipment installation/removal, for instance, and you better plan ahead to have a given ship available in a given ship when you arrive there.
Changes:
- Preserves libconfig options to savefile.
- Portable equipment is not passed on to bought ship if old ship was stored (since it was stored with the old ship... no equipment multiplication miracles...).
- Shows Station Interface even if no ship is stored in Hyperspace Hangar.
- When selling ships through HH the price is 15% of trade-in price (for balance when coupled with EscortDeck: pre-owned ship seller - selling usable derelicts through HH - was the most lucrative career I found in Oolite...).
- Damage might occur when switching into ships in station of TL<7 (the code was doing it at TL<8).
- Nest try/catch in the sell stored ship option so if an error occur when replacing ship we can revert the operation (the code "switchs" into the ship being sold to get its price, and that can go bad if the ship being sold can't be a player ship...)
- Check and reports insufficient funds for a ship transfer.
- Creates in-transit state for stored ships: ordering ships transferred to current system do not advance the game clock to the ship's arrival moment anymore.
- Fixes sell option station interface's screens flux.
- Selling a stored ship doesn't advance game clock.
- Expands "ships in transit" to sending ships to other systems.
- Shows ships in transit in the Hyperspace Hangar station interface.
- Transit time information in hours is displayed with single decimal digit
The depreciation of the trade-in value when selling through HH is controlled by the variable this._shipDepreciation defined at the top of Scripts/hyperhangar.js, if anyone cares to customize how much it's depreciated... if many people tell me they are doing so, I will create a libconfig option to do it through Config fo AddOns at Station Interfaces.
The Ship in Transit issue was done due to the total in-game elapsed time when the player transferred a bunch of ships to the current system... the player had to choose the ships to be brought in one at a time and the game clock would advance as each one was chosen... as if the player had to wait for one ship to arrive before ordering the next one brought.
I think having to actually spend the in-game time until the ordered ship(s) arrives is more immersive: it leads you to pay attention to how long you spent in-station while your ship was in the shop for repairs or equipment installation/removal, for instance, and you better plan ahead to have a given ship available in a given ship when you arrive there.
Re: [RELEASE] Hyperspace Hangar OXP
Known problem
The transfer option in the HH Station Interface allows the player to transfer any ship stored in HH to a different system (the one chosen as destination in the F6 chart).
Once a ship is chosen, a screen is displayed with data on the transfer: transit time and cost... the background is a chart with a route highlighted, but as it is now, there is no way to specify the origin of the route (it's always the current system), so the route will be OK if the ship being transferred is stored in the current system, but if it's in another system the origin of the route will be wrong.
The transfer option in the HH Station Interface allows the player to transfer any ship stored in HH to a different system (the one chosen as destination in the F6 chart).
Once a ship is chosen, a screen is displayed with data on the transfer: transit time and cost... the background is a chart with a route highlighted, but as it is now, there is no way to specify the origin of the route (it's always the current system), so the route will be OK if the ship being transferred is stored in the current system, but if it's in another system the origin of the route will be wrong.