[RELEASE] Hyperspace Hangar OXP

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

Moderators: another_commander, winston

User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 360
Joined: Mon Sep 17, 2018 5:01 pm

Re: [RELEASE] Hyperspace Hangar OXP

Post by Milo »

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.

dybal
Deadly
Deadly
Posts: 220
Joined: Mon Feb 10, 2020 12:47 pm
Location: São Paulo, Brasil

Re: [RELEASE] Hyperspace Hangar OXP

Post by dybal »

Milo wrote:
Mon Jun 29, 2020 12:42 am
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.
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

User avatar
phkb
Commodore
Commodore
Posts: 2655
Joined: Tue Jan 21, 2014 10:37 pm
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...

Re: [RELEASE] Hyperspace Hangar OXP

Post by phkb »

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).
dybal wrote:
Mon Jun 29, 2020 2:12 am
I usually edit the savefile and remove all SHIP_VERSION equips, the correct one will be re-inserted by ShipVersion upon load
If you need to do that, it tells me that ShipVersion has a problem with it's setup routine.

User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 360
Joined: Mon Sep 17, 2018 5:01 pm

Re: [RELEASE] Hyperspace Hangar OXP

Post by Milo »

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.

dybal
Deadly
Deadly
Posts: 220
Joined: Mon Feb 10, 2020 12:47 pm
Location: São Paulo, Brasil

Re: [RELEASE] Hyperspace Hangar OXP

Post by dybal »

phkb wrote:
Mon Jun 29, 2020 4:04 am
dybal wrote:
Mon Jun 29, 2020 2:12 am
I usually edit the savefile and remove all SHIP_VERSION equips, the correct one will be re-inserted by ShipVersion upon load
If you need to do that, it tells me that ShipVersion has a problem with it's setup routine.
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)

Post Reply