various questions and stuff

Freeform discussion about anything related to modding Transcendence.
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 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.
Stupid code. Do what I want, not what I typed in!
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 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: 941
Joined: Tue Nov 05, 2013 9:56 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?
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 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>
Stupid code. Do what I want, not what I typed in!
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 am

That's just for code readability. The extra whitespace is removed.
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 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.
Stupid code. Do what I want, not what I typed in!
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 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: 857
Joined: Fri Dec 14, 2007 1:52 am
Location: Orion Arm, Milky Way
Contact:

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: 941
Joined: Tue Nov 05, 2013 9:56 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?

EDIT: Two months later we again give thanks to digdug for the changelog.
This from the API 33 Ministry topic:
Buy/Sell Events
Sometimes it is useful to know when the player bought or sold items. For example, the Commonwealth penalizes you if you sell slaves. Prior to API 33, the rpgBuyItems and rpgSellItems calls were hard-coded to handle slave sales and Black Market promotions.
API 33 introduces a generic system for implementing this. We start by introducing a new function:
(objRecordBuyItem buyerObj sellerObj item [currency] price)
This function handles the actual transaction of moving money from the buyer to the seller. Previously, this required separate calls to objCharge and objCredit, plus we had to manually call plyRecordBuyItem to keep track of stats (e.g., total goods sold by player).
The objRecordBuyItem handles all of the above internally. In addition, it calls one of two events:
If the player is buying:

<OnGlobalPlayerBoughtItem>
; gItem is the item being bought (could have a count > 1)
; aSellerObj is the object selling (usually the station)
; aCurrency is the currency being used
; aPrice is the total price paid for gItem
</OnGlobalPlayerBoughtItem>

If the player is selling:

<OnGlobalPlayerSoldItem>
; gItem is the item being sold
; aBuyerObj is the object buying
; aCurrency is the currency being used
; aPrice is the total price received for gItem
</OnGlobalPlayerSoldItem>
Last edited by relanat on Wed Jun 19, 2019 5:50 am, edited 1 time in total.
Stupid code. Do what I want, not what I typed in!
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 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.
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

Has anyone used this API 41 feature?
Added uncharted="true" to stargates in topology. This prevents a stargate connection from being revealed without actually passing through it.
I added it to the Network topology to test it.

Code: Select all

<NodeGroup ID="FirstSection">
	<Stargate from="SE:Outbound" to="C1:Inbound" uncharted="true"/>
	...
Although the stargate line remained hidden, C1 was set known and appeared on the galactic map when the stargate was discovered. I assumed that the destination system would also remain hidden/unknown.

Additionally, although the stargate line appeared after gating to C1 as expected, much to my surprise the C1 stargate was an uncharted Majellan, not the usual Daahzen!

I'm thinking I've got the code wrong! The outcome I'm looking for is to have the player find the stargate but not have the stargate line or destination system show. So the player has to gate into the unknown.

Any ideas?
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

The change to multiple unknown types has me confused and has messed up some Taipan GodShip code.

It seem there is now a requirement to set all of the unknown types for an item to known. Identifying just one of the unknown types will still leave the item as unknown.

Is there a way of setting all the possible unknown types for an item to 'known' with code? 'Enum'ing the item only does one of the unknown types.

Looking to be able to 'god'set all items in the game as known and also all back to unknown again.

ALSO

Is it possible to have both a scrControl box and a screen counter box in a dockscreen? The control box seems to override and hide the counter box.
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

I frequently see the system "George's Star" in crash reports but have never seen it in a game. Is it an intro screen system or a default crash system or something? Anyone know where it is?
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.

 It’s the intro screen system, yes. I remember George gave a more detailed explanation during a distant IRC Day some years back when I asked about it — I first found the system name in one of my early intro screen mod experiments — but generally it’s most likely going to be the intro screen in a crash report.
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!)
Post Reply