Page 1 of 1

[MOD] Auto Trade Agents

Posted: Mon, 29. Feb 16, 06:01
by PaulP
This simple extension will automatically give you trade agents at stations. Upon entering a new system, any stations there that are on good terms (0 or above relation) will announce their presence and immediately begin sending you trade updates.

Download it here auto_agent.zip download

It's also on the Steam Workshop as Auto Trade Agents.

Here's the code for it, if anyone just wants to see how it works

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<mdscript name="auto_agent" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
  <cues>
    <cue name="AutoAgent" instantiate="false" namespace="this">
      <conditions>
        <check_any>
          <event_object_changed_zone object="player.primaryship"/>
          <event_player_created />
          <event_cue_signalled cue="md.Setup.GameStart" />
        </check_any>
      </conditions>
      <actions>   
        <find_station groupname="$allstations" space="player.zone" multiple="true" />
        <do_all exact="$allstations.count" counter="$i">
          <do_if value="not $allstations.{$i}.hastradesubscription and $allstations.{$i}.relationto.{player.primaryship} ge 0.0">
            <set_known object="$allstations.{$i}" known="true" />
            <add_trade_subscription object="$allstations.{$i}"/>
          </do_if>
        </do_all>
        <reset_cue cue="this" />
      </actions>
    </cue>
  </cues>
</mdscript>

Posted: Mon, 29. Feb 16, 13:22
by Scoob
Cool, I might try this! Thanks for creating it.

Scoob.

Posted: Tue, 8. Mar 16, 16:45
by eMYNOCK
Cheers,

i will simply copy'n'paste what i already wrote in Steam.
...
i would suggest to increase the minimum relation to +5.

Not too hard to get +5 (you can do this with one or two small talks or by killing Masstraffic) and it is a bit more believable that the Faction trusts you enough to Broadcast their Trade Offers to Friendlies.
...
...
i've just noticed that your Script places Trade Agents on the Home of Light Highway Stations and Trade Centers.

You should probably restrict it to place Agents on Stations with Docks and / or functional Trade Ports.
...
Regards


Edit:

Cheers again,

without too much words... i've reworked your code together with Yorrikvander a bit.

The Result is this here:

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<mdscript xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="auto_agent" xsi:noNamespaceSchemaLocation="md.xsd">
  <cues>
    <cue name="AutoAgent" instantiate="false" namespace="this">
      <conditions>
        <check_any>
          <event_object_changed_zone object="player.primaryship"/>
          <event_player_created/>
          <event_cue_signalled cue="md.Setup.GameStart"/>
        </check_any>
      </conditions>
      <actions>
        <find_station name="$allstations" space="player.zone" multiple="true"/>
         <do_all exact="$allstations.count" counter="$i">
          <set_known object="$allstations.{$i}" known="true" />
           <do_if value="not $allstations.{$i}.hastradesubscription and not ($allstations.{$i}.name=={20102,6001}) and $allstations.{$i}.relationto.{player.primaryship} ge 0.0032">
            <find_tradeoffer_parking_slot object="$allstations.{$i}" includeoccupied="true" name="$parkingpossible" check="true"/>
             <do_if value="$parkingpossible">
              <add_trade_subscription object="$allstations.{$i}" />
             </do_if>
           </do_if>
         </do_all>
        <reset_cue cue="this"/>
      </actions>
    </cue>
  </cues>
</mdscript>
Changes are, Stations without Trade Ports were ignored.
(That means Reiver Waystations, Teladi Dens, HoL Highway Stations)

Additionally Factions that are below +5 Reputation are ignored too.
(and $allstations.{$i}.relationto.{player.primaryship} ge 0.0032")

Regards again

Posted: Tue, 15. Mar 16, 14:36
by Nago
Thanks for this nice work !
This should really be posted in the mod list : http://forum.egosoft.com/viewtopic.php?t=370788

Re: [MOD] Auto Trade Agents

Posted: Sat, 1. Jun 19, 04:33
by flatbush71
How do you get this to work guys ?

Buck
(The old & sick fool)

EDIT: Nevermind, it works great !!

Re: [MOD] Auto Trade Agents

Posted: Sun, 5. Dec 21, 18:18
by cherbert1701
Is this not on Steam Workshop anymore? I can't find it.