mission queries

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

Thu Oct 11, 2018 3:38 am

It sounded so easy. Use Xephyr's mission example topic for reference and blend the Juan mission with the Fleet supplies mission and create a simple new mission!

Mostly working. Just as couple of things I can't work out.

The mission runs from Fleet settlements in the Loyal Fleet Settlements mod.

On selecting the "Barracks" action in the station the player gets the option to accept a 'get supplies from a nearby station' mission. These supplies are returned to the original station and the player gets a reward.

It works as required up until the player docks at the 'supply' station. Ideally a screen would show where the player meets a dockmaster and is told the supplies have been placed in the cargo hold. But I can't work out how to get an initial custom dockscreen to show. Whenever I have any success at all, the dockscreen doesn't appear until the player undocks from the station.
1. How do you make a dockscreen appear first on docking at the 'supply' station?

Several of the screens require double exits to get out. EIther a "Continue" then "Done" action or two "Continue" actions.
These include the "inProgress" screen which shows at the Fleet settlement before the player collects the supplies, the mission failed screen "Thanks for nothing" when the player collects the supplies but doesn't have them on returning to the Fleet settlement and the mission success screen.
But not the 'mission failed because the supply station was destroyed' screen.

The desired outcome is for the player to be 'forceUndock'ed if the "Thanks for nothing" message shows. This happens but only after the two actions. All other options should navigate the player to the default Fleet settlement dockscreen.
2. Why are the two actions required to exit a screen and how can the exit be directed to either the default station dockscreen or 'forceUndock'?

This is part of the mission code.

Code: Select all

		;If we have arrived at the supply station show an appropriate pane somehow and add the supplies.
		(and (not (msnGetData gSource 'status))
			(= aObjDocked gPlayerShip)
			(= (objGetID aDockTarget) (msnGetData gSource 'supplyID))
			(block Nil
				(objAddItem gPlayerShip (itmCreate &itRedNebulaBeer; 1) 4)
				(msnSetData gSource 'missionCargo (objGetItems gPlayerShip "*+unid:&itRedNebulaBeer;;"))
				(msnSetData gSource 'status 'gotIt)
				(msnSetPlayerTarget gSource)

	;XXXXXX Confused why the target needs to be set on both OnObjDocked and OnSetPlayerTarget. XXXXXX
			;If we have the supplies then return to Fleet Settlement.
		(eq (msnGetData gSource 'status) 'gotIt)
			(rpgSetTarget gSource aReason (objGetObjByID (msnGetData gSource 'destID)) 'dock)

			;Otherwise go get them.
		(rpgSetTarget gSource aReason (objGetObjByID (msnGetData gSource 'supplyID)) 'dock)
The 'supply' station is highlighted until the player docks and collects the supplies. Then the Fleet settlement gets highlighted until the player returns.
But highlighting the Fleet settlement takes two lots of code.

Code: Select all

(msnSetPlayerTarget gSource) in <OnObjDocked>
(rpgSetTarget gSource aReason (objGetObjByID (msnGetData gSource 'destID)) 'dock) in <OnSetPlayerTarget>
If either of these is removed the Fleet settlement doesn't get highlighted.
3. What is the appropriate way to highlight the Fleet settlement in this mission?

The mission is accepted from the "Barracks" action in the Fleet settlement.
It uses Text ids "Intro" and "Briefing". These use respectively "Continue" and "Accept/Decline" as their actions.
4. Is it possible to override these actions with "Maybe" and "I can do that for you/No thanks, I'm busy"?

If the player destroys the 'supply' station they can be arrested by the Fleet. If they get their Fleet status revoked the mission doesn't cancel and the Fleet settlement remains highlighted. The player cannot then dock with the station.
5. How can the mission be cancelled if the player has their military status revoked?

The mod is attached and for convenient testing a Fleet settlement is automatically created in Eridani and a military ID added to the playership.
Fleet mission.zip
(9.74 KiB) Downloaded 58 times
Stupid code. Do what I want, not what I typed in!

Militia Lieutenant
Militia Lieutenant
Posts: 104
Joined: Thu Apr 07, 2011 9:05 pm

Thu Oct 11, 2018 7:22 pm

Your main problem is you are using the special deliveryMission data destID set to the same as ownerID. I understand why you have done this - the mission is to deliver supplies to the source station! However, in terms of how the missions work a deliveryMission just shows a special dockscreen when you arrive at destID. In your case, when the player returns to the original station the mission will first show the “arrived at destination” screen then it will show the normal InProgress / Success / Failure screens (which is why you are need to double exit at the moment)

1. Change destID to the ID of the supply object.
<OnDeliveryMissionCompleted> will now trigger when you dock with the supply object. You should add the cargo to the player, clear destID (so the screen will only show once), call (msnSetTarget), and then show the “Hello, here is the shipment” text.

There is no need for unidDockmaster or dsD789MeetDockmaster Types unless you want to display a really complicated dockscreen

2. Change <OnObjDocked> to check if the delivery (to owner) is complete
i.e. if the player has returned with cargo remove it and call (msnSuccess)
if the player has lost the cargo call (msnFailure)

The game will then automatically display the appropriate Success / Failure / InProgress text.

3. msnSetPlayerTarget tells the game to call the OnSetPlayerTarget event
This happens automatically when you accept the mission (also changing system, succeeding, or failing will trigger the event).

4. Use AcceptLabel and DeclineLabel
Example from Benedict00.xml
<String id="AcceptLabel">"[Y]es, I need practice."</String>
<String id="DeclineLabel">"[N]o, thanks."</String>

5. In this case I would register for events from the supply station and simply fail the mission if
a) it is destroyed before the player collects the supplies
b) the player destroys it at any time (plus set a flag so you can display some special text)

If you want to detect if the player has lost they military ID for any other reason you could add a check in one of the events to make sure they still have a military ID

PS - for another example of a “go and collect supplies” mission see eternity port NAUMission02.xml
This uses <OnObjDocked> to check when the player has returned with supplies and calls success/failure. However, it does not override the dock screens at the supply station (the player is expected to buy them in commodities exchange.

Militia Captain
Militia Captain
Posts: 846
Joined: Tue Nov 05, 2013 9:56 am

Fri Oct 19, 2018 2:04 am

Much better. And very well explained.Thanks.
I've just found the wiki mission page as well http://wiki.kronosaur.com/modding/xml/m ... []=mission which is great. Well done to whoever did that. (Now if only the stupid Twitch site would work, grrr.)

There are also mission comments in CommonwealthMission01.xml. These have been expanded in the current git version too.

And thanks for the tip on the EP mission. Never seen that one before.
Stupid code. Do what I want, not what I typed in!

Post Reply