I then mutilated it. "mission 0a" works fine, and given that <Missions0> is plural, I tried putting a "mission 0b" in there as well. However, that did not work. "mission 0a" always seems to be chosen.
So how do I put multiple, completely separate missions inside one mission level? Is there an easy way, or do I have to assign a variable to a random value, and then use if statements or switch to choose between them?
(note that "mission 0a" and "mission 0b" are exactly alike except the text displayed upon acceptance of the mission. This mod is in development, or I wouldn't be asking this

Code: Select all
<StaticData>
<Missions0>
(
("mission 0a"
; Code to describe mission
(lambda Nil
(block Nil
"We're receiving a distress signal from a freighter at the edge of the system. It is being advised to gate out of the system. Give it a real reason to make a distress call. Destroy it."
)
)
; Code to initiate mission
(lambda Nil
(block (pos ship timer vec1)
; unit vector from origin to station
(setq vec1 (sysVectorDivide (objGetPos gSource) (objGetDistance gSource)))
; position of freighter
(setq pos (sysVectorAdd (objGetPos gSource) (sysVectorMultiply vec1 (random 450 500))))
; Create the freighter with orders to gate. This will have to be changed
(setq ship (sysCreateShip &scEI100; pos &svCommonwealth;))
(shpOrderGate ship)
; Remember this ship
(objSetObjRefData gSource "Target" ship)
; register so we know when the transport is destroyed
(objRegisterForEvents gSource ship)
(objSetObjRefData gSource "ShipToDestroy" ship)
; orders
(shpCancelOrders gPlayerShip)
(shpOrderAttack gPlayerShip ship)
(objSetIdentified ship)
)
)
)
("mission 0b"
; Code to describe mission
(lambda Nil
(block Nil
"Time to intercept a Korolov Freighter!"
)
)
; Code to initiate mission
(lambda Nil
(block (pos ship timer vec1)
; unit vector from origin to station
(setq vec1 (sysVectorDivide (objGetPos gSource) (objGetDistance gSource)))
; position of freighter
(setq pos (sysVectorAdd (objGetPos gSource) (sysVectorMultiply vec1 (random 450 500))))
; Create the freighter with orders to gate. This will have to be changed
(setq ship (sysCreateShip &scEI100; pos &svCommonwealth;))
(shpOrderGate ship)
; Remember this ship
(objSetObjRefData gSource "Target" ship)
; register so we know when the transport is destroyed
(objRegisterForEvents gSource ship)
(objSetObjRefData gSource "ShipToDestroy" ship)
; orders
(shpCancelOrders gPlayerShip)
(shpOrderAttack gPlayerShip ship)
(objSetIdentified ship)
)
)
)
)
</Missions0>
</StaticData>