Launching, docking and sub-entities

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

Moderators: winston, another_commander

Post Reply
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Launching, docking and sub-entities

Post by Smivs »

My current OXP project has a few problems with which I'd like some help or advice.
The ship in question has subents which are removed and replaced by script in certain situations. One of these situations is when it needs to dock. Now because the sub-ents are removed when the ship is docked this triggers a Maintenace Overhaul which is not desirable - the subents are supposed to be 'missing' at this point and do not require replacing. To avoid this I have been removing them as needed by the OXP (prior to docking) then adding them back with a shipDockedWithStation handler. On launch they are then removed again and this is successfully avoiding the overhaul from being called.
However this is causing other problems. Using the shipWillLaunchFromStation handler, the launch is messy - the docking tunnel effect flies off the top of the screen and often the ship launches at an angle to the station-buoy line. This suggests that the sub-ents are still present at the start of the tunnel effect and their removal at this moment is affecting the launch. Although I have not seen this myself, one of my co-conspirators reports that this also happens sometimes if shipLaunchedFromStation is used. Also, if shipLaunchedFromStation is used the subents (which aren't really supposed to be there at this point, remember) are visible as well, so not very satisfactory really.
So can anybody suggest a way the subents can be completely removed before the launch begins? Or better still is there any way of disabling the maintenace overhaul when it is caused by intentionally missing sub-ents?
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Launching, docking and sub-entities

Post by cim »

Smivs wrote:
So can anybody suggest a way the subents can be completely removed before the launch begins?
Monitor the guiScreenChanged event. Restore the subents when changing to the equipment screen (or the shipyard screen, since missing subents will affect trade-in price), remove them again when changing away.

Might not help when the player launches from the equipment screen, though.
Smivs wrote:
Or better still is there any way of disabling the maintenace overhaul when it is caused by intentionally missing sub-ents?
You could ship an equipment.plist which duplicated the EQ_RENOVATION item, except set the tech level to 99. You would then set it by script back to its usual value, except when you wanted to ensure no renovation could take place.

The catch: you'd then miss out on renovation requests caused by real maintenance needs, and have no way of detecting this in 1.76. (In 1.77 you can check player.ship.serviceLevel, but if this is the project I think it is, there's a much neater way of doing the whole thing in 1.77 that bypasses this problem entirely)
Post Reply