HOW DO I SHOT DOCKSCREEN

Freeform discussion about anything related to modding Transcendence.
Post Reply
schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

Code: Select all

<!--Stephinian-Modified Commonwealth Colony-->
	<StationType UNID="&stStephinianColony;"
			name=				"(Stephinian modified commonwealth colony)"
			sovereign=			"&svCommonwealth;" 
			dockScreen=			"Main"
			abandonedScreen=	"&dsAbandonedStation;"
			dockingPorts=		"8"
			canAttack=			"true"

			multiHull=			"true"
			armorID=			"&itLeadMeroviateArmor;"
			maxHitPoints=		"500000"
			hitPoints=			"500000"
			repairRate=			"25"
			shipRepairRate=		"25"
			explosionType=		"&vtBlastExplosion3;"
			ejectaType=			"&vtWreckEjecta;"

			attributes=			"Stephinian,friendly,primary,populated"
			levelFrequency=		"----- uuucc ccccc ----- -----"
			locationCriteria=	"-planetary,+OuterSystem,+void"
			enemyExclusionRadius="50"
			>

		<Names noArticle="true">
				Stephinian Station %s %1%0%0%0;</Names>

		<Image			imageID="&rsStations1;" imageX="0" imageY="256" imageWidth="128" imageHeight="128"/>

		<Devices>
			<Device deviceID="&itSDW190;"	omnidirectional="true"/>
		</Devices>

		<Items>
			<RandomItem count="10" 
					criteria=		"ad -Illegal; -Specialty; -NotForSale;"
					level=			"5"
					levelCurve=		"3"
					/>
			<RandomItem count="10" 
					criteria=		"* -Illegal; -Specialty; -NotForSale;"
					level=			"7"
					levelCurve=		"3"
					/>
			<RandomItem count="3" 
					criteria=		"* -Illegal; -Specialty; -NotForSale; +Stephinian;"
					level=			"9"
					levelCurve=		"5"
					/>

			<Item count="7d12"	item="&itHadronVacuumFuelCell;" />
		</Items>

		<Trade currency="credit" creditConversion="100" max="250000" replenish="2500">
			<Sell	criteria="*NU -Illegal; -ID; -NotForSale;"	priceAdj="110"/>
			<Buy	criteria="amswNU -Illegal; -NotForSale;"		priceAdj="50"/>
			<Buy	criteria="*NU -Illegal; -ID; -NotForSale;"	priceAdj="90"/>
			<Buy	criteria="*NU -Illegal; -ID;"				priceAdj="10"/>
		</Trade>

		<Ships>
			<Lookup count="2" table="&tbCommDefenders;"/>
			<Lookup count="1d4" table="&tbCommPrivateCrafts;"/>
		</Ships>

		<Reinforcements minShips="5">
			<Table>
				<Lookup chance="75" table="&tbCommDefenders;"/>
				<Lookup chance="25" table="&tbCommPrivateCrafts;"/>
			</Table>
		</Reinforcements>
		
		<StaticData>
			<NPCService>
				(	;	service					level	margin
					(	'repairArmor			9		100		)
					)
			</NPCService>
		
			<!--
			The first code block must return a string describing the
			mission (or Nil, if a mission could not be found).

			The code should also place any data about the mission in global variable
			that can be accessed by the second code block.

			The second code block initiates the mission from global variables
			set by the first code block. It should permanently store the mission
			as object data.

			The third code block returns a string describing the success of
			the mission (or Nil, if the mission is in progress)
			-->

			<!-- Level 1 Missions -->

			<Missions1>
				(
					; Destroy Target
					("mission1a"
						; Code to describe mission
						(lambda Nil
							(block Nil
								(switch
									; Otherwise, OK
									(cat "\"Rogue elements have taken over a ship that we've tracked to this system. Slaughter those sons of bitches for us and you'll be compensated generously.\"")
									)
								)
							)

						; Code to initiate mission
						(lambda Nil
							(block (targetPos roll)
								; Pick a random location for the target
								(setq targetPos (sysVectorRandom gSource (random 300 600) 250))

								; Create targets
								(setq roll (random 1 100))
								(switch
									; Target is Modified Corsair
									(leq roll 100)
										(block (theShip)
											(setq theShip (sysCreateShip &scStephinianCorsair; targetPos &svRogueStephinians;))
											(shpOrder theShip 'waitForTarget gPlayerShip)
											(shpOrder theShip 'attack gPlayerShip)
											(shpOrder theShip 'attack gSource)

											(objSetObjRefData gSource "Target1" theShip)
											(objRegisterForEvents gSource theShip)

											(objSetData gSource "TargetCount" 1)
											)

									<!--; Target is wing of Sandstorms
									(leq roll 90)
										(block (shipCount theLeader)
											(setq shipCount 35)
											(objSetData gSource "TargetCount" shipCount)

											(for i 1 shipCount
												(block (theShip)
													(setq theShip 
														(sysCreateShip &scSandstorm;
															(sysVectorPolarOffset
																targetPos
																(random 0 359)
																(add (random 1 12) (random 0 12))
																)
															&svAres;
															)
														)
														
													(if (not theLeader)
														(block Nil
															(shpOrder theShip 'waitForTarget gPlayerShip)
															(shpOrder theShip 'attack gPlayerShip)
															(shpOrder theShip 'attack gSource)
															(setq theLeader theShip)
															)
														(shpOrder theShip 'escort theLeader)
														)

													(objSetObjRefData gSource (cat "Target" i) theShip)
													(objRegisterForEvents gSource theShip)
													)
												)
											)

									; Target is flight of Deimos destroyers
									(block (shipCount theLeader)
										(setq shipCount 3)
										(objSetData gSource "TargetCount" shipCount)

										(for i 1 shipCount
											(block (theShip)
												(setq theShip 
													(sysCreateShip &scDeimos;
														(sysVectorPolarOffset
															targetPos
															(random 0 359)
															(add (random 1 12) (random 0 12))
															)
														&svAres;
														)
													)
													
												(if (not theLeader)
													(block Nil
														(shpOrder theShip 'waitForTarget gPlayerShip)
														(shpOrder theShip 'attack gPlayerShip)
														(shpOrder theShip 'attack gSource)
														(setq theLeader theShip)
														)
													(shpOrder theShip 'escort theLeader)
													)

												(objSetObjRefData gSource (cat "Target" i) theShip)
												(objRegisterForEvents gSource theShip)
												)
											)
										)
									)-->

								(objSetData gSource "TargetsDestroyed" 0)

								; Point player at target
								(shpCancelOrders gPlayerShip)
								(shpOrder gPlayerShip 'attack (objGetObjRefData gSource "Target1"))
								)
							)

						; Code to see if mission has been completed
						(lambda Nil
							(block (shipsLeft shipsLeftText)

								(scrSetDesc gScreen (cat "\"Nice job meaty. Come back later and we'll see about mutiliting some more of those freaks.\""))
									

								; Increment XP
								(objIncData gPlayerShip "stephinianXP" 2000)
								;Give CASHMONEHS
								(plyCredit gPlayer (mul (random 3 7) 1000))
								)
							)

						; Code on failure
						(lambda Nil
							(scrSetDesc gScreen "\"You screwed that mission all the way to Sol and back. You better hit the sims, pilot!\"")
							)
						)
				)
			</Missions1>
			
		</StaticData>

		<Events>
			<!--I don't know what any of this stuff does, so I'm just gonna comment it out.-->
			<!--<OnCreate>
				(sysAddObjRecurringTimerEvent 150 gSource "OnTrafficControl")
			</OnCreate>
			
			<OnContractGenerate>
				(intGenerateStandardRequestContract1)
			</OnContractGenerate>

			<OnContractQuery>True</OnContractQuery>

			<OnDestroy>
				(intCommonwealthOnDestroy)
			</OnDestroy>

			<OnTrafficControl>
				(comTrafficControl gSource 10)
			</OnTrafficControl>-->
			
			<OnObjDestroyed>
				(if (eq (objGetData gSource "MissionStatus") "inprogress")
					(block (missionID)
						(setq missionID (objGetData gSource "MissionID"))
						(switch
							; If the player was destroyed, stop the mission
							(eq aObjDestroyed gPlayerShip)
								(block Nil
									(objSetData gSource "MissionStatus" "failure")
									(shpCancelOrders gPlayerShip)

									; Disperse wingmen
									(intFleetDisperseWingmen gSource 10)
									)
									
							(eq missionID "mission1a")
								(block Nil
									(for i 1 (objGetData gSource "TargetCount")
										(if (eq aObjDestroyed (objGetObjRefData gSource (cat "Target" i)))
											(block Nil
												(objIncData gSource "TargetsDestroyed")
												(objSetObjRefData gSource (cat "Target" i) Nil)

												; If we destroyed all targets, then we're done. Otherwise
												; we point the player at a new target

												(if (eq (objGetData gSource "TargetCount") (objGetData gSource "TargetsDestroyed"))
													(block Nil
														(plyMessage gPlayer "Mission complete!")
														(objSetData gSource "MissionStatus" "success")
														)
													(block (foundTarget)
														(for i 1 (objGetData gSource "TargetCount")
															(block (theTarget)
																(setq theTarget (objGetObjRefData gSource (cat "Target" i)))
																(if (and theTarget (not foundTarget))
																	(block Nil
																		(shpCancelOrders gPlayerShip)
																		(shpOrder gPlayerShip 'attack theTarget)
																		(setq foundTarget True)
																		)
																	)
																)
															)
														)
													)
												)
											)
										)
									)
							)
						)

					; Even if mission is no longer in progress we track wingmen
					(block (missionID)
						(setq missionID (objGetData gSource "MissionID"))
						(switch
							(eq missionID "mission4b")
								(for i 0 5
									(if (eq aObjDestroyed (objGetObjRefData gSource (cat "Wingman" i)))
										(objIncData gSource "WingmenDestroyed")
										)
									)
							)
						)
					)
			</OnObjDestroyed>

			
		</Events>

		<DockScreens>
			<Main
				name=			"=(objGetName gSource)"
				>

				<OnInit>
				</OnInit>

				<InitialPane>
					(block (missionID missionStatus)
						(setq missionID (objGetData gSource "MissionID"))
						(setq missionStatus (objGetData gSource "MissionStatus"))
						
						; If we're in the middle of the fleetDelivery mission and we can't
						; dock with the target, then we fail
						(if (and (eq missionID 'mission1b)
								(eq missionStatus 'inprogress)
								(objIsAngryAt (objGetObjRefData gSource "Target") gPlayerShip))
							(block Nil
								(setq missionStatus "failure")
								(objSetData gSource "MissionStatus" missionStatus)
								(shpCancelOrders gPlayerShip)
								)
							)
						
						(switch
							(eq missionStatus "inprogress")
								"MissionInProgress"

							(eq missionStatus "failure")
								"MissionFailure"

							(eq missionStatus "success")
								"MissionSuccess"

							"Default"
							)
						)
				</InitialPane>

				<Panes>
				
					<Default
							desc=	"You are in the docking bay of a standard Commonwealth colonly that has been salvaged and upgraded by Stephinians. Robots of all sizes roll around on treads and wheels, with the occasional actual Stephinian giving orders to them.">

						<Actions>
							<Action name="Commodities Exchange" default="1" key="C">
								<ShowPane pane="CommoditiesExchange"/>
							</Action>

							<Action name="Dock Services" key="D">
								<ShowPane pane="DockServices"/>
							</Action>

							<Action name="Undock" cancel="1" key="U">
								<Exit/>
							</Action>
							
							<Action name="Station Command" default="1" key="S">
								<ShowPane pane="StationCommand"/>
							</Action>
							
							<Action name="Recreational Facilities" default="1" key="R">
								<ShowPane pane="Bar"/>
							</Action>

						</Actions>

					</Default>

					<CommoditiesExchange>

						<Initialize>
							(scrSetDesc gScreen (cat "Welcome to the " (objGetName gSource) " Commodities Exchange Market."))
						</Initialize>

						<Actions>
							<Action name="Buy items" default="1" key="B">
								(comShowBuyScreen 
									"*"						; items sold to player
									"Main"					; return screen
									)
							</Action>

							<Action name="Sell items" key="S">
								(comShowSellScreen
									"*"						; items bought from player
									"Main"					; return screen
									)
							</Action>

							<Action name="Done" cancel="1" key="D">
								<ShowPane pane="Default"/>
							</Action>

						</Actions>

					</CommoditiesExchange>

					<DockServices
							desc=	"You are at the docking services terminal.">

						<Actions>
							<Action name="Refuel" key="R">
								(block Nil
									(setq gPrevScreen "Main")
									(setq gPrevPane "DockServices")
									(intSetCompatibleFuel '((&itHadronVacuumFuelCell; 25)))
									(scrShowScreen gScreen "&dsRefuel;")
									)
							</Action>

							<Action name="Repair or replace armor" key="A" >
								(block Nil
									(setq gPrevScreen "Main")
									(setq gPrevPane "DockServices")
									(setq gTechLevel 20)
									(setq gArmorSegment 0)
									(setq gCheckMilitaryID True)
									(setq gMargin 100)
									(scrShowScreen gScreen "&dsRepairArmor;")
									)
							</Action>

							<Action name="Done" cancel="1" key="D">
								<ShowPane pane="Default"/>
							</Action>

						</Actions>
					</DockServices>
					
					<StationCommand
				name=			"Station Command"
				desc= "HURR"
				>
					<InitialPane>
					"Default"
					</InitialPane>

				<Panes>
					
				
					<Default>
						<Initialize>
							(block (nil)
								(setq gLevel (objGetData gPlayerShip "stephiniansLevel"))
								(scrSetDesc gScreen
											"A tall android in a tuxedo looks up at you as you enter."
											"\"Looking for something to do, human?\""
											)
											(setq gPrevScreen "StationCommand")
											(setq gPrevPane "Default")
											(setq gMissionTitle "Station Command")
											
											(setq gMissionListName (cat "Missions" (objGetData gPlayerShip "stephiniansLevel")))
											
											(if (gr (objGetData gPlayerShip "fleetTFSuccess") 0)
												(setq gMissionNoneText "\"Sorry, there are no missions available for you.\"")
												(setq gMissionNoneText "\"Sorry, there are no missions available for you.\"")
												)
												
											(setq gMissionAcceptText (plyComposeString gPlayer "\"Good luck.\""))
											(setq gMissionDeclineText "\"Mmh. Your choice.\"")
											(scrShowScreen gScreen "&dsMission;")
								)
												
							</Initialize>
						</Default>

						<MissionFailure>
						<Initialize>
							(block (success failure)
								; Get the mission
								(setq gMission (objGetData gSource "Mission"))

								; Execute the post-mission code (which must set the description).
								(apply (eval (item gMission 4)) Nil)
								)
						</Initialize>

						<Actions>
							<Action name="Continue" default="1" cancel="1" key="C">
								(block (success failure)
									(objSetData gSource "MissionStatus" Nil)

									(setq success (objGetData gPlayerShip "stephinianTFSuccess"))
									(setq failure (add (objGetData gPlayerShip "stephinianTFFailure") 1))
									(objSetData gPlayerShip "stephinianTFFailure" failure)

									(scrShowPane gScreen "Default")
									)
							</Action>
						</Actions>
					</MissionFailure>

					<MissionInProgress
							desc=""What is your major malfunction!? Get back out there and complete your mission!"">

						<Actions>
							<Action name="Continue" default="1" cancel="1" key="C">
								<Exit/>
							</Action>
						</Actions>
					</MissionInProgress>

					<MissionSuccess>

						<Initialize>
							(block (success failure)
								; Get the mission
								(setq gMission (objGetData gSource "Mission"))

								; Execute the post-mission code (which must set the description).
								(apply (eval (item gMission 3)) Nil)

								; Update mission success/failures
								(setq success (add (objGetData gPlayerShip "stephinianTFSuccess") 1))
								(setq failure (objGetData gPlayerShip "stephinianTFFailure"))
								(objSetData gPlayerShip "stephinianTFSuccess" success)

								; Done with mission
								(objSetData gSource "MissionStatus" Nil)
								)
						</Initialize>

						<Actions>
							<Action name="Continue" default="1" cancel="1" key="C">
								(block Nil
									; If see if we got promoted
									(if (intFleetPromotion)
										(block Nil
											(setq gPrevScreen "Main")
											(setq gPrevPane "Default")
											(setq gName Nil)
											(scrShowScreen gScreen "&dsFleetPromotion;")
											)
										(scrShowPane gScreen "Default")
										)
									)
							</Action>
						</Actions>
					</MissionSuccess>
					</Panes> <!--I'M CONFUSED :( -->
				</StationCommand>
				
					<Bar>
					<Initialize>
					(block (nil)
					(setq gPrevScreen "Main")
					(setq gPrevPane "Default")						

					(setq stringselect (random 0 1))
						(scrSetDesc gScreen
							(switch

								(eq stringselect 0)
								"Hiamamoo!"
								(eq stringselect 0)
								"Wuuuuu...."



							
							
						))
					
					<!--(scrSetDesc gScreen cat("The colony's recreational facilities are somewhat spartan compared to the decadent facilities on a large Commonwealth station, but they're better than what the station originally had." conversation))-->
					)
					</Initialize>
					
					<Actions>
						<Action name="Leave" cancel="1" key="L">
							<ShowPane pane="Default"/>
						</Action>
					</Actions>
					
					</Bar>
				</Panes>
			</Main>						

		</DockScreens>

		<DockingPorts>
			<Port x="0"		y="90" />
			<Port x="0"		y="-90" />
			<Port x="60"	y="60" />
			<Port x="60"	y="-60" />
			<Port x="90"	y="0" />
			
			<Port x="-90"	y="0" />
			<Port x="-60"	y="60" />
			<Port x="-60"	y="-60" />
		</DockingPorts>

	</StationType>
I'm confused :(

I can't seem to make the mission thingy work. At all. The "HURR" is just to show that it ain't working. I've been screwing with it for three days and I honestly have very little idea what I'm doing.

When I try to go to the pane what assign missions it just shows me the desc= in the pane tag and no options.
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

Hmm, I would like to help, but that is horrible to read. Could you not format it a bit, and stick it on the pastebin. Perhaps use the @@ syntax of pastebin to highlight the lines you are having trouble with?
schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

http://transcendence.pastebin.com/h9jRMp2h

I don't actually know what the problem is, if I did I'd fix it. The code inside <Stationcommand><Default><Initialize> isn't running, I don't know why.
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

For startes you need a (cat ...) around the text in scrSetDesc

If that does not fix it, try putting some dbgLog statements in there, and see where it stops execution
schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

Changed line 473 to (scrSetDesc gScreen cat( and added a second close parenthesis in the expected location, no effect. Gonna try the debugLog stuff now.

EDIT:

Stuck (dbgLog ) statements into the code. As I suspected, it isn't running at all.
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

OK, after a closer look i think i see what you are doing wrong. The StationCommand screen is just a pane, not a screen of it's own. If you want it to be a screen of it's own, then you need to close the previous tags properly. If you just want it to be a pane, then it can not have the name="" attribute or the <InitialPane> element

Look at how the screens of stKorolovShipping in KorolovShipping.xml are made
User avatar
ThePrivateer
Militia Captain
Militia Captain
Posts: 943
Joined: Tue Oct 12, 2010 5:12 am
Location: Starton Australia

Wow that was really long and hard to read, but I have worked with Dockscreens a fair bit in Hell's Trinity (yeah I know I seem to drop that in every post I make ;) ).

Basically, the distinction is between <Dockscreens>, <Dockscreen> and a <Pane>

<Dockscreen> (NO "s") is a standalone &ds UNID. Like this:

Code: Select all

<DockScreen UNID="&dsLincolnStation;"
name=				"=(objGetName gSource)"
>
....
</DockScreen>
This must be defined as an <!ENTITY dsNameHere "0x0HEXADEC" >.
Use it when you want cleaner code, or if you want one dockscreen you will call from any station, anywhere. You call it like this:

Code: Select all

<StationType UNID="&stRebel;"
........
........
dockScreen=			"&dsRebel;"
abandonedScreen=	"&dsAbandonedStation;"
....>
But if you do want a Dockscreen within the station, you DO NOT put a &ds reference. You have this:

Code: Select all

<StationType UNID="&stBismuthStation;"
......
dockScreen=	"Main"
....>
Further down in the code goes the <Dockscreens> (Plural) definition.

Code: Select all

<DockScreens>
<Main
name=			"=(objGetName gSource)"
>
<OnInit>
(intCommonwealthOnInit "Main")
</OnInit>
Now, in BOTH types of <Dockscreen>/<Dockscreens>, there MUST be an <OnInit> declaration as above the references the Docksreen itself.

So, where do <Panes> come in? Well, both types of Dockscreens allow for individual "panes" that you can flick between using <Actions>, or (Block nil.
BOTH types of dockscreens need this:

Code: Select all

<InitialPane>
"Default"
</InitialPane>
Alternatively, put coding in to decide between different panes

Code: Select all

<InitialPane>
(switch
	(and
	(objGetItems gPlayerShip "* +RebelSupplies;"))
	"DeliverGoods"
						
	(eq(objGetData gPlayerShip "rebelsupply") "Y")
	"OnMission"
						
	"Default"
	)				
</InitialPane>
In the above example, the game checks to see if the player has a cargo container with the Attribute of "RebelSupplies". If that's true, it goes to the <DeliverGoods> pane. Otherwise, if you are on a mission, it goes to "OnMission", or if you have neither, it goes to Default pane.

Panes themselves look like this:

Code: Select all

<Panes>
	<Default>
		<Initialize>
			(scrSetDesc gScreen (cat
				"You dock someplace."
								))
		</Initialize>
<Actions>
<Action name="Undock" key="U">
	<Exit/>
</Action>
</Actions>
</Default>
</Panes>
The above is for a standalone Dockscreen, but it changes for a in-built screen. The one below has multiple screens AND panes, for a big station.

Code: Select all

<DockScreens>
	<Main
	name=			"=(objGetName gSource)"
	>

	<OnInit>
		(intCorporateOnInit "Main")
	</OnInit>

	<Panes>
		<Default
		desc=	"You are docked somewhere.">
<Actions>
<Action name="Undock" key="U">
	<Exit/>
</Action>
</Actions>
</Default>

 <PaneTwo
desc="I am a second pane!">
</PaneTwo>
</Panes>

<SecondSCREEN
	name=	"SecondSCREEN"
	>
<OnInit>
		(intCorporateOnInit "SecondSCREEN")
	</OnInit>

	<Panes>
		<Default
		desc=	"You are docked somewhere.">
<Actions>
<Action name="Undock" key="U">
	<Exit/>
</Action>
</Actions>
</Default>

 <PaneTwo
desc="I am a second pane!">
</PaneTwo>
</Panes>
</SecondSCREEN>

</DockScreens>
Move between panes like this:

Code: Select all

<Action name="Let's Trade" key="T">
	<ShowPane pane="CommoditiesExchange"/>
</Action>
And between screens like this

Code: Select all

<Action name="Done" key="D">
	<Navigate screen="&dsLincolnStation;"/>
</Action>
Or in code

Code: Select all

<Action name="Refuel" key="R">
	(block Nil
	(scrShowScreen gScreen "&dsRefuel;")
)
</Action>


In summary:

More complex stations designed by George use both multiple panes and multiples screens.
Stand alone, UNID defined <Dockscreen> can be called from any station, anywhere, like the common &dsAbandonedScreen;.

In built <Dockscreens> can have multiple individual screens within the one tag, allowing for differently named screens and added functionality.

More more info, check out Commonwealth and Korolov stations.

Some people may already know all this, but I hope it has helped anyone who as slightly in the dark. :)

I welcome any corrections if I was wrong though. >.>
User avatar
Prophet
Militia Captain
Militia Captain
Posts: 826
Joined: Tue Nov 18, 2008 6:09 pm

ThePrivateer wrote:Now, in BOTH types of <Dockscreen>/<Dockscreens>, there MUST be an <OnInit> declaration as above the references the Docksreen itself.
This is not true.
There are many examples in Transcendence.xml of dockscreens withour <OnInit>.

I believe the difference between OnInit and Initialize is that OnInit is only once each time the screen is loaded but initialize is run each time the screen updates.

InitialPane is a special element that must return a string that points to a Pane name in the current screen.


@Schilcote
I looked at your screen and it appears that your <StationCommand> code was a separate screen that you pasted into another screen. You have two options; modify the StationCommand screen to mesh properly with the existing panes in the station's screen, or make StationCommand a standalone screen and redirect to it from the action with (scrShowScreen gScreen &dsStationCommand; "Default")
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

The dawkscr33nz are working, but now there's a porblem with the missions.

http://transcendence.pastebin.com/3U8fT7Tu

If you try to sign up for a mission, something in the code that assigns missions in transcendence.xml glitches up and you have to ctrl-alt-delete.

Also, George needs to add better recovery from stuff like that in dockscreens. Should be some sort of "leave dosckscreen RITE NAO" key combination you can press. Maybe it should only work if there's been an error.
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad
User avatar
Arisaya
Fleet Admiral
Fleet Admiral
Posts: 5535
Joined: Tue Feb 05, 2008 1:10 am
Location: At the VSS Shipyards in the frontier, designing new ships.

There is an error in that it did not detect the crash error. So if you had something that would leave the dockscreen forcefully only on a detected error, the game would have already handled it and put the data into the debug log anyways.

Not to mention that it's liable to cause crashes in and of itself due to the potential for sequence-breaking errors that it can cause.
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
User avatar
Prophet
Militia Captain
Militia Captain
Posts: 826
Joined: Tue Nov 18, 2008 6:09 pm

Here's one problem

Code: Select all

(if (eq (objGetData gPlayerShip "stephiniansLevel") 0) 
    (dbgLog "Setting StephiniansLevel to 1")
    (objSetData gPlayerShip "stephiniansLevel" 1)
    )
I believe you want:

Code: Select all

(if (eq (objGetData gPlayerShip "stephiniansLevel") 0) 
    (block Nil
      (dbgLog "Setting StephiniansLevel to 1")
      (objSetData gPlayerShip "stephiniansLevel" 1)
    )
  )
That should allow gMissionListName properly and if you change the static data from <Missions1> to <StephiniansLevel> it should trigger properly.
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

Prophet wrote: That should allow gMissionListName properly and if you change the static data from <Missions1> to <StephiniansLevel> it should trigger properly.
Are you sure? From what I understand, it accesses the staticdata <MissionsX>, X being StephiniansLevel, which should be 1.
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad
Post Reply