[Mod] UT CaC v0.20 ( Old Name: Not Another Trader ) - Architect integrated

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

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

Post Reply
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13927
Joined: Sun, 20. Nov 05, 23:45
x4

[Mod] UT CaC v0.20 ( Old Name: Not Another Trader ) - Architect integrated

Post by UniTrader » Sat, 8. Aug 15, 01:34

Current Version from github
Wiki/Manual on github
github Repository Page

Small Pre-released part of next Update:
Just for info: i am currently working on an bigger Update where i add a bunch new functionality and also seperate essential and non-essential parts of this Project into diffrent Mods - and i confirmed that this Optional Mod greatly improves Ship Behavior if they turn high up or down because it removes their usual Angular Limitations. Since its a non-essential part to improve general Behavior i am hereby releasing it as seperate Optional Mod for now.

https://www.dropbox.com/s/junfqsjl8nfxc ... on.7z?dl=1

What this Script is currently:
Currently implemented is a Manager-based Trading Script for Stations and a rewritten Architect both making use of the Framework which is the Core of this Project.

Common Features for all Employees:
-> Command queue for arbitary Commands
-> Dialogue Tree rewritten from Scratch (with focus on consistency)

Manager Features:
-> As usual the Manager does regular tries in Zonetrading, but also gets Order Requests from his Trading Ships and sends them getting his desired Wares.
-> This is done by using each Ships Trade Order List, so the Player can always see what each of his Ships is up to.
(the menu item to clear this List is available, but the Player can not clear it or remove Trade Orders - this is intentional)
-> Also the Manager knows about priorities and takes ordered but not yet delivered Wares into account, but wont lock up if a priority item is unavailable.
-> He can also Mine Gasses/Liquids locally without relying on Mining Ships (needs Gas Collector Drones though)
-> He may also send Ships to Mine instead of Trading if they are equipped for it.
-> In Addition now Energy Cargo Bays can Store Fuel Cells which makes them excellent Delivery Ships for them (also affects Station Cargo)
-> The Manager will use this by buying Fuel Cells and the Captains will refuel from their Homebase instead of Travelling to Fuel Stations
-> In Addition all Ships use an own set of Movement Scripts for Navigation, see changes compared to Vanilla here

Architect Features:
-> in addition to the usual Icon-In-Space method you can also contact the Architect to build anywhere (if you give him a sector or cluster she will pick a permanent zone inside there randomly)
-> Orders for extending a Station are queue-able
-> and you can also shedule detaching the CV freeing it up for another Station
-> Also the Architect will transfer everything which is useful for the completed Station from his CV when a build Step is done (Manager, DO, Specialists, Transport Drones (all but 20), Gas Collectors)

Captain:
-> Currently not much implemented, just enough to fulfill his superiors Orders.
-> you can give him a "Fly to.." Order in his Orderlist though
-> also some Settings for his Jump Behavior are available (always jump to beacon, always jump to a random Object in the Taget Sector, or decide yourself if its the former or latter)
-> you can also tell the Ship to do some independent Trading (experimental feature, mostly untested)

==> IMPORTANT NOTE: There is currently no way to revert Architects, Captains and Managers back to Vanilla Behavior. You can remove them using the Integrated Debug Commands and assign a new one with Vanilla behavior though ;)

How to use (Manager only):
-> Assign a Manager to a Station
-> Talk with him and use the Menu Item "Convert to UT CAC | 1"
-> Now give him some Money (hint: fastest way when you now talk to him is 5 - 5 - 5 (Personal Settings - Money - Give wanted Money)
-> also give him some Trading/Mining Ships by
A) telling the captain he shall work for the Manager or
B) talk to the Manager and use 4 - 1 (Subordinate Managment - Take all Ships in Player Squad) (ships added with this method will inherit the managers log debug behavior)
- - note that Ships not useable by the Manager will not be accepted by the Manager and therefore be without Superior then, but otherwise remain unchanged

How to use (Architect + Manager):
-> you can activate the Architect part by having a Manager on the Skunk, flying nearby the CV (nearer than 10km) and telling him to go to the nearby CV and convert it
-> the Architect can now either use the usual way of building a Station (via Icons in Space) or you can contact him to build in a certain Area (His/Your current Zone or select it from Map)
-> then you should give the Manager on board of the CV enough Money for Station Construction AND Initial Ressource aquiring (if construction began he will have an Option to give enough Money for both in his Personal / Budget Options)
-> after the Build Order was given you can also add additional Orders to extend the Station immediately afterwards or detach the the CV (note: you can still add build orders after the detach order, but those will simply exit immediately when processed)Additional
hints when using Architect/Manager Combi:
-> dont forget to give the Architect some Ships (when doesnt matter) - he will pass them to the Manager who will send them first for aquiring Build Materials and, after the initial build is complete, to get Ressources (and buildmaterials when he has enough for production)
-> you can also park Specialists and an DO on the CV and they will be transferred to the Station when a build step is complete and the Station can use them.
-> when a Build Step is complete the CV will transfer all but 20 Transport Drones from its Hangar to the Station - so you can basically equip it with them before you even decided what station to build Wink
-> in addition i added the possibility to add Scoop Collectors to a CV when building it - these will also be transferred to the Station (because my Manager knows how to use them Wink )
NOTE: function to re-equip the CV with Drones on a Shipyard is not included yet.



Planned Short-term additions/changes:
-> Usage of Fight Ships for Station Defence or Escorts of Trading Ships
-> Apporiate Equipping of Ships for their Jobs (Mining Ships will gett Mining Drones if they have none for example)

Planned Mid-term additions
-> Adding Experience Gain to NPCs for certain activities added in a very basic way
-> Usage of this Experience by the Scripts added in some parts, but will be extended
-> Better useable Dialogue Trees for Player NPCs with more Functions than currently

Planned Long-Term Additions/Changes
-> make Fight Ships seperate from Stations as beginning for Managing Fleets
-> make the Scripts also available to the Player for his direct Subordinates for better Control
- - Better usage of emergency calls: you can tell all NPCs in how bad the Situation must become to call the superior for assistance (btw: no outstanding Orders and no useful stuff to do is the "worst" possible situation)

Planned Long-Long-term goal
-> full Fleet Management, more Control of what Ship will do what and when based on Order Lists (similiar to Trade Lists, but with more functions) so you can plan your invasion for days in detail just to see everything fall apart on first contact
-> completely new Scripts for everything, written from Scratch
-> all of this is also used by NPCs, not just for Player assets
-> completely rewritten Dialogue Trees for everyone (or at least for Player-owned NPCs)


Technical Info: internally used Command Structure (the core of it all - over-complicated for stuff like Trade runs, but opens many possibilities)
With this Script package i am using a diffrent Approach for managing Orders to Objects (not the usual "each Ship runs a main Script depending on its Job" but a more generic approach):
-> Similiar to Trade Orders all NPCs use a Command queue (this.$orderlist) which is basically a list of tables
where each table entry (called $order or $params from here, depending on context) defines an Order to be executed and the table Values are the params to it,
which can be named freely with the exeption of currently one entry:
$order.$script (or a param named 'script')
this Value defines the Script Name to be executed for this Order and therefore the param name will always be the same as the script Name.
-> this is done by making a base script for each entity type which basically
A) sets up Variables (like this.$orderlist),
B) stupidly goes through the this.$orderlist and
C) if this.$orderlist is empty checks which default behavior makes most sense currently to add it to this.$orderlist (and may contact the superior for new Orders)
-> All scripts called with this also require a param named 'params' - it is the aforementoined $order/$params table passed to the script instead of Parameters because we cannt define them dnyamically when calling a Script. You can still use the usual params, but they all have to be optional (=have a default value) to avoid unnecesary Errors to the debuglog
You have to set all params from the Table first before doing anything else (or directly work with the table for small stuff)
-> Another difference to all current Scripts is the requirement that all $order s MUST end at some point to allow continuation with another Order
(best is to make run time as short as needed, like for Trading just execute a single Trade run and exit - and if you need to do more trades just add them further entries to this.$orderlist )
if you need endless loops either just exit at regular intervals and before that add yourself to the end of the this.$orderlist (just add $params to its end to execute your current command with the same params as currently) or check regluary if this.$orderlist.{2}? has been added and terminate to allow the other script to run (and maybe add yourself to the this.$orderlist again; this method is not good because this way the default/fallback orders like refueling or rearming may never be reached, so try to avoid it.)
or
you can also modify this table if you want certain values to persist or want to change certain params for the next run. (or add diffrent Orders, like my Mining Script does when done mining - it lets the trading Script do the unloading)
Last edited by UniTrader on Thu, 3. Nov 16, 18:36, edited 11 times in total.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 6065
Joined: Mon, 15. Dec 03, 19:53
x4

Post by BlackRain » Sat, 8. Aug 15, 03:22

Sounds quite impressive UniTrader, as expected from you. I will be getting this once it is more developed (Especially looking forward to fleet commands and such)

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13927
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Sun, 9. Aug 15, 10:09

Version 0.02 is now available:
-> Fixed Mining for Ships (they should not Mine infinietly anymore, but also do Trading if necesary)
-> Added Gas/Liquid Mining to Manager (Drone usage needs improvement, but thats purely visual)
-> Fixed Manager ignoring needed Wares in some cases
-> fixed some other, minor stuff

and also added a debug function to set a certain NPC to 5 Stars in all Categories (only NPCs using this Script) because my Scripts assume this case for now (will make them behave according to their skill when adding Skill improvements based on their ativity)

next step is the addition of Fight Ships to managed Stations, but this will probably take a while because i think i have to re-write the move.generic for this to add functionality i need, like signalling when and where a Ship wants to jump/boost to (an also make it overseeable for me, will therefore probably split it into multiple seperate scripts) and also make some own Escort/Fight Scripts which add some background functionality to read those signals (will still be heavily based on Vanilla Scripts though)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 7519
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Sun, 9. Aug 15, 10:15

Nice one, Uni.

Suggestion for considering with Medium Traders/Miners: Since they are fragile and traveling around is risky (especially DV), how about having them be restricted to one setting below rest of station? E.g. Zone is zone for all, sector is zone for M and system is sector for M.

I think I'd try some of them again if I could keep them in Glaring Trueth, for example, while letting my jump ships travel further.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13927
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Sun, 9. Aug 15, 10:28

had something else in mind for the Range:
depending on the Managers Navigation Skill you can set up to 5 Spaces (Cluster*, Sector, Zone) where the Manager will order Ships to fly to - and these Spaces must be connected bi-directionally (so you cannt add a Sector which has no direct connection from and to the current Set of Range Spaces or inclues the Homebase itself, and if you change a Space the others are also checked if this condition still applies)
Restricting certain Spaces to specific Size classes is an idea, too - but all that is more like a long-term addition so i will keep it in mind when implementing this ;)

* Cluster will be counted as 2 Spaces because of their Size

note that i do all my testing with 2 XL ships currently to keep the debuglog messages count overseeable (i made many optional debug messages to see what is actually heppening)
Last edited by UniTrader on Sun, 9. Aug 15, 10:39, edited 1 time in total.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 7519
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Sun, 9. Aug 15, 10:35

Nice idea, so Molton Archon would trigger higher range classification - elegant :)

Thanks for keeping the M idea in mind.

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 7519
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Mon, 10. Aug 15, 22:39

If this mod flows towards shipyards later, might it be possible and desirable to have Managers automatically add new ships to a specified squad/fleet? Although perhaps you have some other means of autonomous replenishment in mind.

w.evans
Posts: 2962
Joined: Tue, 18. Nov 14, 17:23
x4

Post by w.evans » Mon, 10. Aug 15, 22:55

Nice one, UT. NAT! Love it. Downloading.

I'm assuming that this only affects managers and station-based ships at the moment? Am worried that my MICT ships might not play nice with it since they're structured similarly to Ego's scripts, and are designed to fit into Ego's script structure.

Also, should I uninstall Yorrick's Galaxy Station Range?

Can I just plug it into an existing game, and just switch a manager with already running traders over to NAT?

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13927
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Mon, 10. Aug 15, 23:16

its mostly independent from the Vanilla Scripts - i use Vanilla ones sometimes for trivial tasks, like the move.undock or the move.generic until i have an own replacement, but i wont touch them at all.. (in fact i am currently writing an own move.generic because this way i know best where to include group boosting or jumping)

also i dont think there is a need to uninstall Yorricks mod - didnt include any Range setting yet, currently uses something like "Cluster" as default behavior regardless of requirements and when i change this i will do it properly, like the "5 Spaces-Range" idea i mentoined earlier. dont want to waste time on intermediate steps i will completely rewrite soon.

and jep, only the Manager of a Station and his subordinate Traders are affected atm (and will not be revertible to default behavior once using this, but can be removed completely, including the Object they are on. note that this does not restore the buildspot for stations, just tried it out, but i look into how to restore them next - will be compatible ofc ;) ).
Also he will refuse to take fight Ships atm because they wouldnt have anything to do (have to write an own move.escort first, which depends on proper signalling from move.generic to tell the escorting Ships where to go in advance so everyone boosts/jumps together and passes the Gates in a logical Order like Destroyer - Trader - Destroyer)

also may be better to use the current Version where i have not added a release yet - Marvin Martian pointed out a potential Crash to me when using the "Connect me with..." Option (in fact everything there crashes) and this fix is not yet in a Release. will be in the next, but not sure when that is because the next planned step is a huge one
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

w.evans
Posts: 2962
Joined: Tue, 18. Nov 14, 17:23
x4

Post by w.evans » Mon, 10. Aug 15, 23:22

Thanks for the detailed reply! Yes, I could see now that it's extremely self-contained. So ut.cac ships will be running almost exclusively ut.cac scripts, while non-ut.cac ships will just carry on as before. Cool!
UniTrader wrote:- Marvin Martian pointed out a potential Crash to me when using the "Connect me with..." Option (in fact everything there crashes) and this fix is not yet in a Release. will be in the next, but not sure when that is because the next planned step is a huge one
Encountered that too when I was mindlessly pressing buttons to see what options are available. I think it crashed when I tried to get the manager to connect me with the defence officer. The debug options are fun.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13927
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Mon, 10. Aug 15, 23:37

well, in theory they could run any Script without changing my files as long as it either doesnt need any params or uses the Params also in the orderlist-style i do (passing all params as a single table and then filling the vars based on it) - just append a table with the necesary values to $entity.$orderlist (in most cases refered to as this.$orderlist )

also my Menus are currently mostly Placeholders or declarations of intention, only the currently really necesary stuff is included (Money Transfer, Transferring whole Player Squad to Manager, Opening some Vanilla Menus, activating/deactivating the (EXTENSIVE!) Debug Output per Actor) but this will gradually change when i either encounter how to do something or if i need some function myself
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

User avatar
Marvin Martian
Posts: 2984
Joined: Sun, 8. Apr 12, 09:40
x4

Post by Marvin Martian » Tue, 11. Aug 15, 08:02

What step is required to unsign a ship from the CAC Commander?
Because in case i grab the ship over the IZ direct "in my Squad" Button, the captain already runs the new Menu :roll:

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13927
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Tue, 11. Aug 15, 11:47

Not possible atm, but you can safely remove the NPC via the debug menu and get a new one - this way there shouldn't be any remains (i took great care to keep this as local to the actors as possible and n. If there is demand I will add a restore function

And hint: don't waste skilled NPC on this - currently there is a debug cheat to make them 5stars in everything and I am also planning to add a levelling function and determine how good each NPC performs depending on their skills (for example navigation skill will determine how many spaces can be defined as range, see previous posts)
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13927
Joined: Sun, 20. Nov 05, 23:45
x4

Post by UniTrader » Tue, 11. Aug 15, 12:02

Sparky Sparkycorp wrote:If this mod flows towards shipyards later, might it be possible and desirable to have Managers automatically add new ships to a specified squad/fleet? Although perhaps you have some other means of autonomous replenishment in mind.
Didn't notice this first - yep, it's somewhere on the road map, although I can't tell where atm. Also Ordering repairs or re-equipment if a ship will be done through the respective Engineer who is the responsible to tell the Captain to fly to a Shipyard - and if the Engineer has the budget and skills he will do it automatically (no auto-restoring of the account - if the engineers money is gone he will tell his superior, but he will not grab money from someone)

And related to auto-assignment: depends on ship size - small stuff will be ordered as needed, big stuff will at least need a confirmation from the player (priority cases where for example no necessary ship is available at all) , or the player can assign as many ships as he wants to a random station and the not needed ones will be reassigned to other stations over time via an internal subordinate exchange - at least that's my vision how it should work, but there is still a lot to do before
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 7519
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Tue, 11. Aug 15, 13:52

Thanks for the additional incites. The refueling-like adjustment to repairing is a great idea.

Post Reply

Return to “X Rebirth - Scripts and Modding”