various questions and stuff

Freeform discussion about anything related to modding Transcendence.
relanat
Militia Captain
Militia Captain
Posts: 700
Joined: Tue Nov 05, 2013 9:56 am

Fri Nov 09, 2018 1:10 am

I'm looking to check if a weapon has the ability to mine. I'm fairly sure there is a way to do this but can't think what it is. Something to do with damage type?
ATM I'm checking for the attribute 'miningEquipment' but this won't work if a weapon can mine but doesn't have that attribute.

NMS
Militia Captain
Militia Captain
Posts: 512
Joined: Tue Mar 05, 2013 8:26 am

Fri Nov 09, 2018 7:23 am

I think you'd have to use XML functions to get the damage string and find "mining:" in it.

relanat
Militia Captain
Militia Captain
Posts: 700
Joined: Tue Nov 05, 2013 9:56 am

Sat Nov 24, 2018 11:32 am

Thanks. I spotted code to do just that in the Weapons Lab Beta mod shortly after I posted the question.
-----------------

A lot of events, especially in missions, use the 'switch' function with only one option. I was wondering if there is a coding reason for doing this instead of using 'if'. Possibly it is just to make expanding the code easier?

relanat
Militia Captain
Militia Captain
Posts: 700
Joined: Tue Nov 05, 2013 9:56 am

Tue Jan 22, 2019 1:03 am

Multi-line text ids usually have a blank line at the beginning and end of the text content. I'm wondering if there is a text formatting reason for this or is it just to break up what can be a wall of text to make it easier to read and work with.

An example from one of the mining missions:

Code: Select all

<Text id="descSupervisor1">

	The colony supervisor stands at the center plugged in to his consoles and display.
	He turns his attention towards you as you approach:

	"Welcome to %stationName%! If you're looking for work, I might be able to set you up with something."

</Text>

NMS
Militia Captain
Militia Captain
Posts: 512
Joined: Tue Mar 05, 2013 8:26 am

Tue Jan 22, 2019 7:30 pm

That's just for code readability. The extra whitespace is removed.

relanat
Militia Captain
Militia Captain
Posts: 700
Joined: Tue Nov 05, 2013 9:56 am

Thu Apr 04, 2019 2:53 am

Does anyone know how the salvager nomad loot behavior works?
All I can find is them having the ship order 'scavenge. But nothing on how they select objects to loot or remember not to loot them again.
Looking to stop them looting selected wrecks or containers.
I've found the NPC looting/scuttling code and that can be handled easily enough but no code for salvagers.

NMS
Militia Captain
Militia Captain
Posts: 512
Joined: Tue Mar 05, 2013 8:26 am

Thu Apr 04, 2019 5:36 am

It's hard-coded in the engine, I believe, but I haven't looked at it.

User avatar
Xephyr
Militia Captain
Militia Captain
Posts: 845
Joined: Fri Dec 14, 2007 1:52 am
Location: Orion Arm, Milky Way
Contact:

Thu Apr 04, 2019 9:50 pm

Yeah it's hard-coded. You would have to code up an event handler or something to be selective about wrecks.
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: 700
Joined: Tue Nov 05, 2013 9:56 am

Mon Apr 15, 2019 1:33 am

Thanks. Event handlers, umm, that can wait!

Does anyone know what 'objRecordBuyItem' does? It is used in the Commodities code.
I suspect it transfers currency during a transaction but can't find any info to confirm this. Possibly it adds to player stats somehow as well?

NMS
Militia Captain
Militia Captain
Posts: 512
Joined: Tue Mar 05, 2013 8:26 am

Mon Apr 15, 2019 5:51 am

Event handlers basically just allow you to add the XML of another type onto the XML of an existing object, usually to add Events and Language elements. You don't need them if you just want to change how one type behaves at all times.

To change Salvagers' behavior without modifying the engine, you'd have to give them a recurring event that figures out what they should be doing, gives them other orders (like wander and dock), and transfers items while they're docked.

Post Reply