CAG, EST, CLS port/remake?

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

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

Ship to ship transporter

Poll ended at Mon, 11. Feb 19, 15:03

Lump cost in with CLS software
3
25%
Create a new "Transporter" ware
3
25%
Use transporter research (no additional cost)
6
50%
Other (described in comments)
0
No votes
 
Total votes: 12

morbideth
Posts: 391
Joined: Sun, 9. Nov 08, 03:07
x3tc

CAG, EST, CLS port/remake?

Post by morbideth » Tue, 25. Dec 18, 00:06

I find myself missing many of the features in Lucike's scripts, like the auto-renaming. Is anyone working on recreating or porting those scripts? Stations seems to be the only thing that works well currently, but I really need a CAG if I'm going to spread my empire across sectors. I'm certainly going to need one once player shipbuilding comes out. I'm not sure if I have time to work on this myself, plus there are other things I could try to fix if someone else is doing this already. If not... maybe as a community thing?
Last edited by morbideth on Mon, 4. Feb 19, 15:03, edited 1 time in total.

morbideth
Posts: 391
Joined: Sun, 9. Nov 08, 03:07
x3tc

Re: CAG, EST, CLS port/remake?

Post by morbideth » Wed, 26. Dec 18, 21:33

As no one called dibs, I guess I'll give this a shot.
Some things that have to be figured out:
  1. How to have a script running in the background, this is needed for renaming mostly.
  2. Alternatively, how to trigger a MD cue from a aiscript, and tie the cue to a ship (make it local to the ship).
  3. A goto sub emulation.
  4. Try to see if there is a way to add new skills via vannilla's skill system as that would save a ton of work.
  5. Some way to improve to UI for issuing orders without making it incompatible with every other mod that needs those files.
  6. Probably a bunch more.

Tyrant597
Posts: 299
Joined: Wed, 9. Apr 08, 05:52
x4

Re: CAG, EST, CLS port/remake?

Post by Tyrant597 » Thu, 27. Dec 18, 01:16

1.

Code: Select all

      <conditions>
        <event_cue_signalled cue="md.Setup.Start" />
      </conditions>
Will start your md script at the beginning of a new session. Then you can run it indefinitely.
<event_ui_triggered /> might be useful too, for renaming.

2. Not sure why? Generally aiscripts are tied to individual ships, and MD scripts are triggered in the background.
You can use <signal_cue_instantly /> to signal a cue in an entirely different mdscript.
You can have an mdscript search all player ships and find one with a certain order / default behavior, then take actions on that specific ship.

3. Do you mean

Code: Select all

<label name="start"/>
<do_stuff/>
<resume label="start"/>
You don't talks about X:Rebirth...
X4 Mods: Collect Inventory Wares Stations Supply Build Storage Mass Move Marines

morbideth
Posts: 391
Joined: Sun, 9. Nov 08, 03:07
x3tc

Re: CAG, EST, CLS port/remake?

Post by morbideth » Thu, 27. Dec 18, 01:41

Tyrant597 wrote:
Thu, 27. Dec 18, 01:16
1.

Code: Select all

      <conditions>
        <event_cue_signalled cue="md.Setup.Start" />
      </conditions>
Will start your md script at the beginning of a new session. Then you can run it indefinitely.
<event_ui_triggered /> might be useful too, for renaming.

2. Not sure why? Generally aiscripts are tied to individual ships, and MD scripts are triggered in the background.
You can use <signal_cue_instantly /> to signal a cue in an entirely different mdscript.
You can have an mdscript search all player ships and find one with a certain order / default behavior, then take actions on that specific ship.
In X3, scripts could be attached to [THIS] without it being a blocking action, you didn't have to wait for it to return. So they could run forever, or until the mod was uninstalled. The rename script runs ever 120 ticks (2 mins?), that's pretty expensive to search the whole galaxy for ships that frequently compared to this.knownname.
Tyrant597 wrote:
Thu, 27. Dec 18, 01:16
3. Do you mean

Code: Select all

<label name="start"/>
<do_stuff/>
<resume label="start"/>
A gosub is like a function, it returns to the calling point. A resume returns to a fixed point in the code. i.e. there is a gosub SectorCheck to check for blacklisted sectors, that is used all over the place.

pesoda
Posts: 16
Joined: Thu, 13. Dec 18, 19:45
x4

Re: CAG, EST, CLS port/remake?

Post by pesoda » Thu, 27. Dec 18, 03:46

morbideth wrote:
Thu, 27. Dec 18, 01:41
The rename script runs ever 120 ticks (2 mins?), that's pretty expensive to search the whole galaxy for ships that frequently compared to this.knownname.
It will be solved if we can create a new text area next to a ship name for indicating a default order.
morbideth wrote:
Wed, 26. Dec 18, 21:33
5. Some way to improve to UI for issuing orders without making it incompatible with every other mod that needs those files.
Promising. Functions that are provided in UIs will allow to remove specificity of codes and solve a problem of compatibility of various order mods. I suppose an external mod manager for "diff and pack" of UI improvements will be required in future.

morbideth
Posts: 391
Joined: Sun, 9. Nov 08, 03:07
x3tc

Re: CAG, EST, CLS port/remake?

Post by morbideth » Sun, 6. Jan 19, 03:44

Just a progress update on this, for those interested. I have been working on EST, and have a functioning trader. Right now I am working on the menus which is proving rather time consuming. I hope to have a playable version out soon(tm). Lots of little things still need to be done in addition to the menu. Once EST is ready for a phase one release, I expect CAG and CLS to quickly follow. Not all features are going to make it into the first release, as you can see below, a number of options are grayed out.
[ external image ]
[ external image ]
[ external image ]

Eukatae
Posts: 52
Joined: Thu, 28. Feb 13, 16:22
x4

Re: CAG, EST, CLS port/remake?

Post by Eukatae » Sun, 6. Jan 19, 03:55

OHH SO EXCITED!

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

Re: CAG, EST, CLS port/remake?

Post by UniTrader » Sun, 6. Jan 19, 04:27

regarding Renaming: iI have got something in the works doesnt search through the galaxy for Ships, but rather uses Performance-Friendly Events to re-process the (unformatted) Ship Name when needed instead of every 2 minutes
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 ;)

Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Re: CAG, EST, CLS port/remake?

Post by Requiemfang » Sun, 6. Jan 19, 04:28

Indeed that is awesome news.

morbideth
Posts: 391
Joined: Sun, 9. Nov 08, 03:07
x3tc

Re: CAG, EST, CLS port/remake?

Post by morbideth » Sun, 6. Jan 19, 04:51

UniTrader wrote:
Sun, 6. Jan 19, 04:27
regarding Renaming: iI have got something in the works doesnt search through the galaxy for Ships, but rather uses Performance-Friendly Events to re-process the (unformatted) Ship Name when needed instead of every 2 minutes
That sounds fantastic, will you let me use it in this/these?

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

Re: CAG, EST, CLS port/remake?

Post by UniTrader » Sun, 6. Jan 19, 05:49

i also have an API from AI/MD, specifically for this purpose:

Example Code to set up a script defined expression:

Code: Select all

<do_if value="player.entity.$namereplacement.{$componen}t?" comment="check if Renaming Script is installed/running for the object">
  <set_value name="player.entity.$namereplacement.{$component}.$expression" exact="'resultvalue'"/>
  <signal_objects object="$component" param="'Object Name Updated'"/>
</do_if>
when '$expression' is somewhere in the unformatted name it will be replaced with 'resultvalue'. just signal the object which could contain it whenever the value changes (just not too often, ship names are not intended for Marquee text :D )

PS github Repo of my WiP Version:
https://github.com/UniTrader/ut_advanced_renaming
(Note: might be ocassionally broken, but with most commits it works; abusing Github for Synchronizing of this, so every typo i test with is included :D)
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 ;)

morbideth
Posts: 391
Joined: Sun, 9. Nov 08, 03:07
x3tc

Re: CAG, EST, CLS port/remake?

Post by morbideth » Tue, 22. Jan 19, 03:03

Another update. I've been continuing to work on this, and just finished phase one of CAG. I've revamped my original plan to release the phase one versions and upgrade after release. I just wasn't happy with how EST functioned without some of the features. CAG works better, but I am still holding off on release until I add more features. I think I know how I can do custom skills now, so that should be easy to do for phase two if it works like I think it does. New in CAG is renaming, below you see the prototype menu for the renaming section. I'm quite happy with how it turned out. In fact, I think it is better than the original. In this version, you simply click on which tokens you wish to include in the name, and it will add them. Click again on a token to remove it from the name. There are still presets in the drop-down list, but those just populate the name with a set of tokens that can then be edited.

[ external image ]

Tooltips are also a huge boon when it comes to explaining things. The screenshot didn't capture the mouse, but I was hovering over factor number. I did figure out how to run multiple scripts on the same ship at the same time. I think this method can be used for some kind of MARS like scripts in the future. More testing is needed.

Now I need some feedback. I have not implemented any of the global or administrative menus that come with CAG, EST, or CLS. In X3 those menus were accessed via hotkeys, which isn't an option for us. I could add them to the right-click menus, it is just, I can't remember using them very much so I am unsure if its something I should spend effort on. Does anyone feel strongly about said menus? Menus, it should be said, are rather time-consuming given the way we have to do them.

Also, I am now moving onto CLS. If you recall there is an MK1 and MK2 version of CLS. I'm not sure if I need to do both. I think the MK2 version can do everything the MK1 can and more. Does anyone remember differently, or have a strong preference for the MK1 version, or a particular feature of the MK1 version?

ajeffco
Posts: 25
Joined: Sun, 7. Dec 03, 04:02
x4

Re: CAG, EST, CLS port/remake?

Post by ajeffco » Tue, 22. Jan 19, 05:57

Looks nice, can't wait until you release it!

Kraszus
Posts: 15
Joined: Thu, 30. Oct 08, 16:03
x4

Re: CAG, EST, CLS port/remake?

Post by Kraszus » Wed, 23. Jan 19, 17:52

Excellent work, Morbideth! Kudos :D

morbideth
Posts: 391
Joined: Sun, 9. Nov 08, 03:07
x3tc

Re: CAG, EST, CLS port/remake?

Post by morbideth » Fri, 25. Jan 19, 00:00

Digging into this, I am unsure what to do about resupplying ammunition and drones. Can anyone who played X:Rebirth tell me how it was handled in that game vs X3?

Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Re: CAG, EST, CLS port/remake?

Post by Requiemfang » Fri, 25. Jan 19, 03:29

morbideth wrote:
Fri, 25. Jan 19, 00:00
Digging into this, I am unsure what to do about resupplying ammunition and drones. Can anyone who played X:Rebirth tell me how it was handled in that game vs X3?
I can't recall really, although if you had ships that had jumpdrives, they would automatically refuel themselves to get the cells required to refill. I can vaguely recall that there was a replenish setting for drones, missiles I am not sure about but I will say that back in X3 they had this setting for missiles, drones and jump fuel.

morbideth
Posts: 391
Joined: Sun, 9. Nov 08, 03:07
x3tc

Re: CAG, EST, CLS port/remake?

Post by morbideth » Fri, 25. Jan 19, 08:52

Requiemfang wrote:
Fri, 25. Jan 19, 03:29
I can't recall really, although if you had ships that had jumpdrives, they would automatically refuel themselves to get the cells required to refill. I can vaguely recall that there was a replenish setting for drones, missiles I am not sure about
This was in X:Rebirth? I have X3 installed so I have a reference for that. Sounds like you are saying X:Rebirth was very similar to X3. If so I have to wonder why they changed something that worked fairly well to... well nothing atm.

Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Re: CAG, EST, CLS port/remake?

Post by Requiemfang » Fri, 25. Jan 19, 15:26

morbideth wrote:
Fri, 25. Jan 19, 08:52
Requiemfang wrote:
Fri, 25. Jan 19, 03:29
I can't recall really, although if you had ships that had jumpdrives, they would automatically refuel themselves to get the cells required to refill. I can vaguely recall that there was a replenish setting for drones, missiles I am not sure about
This was in X:Rebirth? I have X3 installed so I have a reference for that. Sounds like you are saying X:Rebirth was very similar to X3. If so I have to wonder why they changed something that worked fairly well to... well nothing atm.
Can't remember exactly I haven't played XR in a while :lol:

User avatar
BugMeister
Posts: 13647
Joined: Thu, 15. Jul 04, 04:41
x4

Re: CAG, EST, CLS port/remake?

Post by BugMeister » Fri, 25. Jan 19, 20:36

hey, nice one..!! 8)
- the whole universe is running in BETA mode - we're working on it.. beep..!! :D :thumb_up:

morbideth
Posts: 391
Joined: Sun, 9. Nov 08, 03:07
x3tc

Re: CAG, EST, CLS port/remake?

Post by morbideth » Mon, 4. Feb 19, 15:37

Time for another update. CLS MK1 phase one is complete. Not a lot of flashy stuff to show of, so no image this time. I added coloring and "separators", various punctuation ~.|[]{}()_-:\/ that you can use instead of spaces, if you want, when renaming. Most of the upgrades in this version are in terms of library scripts. I wrote a Lua script to make it easier to choose objects from the map, the current method works ok for sectors, but not so much for everything else. Some movement commands to handle delivering goods to TLs, large freighters in X4. That was a lot of work, and brings me to the poll I have added at the top. When moving goods between ships I did not use the vanilla method of dumping the cargo in space as I feel that is a horrible way to do things. Ships that are docked at the same place just transfer wares between themselves same as they can with a station. However, for ships that are not docked, and can't dock with each other, things are a little trickier. X3 had a transporter upgrade that you could buy to handle this, which allowed you to teleport goods between ships if they were within 10km of one another. It was expensive, ~800k iirc. As there is no such upgrade in X4, I am simply requiring teleportation to be researched before allowing you to transfer goods between ships in space. I'm not really happy with this though, as it seems a bit powerful, and research is way too easy. So, my question to you, what should I do about it? I could make a teleporter ware for X4, it wouldn't be hard, but it would only work with CLS. As you already require a software upgrade to be able to run CLS I could just bundle the cost of the transporter in with the cost of the CLS software, increasing its cost by ~800k. That would be pretty easy from my end. The third option is just to leave it like it is, requiring only the research.

I'm off to work on CLS MK2 now. I have decided to do both. It turns out that are fairly different with how they work. I still have not figured out what to do about resupplying ammo and such. Might wait till after the initial release. It depends on how close v2.0 is when I reach that point.

I spent a lot of time trying to add my own commands but could not figure out how to do so. If anyone knows how to do that, please let me know. I assumed it would be like adding a faction, but there is no file for commands. I mean things like command.move for use with <set_command>.

Post Reply

Return to “X4: Foundations - Scripts and Modding”