Need help - changing aiscript $warebasket depending on ship name

The place to discuss scripting and game modifications for X4: Foundations.

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

Post Reply
daBeschi
Posts: 76
Joined: Mon, 28. Jan 19, 14:04
x4

Need help - changing aiscript $warebasket depending on ship name

Post by daBeschi » Fri, 16. Apr 21, 18:05

Hello,

I'm running circles and digging holes to find a way to divide my station subordinates into buyers and sellers. After looking into UI modding with no real success, I took an other approach. Why not modify the $warebasket on refresh depending on the ship name.
Problem No 1: how to get the name and b) how to check if it includes a defined string like "buy" from the t-file?
Problem No 2: how to detect if a $ware is for buy or sell? Maybe by searching for 'this.assignedcontrolled' - selloffers?
At least I know were to patch it in: 'aiscripts\order.trade.routine.xml' (at least I hope so)

Code: Select all

  <patch sinceversion="1">
    <do_if value="this.assignedcontrolled.job">
      <!-- refresh warebasket as it may have items added/removed -->
      <set_value name="$warebasket" exact="this.assignedcontrolled.warebasket.list"/>
    </do_if>
  </patch>
My main problem is the lack of knowledge about the syntax and commands so I can not estimate what is possible and what not.

Greetings

Post Reply

Return to “X4: Foundations - Scripts and Modding”