<MissionsX> tags may contain more than one mission?

Freeform discussion about anything related to modding Transcendence.
Post Reply
F50
Fleet Officer
Fleet Officer
Posts: 1004
Joined: Sat Mar 11, 2006 5:25 pm

I started with code from the commonwealth militia fortress.

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>
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

how that works depends on the calling code for the mission look at scCSCTaskForce for the way you want to do it (look for where it starts the missions line 2413)

dsMission is the dockscreen where it picks one out of that list randomly (among other things)
Crying is not a proper retort!
F50
Fleet Officer
Fleet Officer
Posts: 1004
Joined: Sat Mar 11, 2006 5:25 pm

I am using dsMission already, but will look at the CSC task force.
Post Reply