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 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.