[suggestion] Mission / scripting framework

Post ideas & suggestions you have pertaining to the game here.
Post Reply
giantcabbage
Militia Lieutenant
Militia Lieutenant
Posts: 104
Joined: Thu Apr 07, 2011 9:05 pm

I would like to suggest adding a mission/scripting framework for Transcendence.

Mission data and logic should be separated from the ShipClass/StationType definitions for in game objects. If missions existed as separate entities (e.g. MissionType) there would be several advantages. Mods could be written to add a new mission without having to modify the code of existing stations. A single mission type could be made available from several different station types. Cases such as the CSC which have multiple missions available could be simplified as with each mission moved to a separate entity there would be no need for all the switch statements wrapping all the event handlers.

I have managed to throw together a quick proof-of-concept using virtual stations. This has a major drawback in that I couldn't work out how to make stations follow the player to new systems which is required for easy multi-system missions. One alternative could be to use overlays but I didn't have as much luck with these as I couldn't get Events to work with them..

I've attached the virtual station example which includes a few basic missions and a mission computer so you can start multiple missions and switch the red/green indicator arrow between the active missions. Unfortunately I don't really have much time to work on this, but hopefully it'll be useful to someone

Edit: Updated the example
Attachments
missionframework.zip
Simple mission framework example
(16.41 KiB) Downloaded 229 times
Last edited by giantcabbage on Sat May 07, 2011 5:35 pm, edited 1 time in total.
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

Very nice!

I have long been wanting to work on a mission framework as well, just had my hands full with other mods. I would love to give you better feedback, but I am afraid I am too tired atm. I looked it over real quick, and it looks very solid. If you are interested I will definitely take a closer look and give you detailed feedback.

And I totally agree. It would make a lot of sense to see things like this built into vanilla.

As for cross system events, the easiest way atm is EventHandlers. You can add them to the playership via script and call them as if they were hardcoded. Only issue is the potential of other mods removing them, but meh... Personally I spawn stations in every system that needs an event handler, but that may require a bigger change to your code. I would be glad to elaborate.

Once again... very nice! High quality code... I like! ;D
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Hi giantcabbage!
welcome to Transcendence Forums.
Congratulations for your brilliant first post ! :D

While a mission framework was already brainstormed in the past, looks like you cleverly took advantage of the new scrAddAction :D (i've not read all the code, but i will)
I'm already thinking that something like this can be used to add random missions, providing more randomness to the game and pushing the player to explore more. Not anymore "yet another agricultural station" but "oh! let's dock with it, maybe there is a mission!"
User avatar
Ttech
Fleet Admiral
Fleet Admiral
Posts: 2767
Joined: Tue Nov 06, 2007 12:03 am
Location: Traveling in the TARDIS
Contact:

Very good work. Seems like a very well though out system.
Image
Image
giantcabbage
Militia Lieutenant
Militia Lieutenant
Posts: 104
Joined: Thu Apr 07, 2011 9:05 pm

Thanks for the feedback.

Alterecco - if you have time to have a closer look that would be great. No need to rush though as I'm quite busy at the moment.

I'm not sure about using global event handlers or spawning new stations in every system. The code changes to the framework aren't a problem, but I'd like the mission objects themselves to be as simple as possible as the main aim is to make it easy for other people to add missions.

I think I'll work on adding some more missions / finish the mining survey mission next so I can work out what common code I can move to functions (I'm guessing this will be the mission state handling and ordering the player)

Digdug - thanks, adding random missions or at least more variable missions was one of the things I was aiming for. Ideally the missions should be a bit more like buying items so you can specify which types of station will offer them, how common they are, and which levels they appear. So far I've only made the mining and domina mission station specific though.

You can also make the missions more interesting by chaining them together. So far only the domina mission does this (and it always starts the rescue mission), but you could do something like a patrol / escort mission which can set off a destroy enemy base mission if you encounter one of their bases.
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

0xDDDE?

I know of the 0Xtriple D : that would be the Great Periculi......

the xml looks good: HOLY COW!!!: How LONG does that go on? I know I fly a Corporate Transport, but COME ON, I am not a Freighter!!!

LOL: worked great: I was very impressed by the code writing and HAD to put it in my game folder: my game ++ I used it on 1.06D release because like 1.05 it gives the best chance to not go nuts over a code :

The game faulted on load, then i hit the exe again and it swallowed it whole : it was very AWESOME to have your idea actually run so smoothly I THANKYOU for adding such a AWESOME feature to the Universe!!!!!!!!

I will play it in my game and report anything I find besides " ran out of fuel between stations doing that loopy errand" :) LOL


THANKYOU again: I will enjoy this , I know I will and i do hope the Transcendence Universe of millions enjoy it too !!!!!!
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
shanejfilomena
Fleet Officer
Fleet Officer
Posts: 1533
Joined: Tue Mar 22, 2011 8:43 pm
Location: Alaska
Contact:

Found items in your model : Not that they take anything away from it, I still enjoy having it in my game.

I took the mining exploration and was distracted by my puppies so I missed the very impatient window the mining ship gives you before it gates out : however, I returned to the station and :
mismatched Quote ###(ObjGetStaticData gsource "msg_failure")###

------------Targeting system locks on destination : great if you do not have a targeting rom: " Bad JUJU " If you do..
I killed the mining ship i was supposed to rescue ( then had to go tell his wife I killed him )

Delivery to Black Market Mission :
Pilot most likely will not have a Black Market ID: The Guards will stop the Pilot from completing the delivery

Black Market mission to Hostile Asteriod : Only a Smuggler / Merchant Trader with Sov relations can get past the Hostile thing;
Black Market Level / Sov relation status someplace fits in there.

Destroyed the Asteriod I was to deliver to, Intentionally: on docking they thank me for the supplies and pay me , then switches to loot the station : such polite victims of Galactic /Violence, I must have traumatized them.
============================
New Item I thought " Interesting" Your Mod brought out the REAL FEELINGS of the Hauri toward the Corporation , Namely Adventure Outfitters and Thor's : I was asked to destroy them and the Hauri gladly shot at the defenders as well as the Cruiser.
Interesting Twist :)
Flying Irresponsibly In Eridani......

I don't like to kill pirates in cold blood ..I do it.. but I don't like it..
giantcabbage
Militia Lieutenant
Militia Lieutenant
Posts: 104
Joined: Thu Apr 07, 2011 9:05 pm

The mining mission was incomplete in the original example. The mission was over once the ship reached the asteroid field (as it had no more order the Borer would go to the gate and you fail the mission). I've updated the example to make the mining survey playable. Now you should be able to watch the borer mine some asteroids and take the ore back to the station.

I've fixed the deliver mission so you get a failure message if you destroy the station before docking with it.
Post Reply