Edit#03
Example of solution for Mechanic
Example of solution for NPCs that have the entitytype of itemtrader
Edit#02
Here is the solution, kindly offered by Xenon_Slayer (aka Owen Lake) from [ external image ] by PM

Xenon_Slayer (aka Owen) wrote:Hi,
Yeah, I see what the problem is. You'll have to look in the md script NPC_Upgradetrader.xml
The problem is that the prices are stored in there. The good thing is that you can modify that script so that the values are also stored on the NPC too.
Look for the library <library name="TraderHandler">
In its cues node add:These lists are made up of a list containing the ware id and price. e.g.Code: Select all
<cue name="SaveListsToNPC"> <actions> <set_value name="$actor.$EngineUpgradesList" exact="$EngineUpgradesList"/> <set_value name="$actor.$ShieldUpgradesList" exact="$ShieldUpgradesList"/> <set_value name="$actor.$WeaponUpgradesList" exact="$WeaponUpgradesList"/> <set_value name="$actor.$ScannerUpgradesList" exact="$ScannerUpgradesList"/> <set_value name="$actor.$SoftwareUpgradesList" exact="$SoftwareUpgradesList"/> </actions> </cue>
[ [ware.upg_pla_shield_bal_mk1.id, 30000Cr], [ware.upg_pla_shield_bal_mk3.id, 50000Cr] ]
So, you'll have to loop through the outer list to get to the list containing the wareID and price. Note, the wareID is just a string, it will need to be converted back into a ware value.
In a loop you can do that with:
ware.{$EngineUpgradesList.{$Counter}.{1}}
$EngineUpgradesList.{$Counter}.{1} is the wareID, ware.{ } allows you to turn a wareID into a ware. You can then use .name and other properties.
$EngineUpgradesList.{$Counter}.{2} is the price.
Hope that helps.
Owen
Edit#01
I invite you to go directly to this post.
Original post
I'm writing a bit of code to get this information:
- each time I dock to a landing platform, display the list of the NPCs inside (name/inventory/prices)
Code: Select all
<mdscript name="ATIS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\Users\Tim\Desktop\X Rebirth - Modding\My Mods\md.xsd">
<cues>
<cue name="Test_ATIS" instantiate="true" namespace="this">
<conditions>
<event_object_changed_room object="player.entity" />
<check_value value="player.platform" />
</conditions>
<actions>
<include_actions ref="Get_OnPlatformNPCs" />
</actions>
</cue>
<library name="Get_OnPlatformNPCs" namespace="this">
<actions>
<find_object_component name="$NPCs_OnPlatform" object="player.platform" multiple="true" class="class.npc" />
<show_help force="true" custom="'%1'.[$NPCs_OnPlatform]" />
<remove_value name="$NPCs_OnPlatform"/>
</actions>
</library>
</cues>
</mdscript>
This is what is displayed onscreen once docked:
Code: Select all
[component.{0xa59L}, component.{0xa62L}, ...]
What is the syntax to get all the info attached to each of those components?
Thanks,
Regards,
ybeline