multiple destID station dockscreens in deliveryMissions query

Freeform discussion about anything related to modding Transcendence.
Post Reply
relanat
Militia Captain
Militia Captain
Posts: 770
Joined: Tue Nov 05, 2013 9:56 am

Sat Aug 10, 2019 3:17 pm

The next version of the Loyal Fleet Settlements will include a 'deliveryMission' mission running from the "Barracks" action.

It all works very well thanks to the help of community members.
The player accepts the mission to go to a station, accept supplies from that station and deliver them to the owner station (Fleet settlement).

There is, however, no check against available cargo space in the playership hold. This could lead to the playership being overfilled.

I currently have the 'destID' station showing a different dockscreen if the player cannot fit all of the supplies. This dockscreen tells the player "you don't have enough room, come back later". Unfortunately pressing the "Continue" action in this screen does nothing, the same screen still shows. Another second press of "Continue" will undock the playership.

Ideally the "Continue" action would show the station's normal main dockscreen. This is what happens when the player does have enough room and collects the supplies. This would allow the player the option to sell some cargo to that station to make more room.
If the player did sell some items to the station it would require an undock and redock to get the supplies but this is acceptable IMO.

Is there a way to show another dockscreen in the destID station and then access the standard station's dockscreens using <OnDeliveryMissionCompleted>?

A search of other missions shows the <OnPaneInit> event in 'paneInitMissions. There is also the <OnGetNextScreen> event. Possibly one of these could be used instead?

Relevant code:

Code: Select all

<OnDeliveryMissionCompleted>
		;This code runs when the mission has been accepted and the playership
		;	docks with the 'destID' station.
		;If the player cannot fit all the supplies we tell them - show
		;	'descFitNone' - to have more cargo space available.
		;Once they have enough room, we add the supplies to the playership.
		;We set 'msnData 'destID' to Nil to stop a special dockscreen from
		;	showing again.
		;And we change 'msnData 'status' to 'gotSupplies' to reset the player
		;	target and allow us to check for mission completion when the
		;	playership docks with the owner station.
		;The screen description 'descGotSupplies' shows on docking with the
		;	destination station, then the standard station dockscreen.
	(block (
		(fitCount (objGetFitCount gPlayerShip (msnGetData gSource 'supplies)))
		)
		(switch
			(eq (msnGetData gSource 'status) 'needSupplies)
				(switch
					(geq fitCount 4)
						(block Nil
							(objAddItem gPlayerShip (msnGetData gSource 'supplies))
							(msnSetData gSource 'destID Nil)
							(msnSetData gSource 'status 'gotSupplies)
							(msnSetPlayerTarget gSource)
							(msnTranslate gSource 'descGotSupplies)
						)

					{
					desc: (msnTranslate gSource 'descFitNone)
					forceUndock: Nil
					}
				)
		)
	)
</OnDeliveryMissionCompleted>
Mission UNID in the attached xml file. Entire mod in the zip.
Attachments
FleetSettlementsUpdate.zip
(16.25 KiB) Downloaded 2 times
FleetSettlementMission01.xml
(21.77 KiB) Downloaded 3 times
Stupid code. Do what I want, not what I typed in!

Post Reply