[Work In Progress] Functional Trader + stable supply/demand (0.22 final WIP)

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

LastChime
Posts: 434
Joined: Wed, 6. Jul 11, 17:53

Post by LastChime »

OvrTehBottm wrote:To bad there isn't a way to introduce a Pirate faction or at the very least beef up the current Pirates. Unfortunately, with nearly all sectors owned and operated by friendly factions there is no way to remove ships from space 'naturally'.
If the Ks were functioning as intended I think the herd would be sufficiently thinned
Mordegar
Posts: 325
Joined: Mon, 10. May 04, 01:07
x4

Post by Mordegar »

It seems that owned freighters seem to stuck if they're controlled by a manager in one of your factorys. My freighters are docking/undocking every couple of minutes without a ware exchange while the npcs seem to buy and sell goods like its a natural thing.
Mining Ships will also keep on mining even if their cargo hold is full instead of flying back to your station and unloading the cargo.
Last edited by Mordegar on Thu, 28. Nov 13, 00:27, edited 1 time in total.
User avatar
pirke123
Posts: 373
Joined: Tue, 3. Sep 13, 18:00
x4

Post by pirke123 »

Fumblesneeze wrote:
When I search for "money" in the save file, I get 609 hits.
search for <account ...> and then count their distinct id's. You will see that there are as many distinct accounts as there are (active) player captains/architects/managers + 1 (for the player).
That's because all the NPC's under my control share my own money. If the NPC faction traders and NPC faction stations are simply part of the same faction, but each has it's own money, then factions do have wealth.

Can you find what the 600+ money finds are used for?
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

Mordegar wrote:Seems to be not working in my unmodded Campaign Game (Campaign finished). Freighter keeps docking/undocking after 5 minutes and repeating in a loop. Some freighters seem to travel back to my urv station with 0 wares loaded, dock/undock and fly off to a station to do the same.

-prefersinglefiles is in my launch options already.
Same here, installed the mod by copying the files into main game dir and added the launch option. I cleared out mods and started a new campaign. Trade ship doesn't complete the 100 ecell trade just like in the unpatched version. Does the patch only address trades taking place in sector or does it fix out out of sector trades as well?
redshift690
Posts: 35
Joined: Tue, 26. Feb 13, 20:43
x4

Post by redshift690 »

Well I have this running on a new campaign run, and all the ai traders seem to be working great! No more freighters just setting at load out depots doing nothing so this is most defiantly exciting to see, and a step in the right direction!
However my Rahanas will not pick up the order of EC for the main mission, and just sets there. On the other hand this leads me to another thought, and question I had in that the captain has 0 stars in navigation skills. Does the skill system actually have any baring on anything? Could this have an effect on his ability to locate what dock to go to? Just a thought as it seems like all other ai traders are working after installing these scrips.

PS: Thank you Jey123456 for working on this! :)

Update: This is working! :D I decided to continue on that save, and reissued the trade command to pickup the EC load for lonely giant, and went about gathering up space cans. After about 10 min the captain radioed informing me he was preparing to receive the wears. So jetted back to the station, and he was already loaded up by the time I got there! Proceeded to LG dropped off the load with no more issues! I am thanking the skill system does have an effect on trading. If the captain is poor at navigation the game may be making him/her slower about getting to the destination. Going to go test this idea out, and find a higher skilled captain :)
Last edited by redshift690 on Thu, 28. Nov 13, 02:23, edited 1 time in total.
Wana
Posts: 274
Joined: Sun, 27. Jun 10, 15:46
x3ap

Post by Wana »

it's working for me. AI have cargo drone except if i just enter the sector.

TYVM
bbeach
Posts: 100
Joined: Tue, 24. Feb 09, 03:47
x4

Post by bbeach »

pirke123 wrote:
Fumblesneeze wrote:
When I search for "money" in the save file, I get 609 hits.
search for <account ...> and then count their distinct id's. You will see that there are as many distinct accounts as there are (active) player captains/architects/managers + 1 (for the player).
That's because all the NPC's under my control share my own money. If the NPC faction traders and NPC faction stations are simply part of the same faction, but each has it's own money, then factions do have wealth.

Can you find what the 600+ money finds are used for?
Here is an example:
<ref id="4587">
<value type="string" value="27754"/>
<value type="money" value="8904591"/>
</ref>


The refid gets us to:
<cue id="4587" base="3810" state="waiting"/>
</cue>

the base gets us to:
<cue id="4585" state="complete" time="0.352305">
<vars>
<value name="$actor" type="component" value="[0x1c3409]"/>
<value name="$fee" type="integer" value="172548"/>
</vars>
<cue id="4586" base="3809" state="complete" time="0.352305">
<vars>
<value name="$Actor" type="component" value="[0x1c3409]"/>
<value name="$ActorParent" type="component" value="[0x1c3408]"/>
<value name="$AllowResurrection" type="integer"/>
<value name="$BaseCue" type="cue" value="4585"/>
</vars>
<cue id="4587" base="3810" state="waiting"/>
</cue>
<cue id="4588" base="3811" state="waiting"/>
<cue id="4589" base="3812" state="waiting"/>
<cue id="4590" base="3813" state="waiting"/>
<cue id="4591" base="3814" state="waiting"/>
<cue id="4592" base="3815" state="waiting"/>
</cue>

The actor parent gets us to:
<component class="dockingbay" macro="dockingbay_player_bar_macro" connection="connection02" seed="2701944601" id="[0x1c3408]">
<connections>
<connection connection="npcconnection">
<component class="npc" macro="character_ar_male_engineer_macro" connection="commandroomslot" name="Aron Nedley" owner="plutarch" page="10106" id="[0x1c3409]">
<listeners>
<listener listener="[0x1c33f8]" event="killed"/>
</listeners>
<skills>
<skill type="leadership" value="1"/>
<skill type="navigation" value="2"/>
</skills>
<entity type="specialistmetals" control="1" customconversation="1"/>
<npcseed bodyparts="2456802423" bonescales="1322644678" morphtargetweights="2329593938"/>
<connections/>
</component>
</connection>
</connections>
</component>

So it's a specialist NPC for hire at a bar, and the elusive "money" value is his hire price.

All of the money entries outside of the player and their controlled assets are like that.

Either trade offers or NPCs.
LastChime
Posts: 434
Joined: Wed, 6. Jul 11, 17:53

Post by LastChime »

Works great to unclog the drain, thanks Jey123456, much appreciated
Miravlix
Posts: 246
Joined: Mon, 13. May 13, 01:14
x4

Post by Miravlix »

My current game is a 1.17 restart and I'm way past the 100 energy trade, but I'm now stuck on the 300 food trade.

I'm afraid this mod isn't really fixing the player trade issue, it just look that way because the 1.17 trade bug doesn't happen 100% of the time.
winscale
Posts: 21
Joined: Sat, 15. Nov 08, 08:07

Post by winscale »

I am finally able to advance past the 100 energy cells mission with this mod after restarting my game on patch 1.17. Trading working pretty good thus far.
Hellaciouss
Posts: 57
Joined: Sun, 6. Jan 13, 18:38
x3tc

Post by Hellaciouss »

pilakin wrote:look, if you had a complete network of stations and ships from miners till shipyard. would you need money then? for what, to pay yourself?
If say, a nerfarious faction (or player) starting blowing up all your crap...then yes. You'd need money to replace said losses.
Hellaciouss
Posts: 57
Joined: Sun, 6. Jan 13, 18:38
x3tc

Post by Hellaciouss »

Miravlix wrote:My current game is a 1.17 restart and I'm way past the 100 energy trade, but I'm now stuck on the 300 food trade.

I'm afraid this mod isn't really fixing the player trade issue, it just look that way because the 1.17 trade bug doesn't happen 100% of the time.
It could take quite a while if there is a backlog. Run around and do a couple missions.
mikeck
Posts: 98
Joined: Sat, 22. May 10, 21:20

Post by mikeck »

Installed. I am playing in free play sandbox (hate campaigns). It's too early to tell for sure whether it's working but it SEEMS like there are more trade ships moving about. Before they would just be docked or hanging about. Seems like now more are docking and undocking. Could be that I am seeing what I want to see but who knows. For the first time though-at a shipyard- I went to look at ship prices and saw that a ship was 85%complete and moving! By the time I was done a minute later, it was 97% complete. So clearly the station was getting what it needed
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

its not just the fact we cant find it. its the fact it couldnt work even if it was here. the shipyard take no safeties aggainst anything but player operations.

But to make my argument a bit more real, in the begining of my fix (before i fixed the drones), i made all stuck traders self destruct... Well 10hours later, none of them had been replaced that i could find (and without the self destruct you can see dozen freighters parked on the vanilla code with fixed trade xD).
Gaotseun
Posts: 39
Joined: Mon, 25. Nov 13, 16:16
x4

Post by Gaotseun »

im alway geting the response "trade not possible" from miners if i try to sell ions or ore :( they doing the trade but i dont get any money they also have negativ cargo after trade
ScorpiusX
Posts: 263
Joined: Wed, 16. Aug 06, 22:44
x4

Post by ScorpiusX »

So to install this I need to unpack it into my main Rebirth directory NOT my extensions directory?
ScorpiusX Corp company motto:

"We don't want to rule the Galaxy"
"We just want to own it!"
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

since its a wip, you need to unpack it in your xrebirth directory and set the launch parameter yes. I'm currently working on cleaning it up and preparing it to be a proper extension, but that takes time. I also havent played at all with player related operations in that wip yet, so those might or might not work, i did some changes on them as i fixed the ai ones, but i didnt test much if any of it.


for the retval error spewed by the error log when used on an existing game, its an issue that every freighter mid trade will have one (so its quite a lot of errors), its due to the change in script while it was mid execution since i didnt add the proper tags to force it to restart them)
Miravlix
Posts: 246
Joined: Mon, 13. May 13, 01:14
x4

Post by Miravlix »

Others is reporting that 1.17 doesn't always break trade...

The ship does the trade say starting VO, then I loss the money and a while later the Captain says it failed. This happen again and again until I ran out of money.

This is a game that's run for many hours with this code changes in place.

This is a game where I did the 100 energy trade in with no problem.

I've tried with a Constructor ship with no drones and multiple games with Sqadis (or however that ship is spelled) with drones on board.

I just can't get a cap level ship to buy food from the crystal food factory in devire.

NPC traders does INDEED seem better of with the new code from this.
Jey123456
Posts: 259
Joined: Sat, 23. Nov 13, 09:48
x4

Post by Jey123456 »

yea, as i mentioned a few times, this code most likely doesnt fix the player trade related operations, and might even break it. You can easily remove the player part of the changes by deleting trade.performplayertraderun.pck from your aiscripts folder. Then youll be on the vanilla code for player trades (which seem to be doing better than the untested changes i have in there).
csaba
Posts: 1256
Joined: Fri, 26. Aug 05, 22:39
x4

Post by csaba »

Yeah this mod breaks system-system trade for my ships they just get disoriented at the gates going back and forth through them, trapped in an infinite loop.

Negative cargo can happen If you give your ship an order to fill up on something and right after you tell it to sell that cargo it hasn't obtained yet. At this point the ship sometimes forgets the priority of the trade trips and starts with the 2nd trade trip instead of the first, trying to sell the stuff before it's in it's cargo.

Return to “X Rebirth - Scripts and Modding”