Question concerning missions

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Fatboy
Militia Lieutenant
Militia Lieutenant
Posts: 247
Joined: Fri Feb 22, 2008 1:52 am
Location: California

What code is used to have the player attack the target for the mission to be successful.

EDIT: I think I know, you use shpOrderAttack! (correct me if I'm wrong.)
User avatar
dvlenk6
Militia Captain
Militia Captain
Posts: 519
Joined: Sun Mar 05, 2006 6:56 am
Location: Sanctuary and beyond
Contact:

Fatboy wrote:What code is used to have the player attack the target for the mission to be successful.

EDIT: I think I know, you use shpOrderAttack! (correct me if I'm wrong.)
shpOrderAttack sets the guide pointer (like the pointer that points to a sung transport in those missions where you have to kill one of those) on the screen for playership. For an non player ship, that is used to target something.

shpOrderEscort will do the same thing for the player ship. For NPC ships, then they will escort the target ship.

It is an <event>...</event> in a station that makes the missions succesful or failures.
<OnObjDestroyed> ... </>
Look at the events (below <StaticData> ... </>) of a CSC Task Force in CommonwealthFleet.xml for examples.
"War is hell."
-William Tecumseh Sherman
http://dvlenk6.blackraven3d.com/transgals.html
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Sometimes you need to use shpCancelOrders to get a new order to work, btw.
User avatar
Fatboy
Militia Lieutenant
Militia Lieutenant
Posts: 247
Joined: Fri Feb 22, 2008 1:52 am
Location: California

It is an <event>...</event> in a station that makes the missions succesful or failures.
<OnObjDestroyed> ... </>
Look at the events (below <StaticData> ... </>) of a CSC Task Force in CommonwealthFleet.xml for examples.
I found (shpOrderEscort gPlayerShip gTarget) (and the target was a station.)
And I was trying to make a mission that had the player destroy a station.[/quote]
User avatar
dvlenk6
Militia Captain
Militia Captain
Posts: 519
Joined: Sun Mar 05, 2006 6:56 am
Location: Sanctuary and beyond
Contact:

Fatboy wrote:...I found (shpOrderEscort gPlayerShip gTarget) (and the target was a station.)
And I was trying to make a mission that had the player destroy a station.
shpOrderEscort gPlayerShip gTarget that is setting the target into the computer, for the pointer on the screen.

In CommonwealthFleet.xml; Look at mission4a; 'Destroy Ares Station':
In the first block:
(setq gTarget (random (sysFindObject gSource "T:aresMajor;A")))
sets the variable 'gTarget' to the result of the system search for an Ares station.
In the second block (where it gives you your wingmen), there is a shpOrderAttck command, and that would make the pointer to the target station appear on the screen.
Notice this line:
(objSetObjRefData gSource "Target" gTarget)
That sets a data field in gSource (the CSC) for "Target" to the gTarget variable from the system search...

Now scroll down to the <OnObjectDestroyed> tag in the <Event> section for the CSC. Down to this line in the switch:
(and (eq missionID "mission4a") (eq aObjDestroyed (objGetObjRefData gSource "Target")))
The objGetRefData... If the object being destroyed equals the ref data "Target" from above (and mission4a is the current mission), then the script block that follows is activated.

That is the way to make a mission to destroy an enemy station.

You can usually find an example in the existing xml, copy it, paste it into your mod, and change what you need to change to make it work the way you want.
"War is hell."
-William Tecumseh Sherman
http://dvlenk6.blackraven3d.com/transgals.html
Post Reply