Using mods to edit or suppress core code (mining pack)

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Obletus_Grix
Anarchist
Anarchist
Posts: 6
Joined: Thu Oct 15, 2015 8:33 pm
Location: North East England

As a follow up to my terrible hack-job with the mining mod (more apologies) I've been doing some further tweaking in an effort to end up with a mod fix until the new TG/WTS mining pack comes out.

I've a silly question, being a greenhorn and all; is there a way to create a mod that edits or suppresses core code? (tlisp code)

In particular, I've disabled the minimum hit damage needed to mine ore by setting each level in the mining table to 1 hit point of damage. This way, i can create mining weapons that are great for mining and even strip mining asteroids but are useless against any other target. (for example, a dense cloud particle weapon, VERY close range, 60 degree arc but deals 1d20-19 damage, with 100 particles per pull of the trigger)

This way I'd be taking mining effectiveness back to the level of available weaponry and not hit point damage.

Apologies, I know this is kinda a repeat of my previous post but i may tinker with some other stuff with any knowledge gained =]
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

I'm not really sure what you are asking, OG.

The way I understand it (which could be wrong), mods are given precedence when it comes to code. If there is one version of code in the .tdb file and a different version in a mod in the Extensions folder then the game will use the mod code.

From my experience, direct questions get the best response on the forum. Something like "I want a ship to do (insert action), how do I do this because I've tried using (method A) and (method B) and it isn't working".

Otherwise try the IRC site. You can ask questions there, get a reply, refine your question, get a reply, etc, etc, until you have worked through the problem. Great bunch of people on there.

Hope that helps.
Stupid code. Do what I want, not what I typed in!
User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1190
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

 Overwrites of vanilla material can be a tricky proposition at the moment due to caching issues. Basically, mod overwrites are getting overridden whenever the library with the code they’re suppose to replace gets called again when another mod gets loaded. It’s been giving Shrike and me fits. I know it affects resources — images and sounds — but I’m not sure if the same holds true for code.
Image

Mod prefixes: 0xA010 (registered) and 0xDCC8 (miscellaneous)

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

Aaah, finally got it.

Been reading your other topic and your code changes in the .tdb.

If you haven't been able to get on IRC to get help this might be what you're looking for. (Standard disclaimer: I don't really know what I'm doing most of the time, I just keep trying until it works, so I could be leading you astray :) ).

To change the mining station code without having to change the .tdb file, you create a mod and use the same name (<StationType UNID="&stMiningColony;")

With this UNID in your mod the game will use this code rather than the standard code in the .tdb file. This is because the game reads all the standard code first and then will override it with anything in a mod as long as it has the same name.

You can do the same thing with the ore tables.

Include in your mod (in a separate module if you want) the 5 UNIDs (VolcanicAsteroidOre, MetallicAsterodOre, etc) with the new values you want. The game will override the standard tables and use yours, once again, as long as they used the same name.

Do the same for any other changes, include your new files and, ta-da, all finished. (Well. OK, it might take a little longer than that but most of the work has already been done :lol: ).

There is an excellent topic somewhere that uses the Sapphire playership to explain this really well. Anyone know the one I'm talking about?

PS: I really miss all the ore from a couple of versions ago too.

Edit. Instead of changing the station tables in Eridani to get a mining station every game, use a mod instead (or include a module) to add a mining station to Eridani.
Stupid code. Do what I want, not what I typed in!
Post Reply