missions are too hard

General discussion about anything related to Transcendence.
Post Reply
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

There is a lot of information out there but it isn't really in a useable form for someone who wants to learn how to use the missions feature.

I think what is needed is for someone who can write mission code to select 3 or 4 existing SOTP missions and write a topic for each which explains what is happening. Same as Xephyr did in the Missions 101 topic. But with even more detail. And it needs to be explained in terms of what code to use to make what mission feature work. Not an explanation of each event, although that is useful too.

It will be difficult and very time-consuming but I don't really see any alternative. At this stage possibly a handful of people can write mission code. From what I can see no more ever will.

Don't get me wrong. It's a great idea. But at this stage I am considering using custom stations with sequenced dockscreens instead of mission types to get missions working in any mods I'm working on. Because even though I continually simplify the missions it is too hard working out how to use mission code.

Any thoughts?
Stupid code. Do what I want, not what I typed in!
User avatar
Xephyr
Militia Captain
Militia Captain
Posts: 857
Joined: Fri Dec 14, 2007 1:52 am
Location: Orion Arm, Milky Way
Contact:

I'm all for this idea. What might help is some highly commented missions built as templates - something like 10 example missions that are each unique. That would provide enough of a basis for most people to get started.

Here's some examples, can we think of any more?

- go to location X and kill threat Y
- escort ship X to location Y
- Bring item X to location Y (delivery mission)
- recon points X, Y, and then Z
- scan station X for a preset time
- Defend station X from threat Y
- Protect ship (or station) X from threat Y for Z time (eg. Dwarg invastion in CC)
- Destroy X number of threat Y in this system (eg. destroy 100 pirate ships)
- Go to station X in system Y (story progression)
Project Renegade (Beta) : "The Poor Man's Corporate Command!"
Real programmers count from 0. And sometimes I do, too.
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

There are two special mission types that I know of.
'deliveryMission' and 'onDockMission'.

The delivery missions don't always actually involve delivering anything.
If the differences for these and any other special sorts of missions could also be explained it would be helpful.

There are a few delivery missions and an SOTP example of an 'onDockMission' is &msEscapeFromDantalion; in Antarctica02.xml.
Stupid code. Do what I want, not what I typed in!
User avatar
Xephyr
Militia Captain
Militia Captain
Posts: 857
Joined: Fri Dec 14, 2007 1:52 am
Location: Orion Arm, Milky Way
Contact:

relanat wrote:
Mon Apr 08, 2019 5:38 am
There are two special mission types that I know of.
'deliveryMission' and 'onDockMission'.

The delivery missions don't always actually involve delivering anything.
If the differences for these and any other special sorts of missions could also be explained it would be helpful.

There are a few delivery missions and an SOTP example of an 'onDockMission' is &msEscapeFromDantalion; in Antarctica02.xml.
The usages of these attributes are pretty well-commented in the code; https://github.com/kronosaur/Transcende ... ssions.xml

'onDockMission (line 1061) is a mission attribute used to present a mission upon docking with a station, for cases where you would otherwise have to go to another screen (ops center, executive officer, etc).

'deliveryMission (line 748) is a little trickier, but immensely useful. Using this you can have other objects carry the mission screens without writing any special code; check out the dwarg invasion mission in corporate command for a good use of this. All you need to do is define a destination object and have the event <OnDeliveryMissionCompleted> defined.

Also described is 'paneInitMission - I think this is for overriding dockscreens to inject your mission code, but I haven't used it.
Project Renegade (Beta) : "The Poor Man's Corporate Command!"
Real programmers count from 0. And sometimes I do, too.
giantcabbage
Militia Lieutenant
Militia Lieutenant
Posts: 104
Joined: Thu Apr 07, 2011 9:05 pm

I've started writing a short tutorial on missions here. It's all on github so it's easy to edit / download and you get much better syntax highlighting than the forum.

So far I've done three basic missions:
  • Destroy station
  • Delivery mission
  • Escort mission
If I have time I'll also add some more complex examples to make a short missionArc.

Let me know if you have any comments - it's just a first pass for now so there could be bugs in the mission and mistakes in the documentation!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

Excellent work. I know how time-consuming tutorials are to write. This is really appreciated. I've learnt a lot.

I could decline the missions over a dozen times so it seems that having destroyOnDecline="true" doesn't count a mission against the maxAppearing value. Maybe that could be explained (but in a clearer manner).

Also which events need to be 'registered for events'? Perhaps mention in each mission which events the objects are being registered for. The comments mention "so we know if the target/ship is destroyed" but perhaps add a direct reference to the <OnObjDestroyed> event. I'm never sure which events need registration, <OnObjEnteredGate>, <OnUpdate>, others? And do they need to be unregistered at any stage?
And which events does the playership need to be registered for or does the game automatically assume this? I've seen this in code but not which events it is needed for or if it is still required.

Plus a mention of when the mission is available, open, active, etc. And a comment when it changes between states. I find the many states and properties really confusing. As one example, what determines if is a mission is 'unavailable'?

Notes:
&msTutorial03; can be started if there is no 'gateOnThreat' ship docked but it doesn't work. Changing '(not (or gateObj shipObj))' to '(not (and gateObj ShipObj))' seems to fix it.

Also the ship to be escorted is highlighted even if the mission is declined. I don't think it should but can't see how that is happening.
Stupid code. Do what I want, not what I typed in!
giantcabbage
Militia Lieutenant
Militia Lieutenant
Posts: 104
Joined: Thu Apr 07, 2011 9:05 pm

Thanks for the feedback - I'll post a reply when I get around to updating the tutorial.
relanat wrote:
Wed Jul 24, 2019 4:14 am
I could decline the missions over a dozen times so it seems that having destroyOnDecline="true" doesn't count a mission against the maxAppearing value. Maybe that could be explained (but in a clearer manner).
I think I've mentioned maxAppearing a couple of ministry tickets. If I recall correctly it is actually counting the number of times the player has accepted a mission - but it is counting at the time the mission is created.. which means there is a loop hole so maxAppearing=1 mission is not guaranteed to be unique (i.e. a determined player could end up accepting and completing a maxAppearing=1 mission several times). But I'd need to check ministry tickets / create test missions to workout exactly what is going on.
Also which events need to be 'registered for events'? Perhaps mention in each mission which events the objects are being registered for. The comments mention "so we know if the target/ship is destroyed" but perhaps add a direct reference to the <OnObjDestroyed> event. I'm never sure which events need registration, <OnObjEnteredGate>, <OnUpdate>, others? And do they need to be unregistered at any stage?
Basically all the OnObj* events need to be registered (the same as if you had the events on a station or ship)

The one exception is the owner (aOwnerObj) which is automatically registered when the mission is created (so the engine knows to end the mission if the owner object is destroyed)

All events should be automatically unregistered when the mission completes, so you only need explicit unregistered if you want to stop receiving the events before the mission finishes

OnUpdate for missions should be automatic while the mission is active.
And which events does the playership need to be registered for or does the game automatically assume this? I've seen this in code but not which events it is needed for or if it is still required.
You'll need to register for gPlayerShip events if you want any of the OnObj* events from the player ship (unless this is automatic in the recent versions of transcendence, but I don't recall)
Plus a mention of when the mission is available, open, active, etc. And a comment when it changes between states. I find the many states and properties really confusing. As one example, what determines if is a mission is 'unavailable'?
Basic progression is:
  • open - mission has been created and available for the player to accept/decline (i.e. it will be offered in the meeting hall)
  • active - player has accepted the mission and it is running
  • completed - mission has finished (success or failure)
unavailable is definitely an advanced topic! None of the core missions really use it yet apart from a few in Heretic / Antarctica. But it is intended for non-player missions (i.e. not included in the player stats, or shown in the mission computer) e.g.
  • you could use it for a scripted event
  • you could use it for missions the player declines (e.g. have an attack on a station occur without the players participation)
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

This has been really helpful. Thanks. I have finally got a mission working except for handling cargo space in the playership. Fortunately there is some new code in the Ferian mission and also the Sung transport slave rescue mission which can be adapted. Great work.

In the tutorials, I think the SuccessMsg and FailureMsg text ids are automatically searched for by the engine. If so, they could be added to that info.
Stupid code. Do what I want, not what I typed in!
squalus10
Anarchist
Anarchist
Posts: 4
Joined: Fri Aug 16, 2019 3:33 am

Ideas for mission templates, hopefully they don't already exist:

*Destroy and loot x enemies until item A is found (enemies could respawn during mission)
*Set up a cartel member, e.g. pretend to sell illegal ammo/weapons so that you can bust them. They realize its a bust and start attacking you
*(ambitious) Escort a carrier ship to a destroyed friendly ship; the carrier ship is bulky, slow and meant only to physically pull the destroyed wreck back to a loading dock. If the wreck or carrier is destroyed mission ends. The ship could
have an important item or an important person still alive in it that pirates/enemies are after.
*temporarily rent an enemy class ship to infultrate. You are deployed in the ship in a distant location where you must now avoid friendlies and gain information from the enemies. There could be communications where you could answer multiple questions to "gain trust" of the enemies with wrong answers ending the mission. After mission is completed, head back to remote area where your team is ready to swap ships again.

Just thought these could be interesting.
Foxbat_25
Anarchist
Anarchist
Posts: 4
Joined: Fri Aug 23, 2019 2:39 pm

These last ones do look good, I'd be glad to play them! Especially the escort one; plus, it could even have a sub-task in case of failure! For example, if the carrier is destroyed, you could pick up important data from it and bring it back home while being attacked by a strong enemy force... It'd make it more dynamic!
Plus, so far, the only "mission" I've "achieved" over the course of the last week is a market analysis based on some villas for sale in Alicante , I need some sci-fi adventures to recharge my mind :lol:
Post Reply