scrAddAction dockscreen ID query

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

Fri Apr 08, 2016 6:21 am

I'm trying to add another action called "Nav Info" to the initial Korolov dockscreen using scrAddAction.

I'm not sure how to get the dockscreen identified because there isn't a UNID for it. It's just called "Dispatch"

From KorolovShipping.xml in 1.7a1a:

Code: Select all

	<StationType UNID="&stKorolovShipping;"
			name=				"Korolov Shipping"
			sovereign=			"&svCorporate;"
			dockScreen=			"Dispatch"
			abandonedScreen=		"&dsAbandonedStation;"
			dockingPorts=			"10"
			canAttack=			"true"
Further down:

Code: Select all

<DockScreens>
	<Dispatch>
		<InitialPane>
			(block (missionStatus missionID)
				(setq missionStatus (objGetData gSource "missionStatus"))
				(setq missionID (objGetData gSource "missionID"))

			plus a whole lot of code
		</InitialPane>

		<Panes>
			<Default>
				<OnPaneInit>
				(block (desc playerLevel)
					(setq playerLevel (korInitialize))
					(scrSetDesc gScreen (korMsgWelcome playerLevel))
				)
				</OnPaneInit>

				<Actions>
					<Action name="Escort Freighter" default="1" key="E">
						(block (playerLevel charonStronghold)
						plus more code from here
I'll be adding an action in this <Action> block.

I've tried (eq aPane "Default"), (eq aScreen "Dispatch") and (eq (shpGetDockObj gPlayerShip) &stKorolovShipping;) with them. Nothing works. Any examples of scrAddaction I have found aren't much help because they're already in the dockscreen code.
Or maybe I've messed up the syntax.
The xelerus functionlist has an example of (eq aScreen (objGetDataField gPlayerShip "shipStatusScreen") but I'm not sure how to change this to something about KorolovShipping.

Anyone got any ideas?
Here's an example of what I've got so far (not working):

Code: Select all

<OnGlobalPaneInit>
	(if (and
		(eq (shpGetDockObj gPlayerShip) &stKorolovShipping;)
		(eq aPane "Default"))
			(scrAddAction
			gScreen
			'addNavInfo
			3
			"Nav Info"
			"N"
			(block nil
				(plyMessage gPlayer "In Dockscreen")
				(dbgOutput printTo 'console "Working")
			)
		)
	)
</OnGlobalPaneInit>

shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1411
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska

Sat Apr 09, 2016 6:41 pm

ok: I am NOT a genius : just ask anybody :)

However, What I think you missed is that when an action is called into play is the settings to demand it :

such as - buy ( you can afford it ) or ( greyed out ) buy (because you can't)

the dock screen base itself can save you some trouble by adding your action to it, then in Korolov's Dispatch screen you set up your "situation call" to check and see if that function should be called out or not :

Such as : with Domina , when you go to the station, they all have the same screens, but the situation demand showing an action or screen besides the ones you might see normally .

(( Then you need to have the Pane or &ds built that you want the link to go to ))


Another suggestion is
A) building a new screen and totally swap out Korolov's ( not always the best option )

B) built a new primary landing pane which I call the "Dock Master" ( I do that often to check for situations like finding an item on the player ship and direct them to another Pane OR if they don't have it they stay right there and can not get past my Dock Master)

For your situation I would name it "dispatch" and if the player can go past send them to the original screen which you re-Named as "dispatch2"

Shane's Dock Master :

<Default>
<OnPaneInit>
(switch

(objGetData gSource "EncounterDone" )
(scrSetDesc gScreen "The Dock Master Greets you, \n\n"
"\"Good to see you again, %name%!\"")

(objGetItems gPlayerShip "*U +Ore;")
(scrShowPane gScreen "MeetTheAliensOfNebulaOne")
<!-- totally made up the Pane there for the post, I don't know any Aliens from Nebula One -->

(scrSetDesc gScreen "The Dock Master Greets you, \n\n"
"\"This is a Restricted Area, I will have to ask you to depart.\"")
)
</OnPaneInit>

<Actions>
<Action name="Undock" cancel="1" key="U">
<Exit/>
</Action>
</Actions>
</Default>
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..

relanat
Militia Commander
Militia Commander
Posts: 438
Joined: Tue Nov 05, 2013 9:56 am

Tue Apr 12, 2016 4:15 am

Thanks. I'll give it a go. I wanted to avoid building a totally new dockscreen. I always feel the less disruption to the Transcendence code the better.

relanat
Militia Commander
Militia Commander
Posts: 438
Joined: Tue Nov 05, 2013 9:56 am

Wed Apr 13, 2016 5:37 am

OK. Found it. In BenedictStoryArc.xml.

The screen needs the UNID in front of it in this format;

Code: Select all

(and (eq aScreen "0x00182001/Main") (eq aPane "Default"))
where '0x00182001' is the Sisters of Domina station (from HumanSpaceVol01.xml), 'Main' is the name of the station dockscreen and 'Default' is the pane where you want the action added.

Or for the Korolov Station;

Code: Select all

(and (eq aScreen "0x00102007/Dispatch") (eq aPane "Default"))
where '0x00102007' is the Korolov Station, 'Dispatch' is the Korolov station dockscreen and 'Default' is the pane where the action is to go.
Thanks, sjf. :D

Post Reply