A code review in X4 7.0 found out a vanilla script that regularly drains trade station wares if its owner is a "high drain faction" or if the ware storage percent is at 75% or higher, so for ware draining, this mod is not needed.
Men I think I just fix your mod. You were really close. In some part of the script you use station.tradeware.list and in another station.cargo.list in order to fully work you must eliminate the use of tradeware and use cargo instead. Shipyard and wharf did not sell any ware thats why it was not working. When I did that. All trade stations plus any shipyard/wharf were dumping cargo. I recommend also to increase interval to 60min to avoid making your mod a cheat. Because with 5 min. Al miners that had order to mine nividium will never stop and every minerun end up with more than 1 million in profit. I think that 1 or 2 runs per hour sounds less cheaty than every run of a miner. I hope you agreet. If you need any help, just tell me.
Great Find!!! I just tested and it worked like a charm, all shipyards are now able to build and upgrade again. That's a game saver, Kudos to you my friend!
So if im getting this right, change "$Station.tradewares.list.count" and "$Station.tradewares.list.{$j}" to "$Station.cargo.list.count" and "$Station.cargo.list.{$j}" ?
Besides you need to add the piece of code necesary to target shipyards and wharfs. In the match any clause. Or if you let your email I send you my modified copy of this mod. I hope the mod owner add this to the mod, this way everybody could had it. Remember to ajust the timer to not less than 60 min, that's the way I used it and doesn't feel like a cheat.
Hmm. The mod hasn't received an "official" update to resolve this yet, and I made the changes noted above except for the match macro statement(s). What keyword is needed in place of "tradestation" to get Shipyards and Wharfs included? Do I need a separate line for Shipyards and Wharfs?
Or was there more involved? I guess I could answer my own question if I knew where these macros were defined, but I'm not that familiar with XML setup to find it.
Thanks! I'll give it a try. Currently even with the mod running, all the shipyards, wharfs, and equipment docks are gridlocked. I have one wharf that somehow received ~22,000 m3 MORE supplies than it has storage for.
Edit: OMG! Watching 40+ NPC tradeships suddenly activating at a wharf was awesome! Thanks to all that helped me on this!
To anyone who stumbles upon this thread, it seems like the mod creator has updated it himself. Should work without any changes. The timer is set to 5 minutes by default, you can modify it in .dat file
Thanks for the mod, it looks like my nvidium will no longer be clogging my miner.
Suggestion about the 5 minute check:
Maybe consider building the list at game load and then use events to add/remove stations. I think building the list every time may lead to performance issues in games where mods that add new corporations or stations (eg: expanded sectors, FOCW, deadair factions) causing heavily populated galaxy in late game.
For example:
<cue name="OnStationBuilt"> <conditions> <check_any> <check_all> <event_object_built_station /> <!-- Station is constructed to operational state --> <check_value value="event.param.owner? /> <!-- Make sure there's an owner --> <check_value value="event.param.owner != faction.player" /> </check_all> </check_any> </conditions> <actions> <!-- Add newly built NPC structure to list of sink / fill stations -->
<!-- NOTE: Due to lag or other delays, the check_value statements above might be better done as do_if statements in the actions section --> </actions> </cue>
<cue name="OnStationDestroyed"> <conditions> <check_any> <check_all> <event_object_destroyed object="$theThing" /> <check_value value="$theThing?" /> <!-- Make sure $theThing isn't empty --> <check_value value="$theThing.realclass == "class.station" /> <check_value value="$theThing.owner != faction.player" /> </check_all> <check_any> </conditions> <actions> <!-- Remove destroyed NPC structure from list of sink / fill stations --
<!-- NOTE: Due to lag or other delays, the check_value statements above might be better done as do_if statements in the actions section --> </actions> </cue>
Something i noticed is that with you having the minwaresvalue at 100 trade kinda dies down still even with all sinks active and only trade stations getting goods
Dont get me wrong there is still trade going on my energy cell production plants have customers constantly for all part creations but because trade stations are full ore and the likes just isnt bought in big enough quantities(not even in terran space) so miners become useless unless you self produce and refine materials and parts
Setting the min to 20 and leaving the game overnight and i saw a huge increase in overall trade with trade stations requesting and selling goods and way more ships flying around and activity all over from faction wars to wars against xenon to pirate raids things that had kinda died out in the last 3 days have come back
Id say having the min value at 50 would be better for the start of the game and going forward then at 100
Especially if you start a miner start and make a trade station yourself(i did this for my test) and you see things slowly die out over time as item consumption(even with a more aggressive universe and constant wars) cant keep up compared to the spawn rate of items if that number is set to high
76 comments
But of course, vanilla does not fill in wares.
<match macro="macro.station_arg_shipyard_base_01_macro"/>
<match macro="macro.station_arg_wharf_base_01_macro"/>
<match macro="macro.station_arg_equipment_base_01_macro"/>
Or was there more involved? I guess I could answer my own question if I knew where these macros were defined, but I'm not that familiar with XML setup to find it.
<match_any>
<match macro="macro.station_arg_tradestation_base_01_macro"/>
<match macro="macro.station_par_tradestation_base_01_macro"/>
<match macro="macro.station_tel_tradestation_base_01_macro"/>
<match macro="macro.landmarks_tel_tradestation_01_macro"/>
<match macro="macro.landmarks_par_tradestation_01_macro"/>
<match_content class="class.buildmodule"/>
</match_any>
keep the syntax and formating you see in the xml, so dont copy past this just add the line that not their so that is lines up.
Edit: OMG! Watching 40+ NPC tradeships suddenly activating at a wharf was awesome! Thanks to all that helped me on this!
Wish you to always have a deep vacuum (neither gas, nore asteroids)!
;)
[email protected]
thanks
[email protected]
Thaanks a lot! I'm new to the game :)
it works
Suggestion about the 5 minute check:
Maybe consider building the list at game load and then use events to add/remove stations. I think building the list every time may lead to performance issues in games where mods that add new corporations or stations (eg: expanded sectors, FOCW, deadair factions) causing heavily populated galaxy in late game.
For example:
<cue name="OnStationBuilt">
<conditions>
<check_any>
<check_all>
<event_object_built_station /> <!-- Station is constructed to operational state -->
<check_value value="event.param.owner? /> <!-- Make sure there's an owner -->
<check_value value="event.param.owner != faction.player" />
</check_all>
</check_any>
</conditions>
<actions>
<!-- Add newly built NPC structure to list of sink / fill stations -->
<!-- NOTE: Due to lag or other delays, the check_value statements above might be better
done as do_if statements in the actions section -->
</actions>
</cue>
<cue name="OnStationDestroyed">
<conditions>
<check_any>
<check_all>
<event_object_destroyed object="$theThing" />
<check_value value="$theThing?" /> <!-- Make sure $theThing isn't empty -->
<check_value value="$theThing.realclass == "class.station" />
<check_value value="$theThing.owner != faction.player" />
</check_all>
<check_any>
</conditions>
<actions>
<!-- Remove destroyed NPC structure from list of sink / fill stations --
<!-- NOTE: Due to lag or other delays, the check_value statements above might be better
done as do_if statements in the actions section -->
</actions>
</cue>
<match owner="faction.player" negate="true"/>
Which indicates not to include the player object in the list. This code is included in each block for both drain and fill.
Dont get me wrong there is still trade going on my energy cell production plants have customers constantly for all part creations but because trade stations are full ore and the likes just isnt bought in big enough quantities(not even in terran space) so miners become useless unless you self produce and refine materials and parts
Setting the min to 20 and leaving the game overnight and i saw a huge increase in overall trade with trade stations requesting and selling goods and way more ships flying around and activity all over from faction wars to wars against xenon to pirate raids things that had kinda died out in the last 3 days have come back
Id say having the min value at 50 would be better for the start of the game and going forward then at 100
Especially if you start a miner start and make a trade station yourself(i did this for my test) and you see things slowly die out over time as item consumption(even with a more aggressive universe and constant wars) cant keep up compared to the spawn rate of items if that number is set to high