various questions and stuff

Freeform discussion about anything related to modding Transcendence.
relanat
Militia Captain
Militia Captain
Posts: 805
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.
Stupid code. Do what I want, not what I typed in!

NMS
Militia Captain
Militia Captain
Posts: 544
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: 805
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?
Stupid code. Do what I want, not what I typed in!

relanat
Militia Captain
Militia Captain
Posts: 805
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>
Stupid code. Do what I want, not what I typed in!

NMS
Militia Captain
Militia Captain
Posts: 544
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: 805
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.
Stupid code. Do what I want, not what I typed in!

NMS
Militia Captain
Militia Captain
Posts: 544
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: 855
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: 805
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?

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: 544
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.

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

Wed May 22, 2019 3:54 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: 805
Joined: Tue Nov 05, 2013 9:56 am

Fri Jul 26, 2019 1:55 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!

Post Reply