[SCRIPT] Summon Assisting Ships - V2 jan 5 07

The place to discuss scripting and game modifications for X³: Reunion.

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

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

[SCRIPT] Summon Assisting Ships - V2 jan 5 07

Post by Klyith » Sun, 5. Mar 06, 14:47

Summon Assisting Ships (SAS) - Version 2.0
Zip file :: SPK Package

See this post for updating from old versions.

What it does:
Binds three hotkeys to call user-defined groups of player ships to jump to your position. They then protect or follow you, according to the group type.
Group 1 - These ships will protect you and aggressively attack enemies.
Group 2 - Ships in this group will passively follow you when summoned.
Group 3 - This group will protect you, but also has special code for carriers. See readme for details.

Ships in these groups don't have to just sit around waiting for you to call them. They can be doing just about any other task in the meantime, like escorting a different ship, patrolling a sector, or trading. As long as they have enough energy cells to jump to you, they will put their current task on standby and jump to your aid. And when you dock at a station or leave that sector, they will go back to whatever they were doing before you called! They prefer to jump back, but will fly normally if they have insufficient energy to jump. One handy thing about this is that if you've called ships to help against enemies, but then find your force is taking too many casualties, you can just jump out yourself. All the rest of your ships will flee as well.

The ships in a group don't have to be in one place -- since a well-equipped fighter doesn't have enough storage space for energy to jump across the universe, it may be handy to have ships from many different locations in the universe in each group so you're always assured of getting some help no matter where you are. Additionally, if a ship has followers of its own, they will be directed to jump as well. So you don't have to repeat adding 10 ships from a wing that you've already set up, just add the leader.

SAS requires Special Command Software and a jumpdrive on any ship in a group.
Instructions: Bind hotkeys in your controls setup, at the bottom of the interface panel. Add ships to SAS groups by opening the command console of the ship you want to add and selecting special command -> Manage SAS Groups. You will get an incoming message with the buttons to add or remove. Using Manage SAS Groups from your own ship will give you a report of the ships in each group.


Changelog for Version 2:
rebuilt code for group management with new interface
fixed bugs with resetting to previous scripts, added undock checks
removed problematic "fueltask" script
added basic refueling for non-capships
Last edited by Klyith on Sat, 6. Jan 07, 02:59, edited 4 times in total.

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Thu, 9. Mar 06, 23:00

Bump for fully working, stable release. Finally figured out the interrupt system, so ships correctly go back to their old script when SAS is done.

I guess I should put together a SPK package, but I'll need to read that thread to figure out the full details. I'm confused by some of the packager options.

User avatar
Deta7
Posts: 54
Joined: Fri, 2. Dec 05, 22:40
x3

Post by Deta7 » Thu, 9. Mar 06, 23:35

Hi, Klyith,

sounds like a nice one, downloading it already. I'll give it a try and will report my findings :)

Cheerz for sharing your work

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22227
Joined: Sun, 14. Nov 04, 23:26
x4

Post by Cycrow » Fri, 10. Mar 06, 00:56

which are the options your confused about ?
ill try to explain what they do
:)

User avatar
Deta7
Posts: 54
Joined: Fri, 2. Dec 05, 22:40
x3

Post by Deta7 » Sat, 11. Mar 06, 14:44

meisth wrote:Hi, Klyith,

sounds like a nice one, downloading it already. I'll give it a try and will report my findings :)

Cheerz for sharing your work
Did some Testing:

German Version of X3 (edited the textfile)
Assigned a bunch of Multi-Sector Petrol leaders to group 2.
I like the messages you send, giving a lot of detail what's going on, nicely formatted too.


-> result: well, something really seems to have confused that script (prop. my german version) - on each assigned ship the fuel-loop script ran but that was just about it. The ships refused to jump for assistance on hotkey, they also refused to do anything else - whenever I issued a command to them the command was deleated after a few seconds. Also no way out of that fuel loop (it kept running, no matter what I did, unassigning the ships form all groups didn't help. I also noticed when using the 'list' option, the list returned - empty. I'm no sure how you store the groups (global variable?) and I'm also not sure if I did something wrong, but it definetly messed up those ships *lol* - glad you had an uninstalling script delivered with the package. BTW: I had to uninstall and revert to an older save game, because the script kept running on those ships.
I noticed you have a VERY long wait in that fuel script, maybe I should have waited for half an hour or so after unassigning the ships to give the loop a chance to notice ;)

Not sure what was going on, and I actually didn't have the time to investigate in detail, sorry.

Might be the case that it actually works fine, but on essential script missing in that ZIP?

Anyway, I'll keep my eyes out for any updates, if you choose to do any ;)

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Sat, 11. Mar 06, 18:51

meisth wrote:Did some Testing:
I like the messages you send, giving a lot of detail what's going on, nicely formatted too.
Thanks.
meisth wrote:<lots of errors with fuel script>
Ohhh cr*p.
Well, the "fuel" script doesn't actually refuel the ships yet. But it is supposed to fiddle with the ship commands. What happens is, the main summoning script doesn't work if the ship is doing command "None". So it reset them to "Standby". This has to happen in order for the rest of the script to run.
The problem was that the version that I put in the zip was doing the wrong thing, totally bugged. I was trying like 3 different ways to write that, bad idea. Andways, got it fixed now.
meisth wrote:I had to uninstall and revert to an older save game, because the script kept running on those ships.
Fudge. I need to rebuild my uninstall script to take care of that.
meisth wrote:Anyway, I'll keep my eyes out for any updates, if you choose to do any ;)
Oh hell yes. I've re-upped the zip to have the right fueltask script.
I'm working on changing the uninstall script now...

User avatar
Deta7
Posts: 54
Joined: Fri, 2. Dec 05, 22:40
x3

Post by Deta7 » Sat, 11. Mar 06, 19:34

That was quick :)

Cheerz
*rushes of to test the update*

Rainen
Posts: 11
Joined: Thu, 8. Dec 05, 08:24
x3

Post by Rainen » Sun, 12. Mar 06, 07:11

Klyith i really like the idea of this script ( Downloaded as soon as i read what it does )
Wont work for me tho, reading previous posts my prob could be i formed groups with ships with command none , they were then stuck on none, i lost all ability to command them from that point ( will accept a command then revert to none within a second ) also would not jump to aid
Uninstall probs for me too, but i see you got that covered.

Is my prob joining ships with command none? or does this sound like something else like a conflict ( runnung a dozen or more scripts tho on first look i found no command conflict )

I love the idea tho :thumb_up:

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Sun, 12. Mar 06, 20:14

Version 1.1 released.
This fixes the problems with ships always switching to standby which meisth and Rainen got hit by (was also fixed in a re-upload of v1 that I did saturday).
Also fixes a bug I found in the special carrier code.
Improved uninstall that kills the refuel sub-task, though that should be less of a problem now.

Big apologies to anyone who had trouble with v1. Mea culpa! :oops: :( :oops:

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Sun, 12. Mar 06, 20:15

Rainen wrote: Is my prob joining ships with command none?
No, the problem was with my first release, the task that was supposed to reset the command none ships was just totally bugged. I'm really sorry, I released it when I really should have done a second beta and more testing.

If you get the new version 1.1 and install that, it will now work. But any ships with the bugged script will still have problems, there are two ways to fix it. The easiest is to go back to an older save from before you installed the bad version. The other is to use the standard add / remove function to remove them, then add them again. That should reset them. I recommend the first option, to be safe, unless you really want your newer save.
Rainen wrote:I love the idea tho :thumb_up:
Thanks. I hope the final product will be worth the initial problem!

User avatar
Deta7
Posts: 54
Joined: Fri, 2. Dec 05, 22:40
x3

Post by Deta7 » Mon, 13. Mar 06, 20:27

Hey Klyith,

I LOVE YOUR WORK!!!

Did some testing with that 1.00 updated yesterday - you did a great job fixing the issue in the fuel loop so quick. Had loads of fun using groups 1 and 2. Used up like 500 units of projectile ammo in my Mamba just because calling in the refuel ship is so easy now :D (actually I built 2 more ammo fabs to keep up - he he)

Going to DL you 1.1 patch and check group 3 as well.
I noticed a possible prob, namly with carriers that have ships set to it as homebase that are somewhere compleatly different (I tend to set some support ships to a TL as homebase so I can find them). I guess when one of my TL's waits for all ships to re-dock it might wait for ever (or at least for VERY long. Or could you MAYBE use Jump+dock for ships to be called in that are in a different sector ?

Otherwise I'd suggest you put something into the readme for stupids like me that it's not adviseful to set ships to homebase to TL / M2 that is set to a SAS group which (the little ships) are not near their Homebase. (complicated sentance *lol*)

BTW: NM the initial probs, you clearly marked it as BETA, so everyone should be aware of possible "undocumented features" ;) - I like your style sharing your work early and being brave enough to stand the reactions of ppl when something goes a bit off track

EDIT: LOL - I love your Text ID id="1004" ;) nice one!

Cheerz again

Rainen
Posts: 11
Joined: Thu, 8. Dec 05, 08:24
x3

Post by Rainen » Tue, 14. Mar 06, 07:14

Klyith, 1.1 works just fine for me now and yes it was definitely worth the initial problems :) Another hole in game plugged :thumb_up:

D_Zorro
Posts: 2027
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by D_Zorro » Tue, 14. Mar 06, 18:10

This script sounds really interesting, will try it out, thanks for creating it. it's defanantly an improvement for your own wingmen though.



DZorro,
System spec: Pentium (R) D 2.66 Ghz, Ram : 2048 DDR, HD : 250 GIG 7200 RPM intern 8 MB cash
Videocard : Nvidia Geforce 8800 GTS 320mb : Realtek
Laptop : AMD athlon 64 3200 + 1024 DDR 80 gig HD Conexant AMC Audio, Ati mobility Radeon Express 200

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Tue, 14. Mar 06, 19:18

I LOVE YOUR WORK!!!
Klyith, 1.1 works just fine for me now and yes it was definitely worth the initial problems
This script sounds really interesting, will try it out, thanks for creating it
*blush* Thanks everyone.

meisth wrote:Had loads of fun using groups 1 and 2. Used up like 500 units of projectile ammo in my Mamba just because calling in the refuel ship is so easy now :D (actually I built 2 more ammo fabs to keep up - he he)
Heh heh heh. That was my original idea for this script -- it was first going to be called "Special Ammo Ship". Then I started thinking about code and figured out lots more possibilities.

meisth wrote:I noticed a possible prob, namly with carriers that have ships set to it as homebase that are somewhere compleatly different
Ah, but you see, that's not how the carrier docking works. It doesn't call in ships that have it as homebase. It calls ships that are in it's formation as "followers", which includes both protect and follow. So the ships that it docks should always be near it. If they happen to be ships with the carrier as home, that is fine, but any ships that are not directly following the carrier won't be called to dock.

There are some problems that I've identified. The big one is an actual bug: if the carrier doesn't have enough room to dock all the ships that are following it, it will just sit there waiting. I need to put in a test to make sure that doesn't happen. So for now, if you have an elephant in group 3, don't tell more than 10 small ships to guard it.


The second is minor, but something I'd like to work on. Right now the carrier only calls ships that directly follow it. So if you have a "tree" of ships making an organized fleet, not all of then will dock. Example:

Code: Select all

Carrier
   |--M3 Fighter
   |--M3 Fighter
   |   +--M5 Fighter
   |
   +--M6 Cruiser
       |--M4 Fighter
       +--M4 Fighter
So in that chart those are all followers protecting the ship above them in the tree. If the carrier gets a SAS call, it will ask the M3 fighters to dock. The M4s & M5 will not get a direct order to dock. Since the M5 is protecting an M3 that did dock, it will attempt to dock as well, but the carrier won't wait for it. Since it's an M5 and they are fast, it'll probably make it onboard while the carrier is doing the jump countdown. A slower ship might not make it before the jump, or if there were further sub-branches to the "tree" the third level would be unlikely to dock. The M4s on the other hand, their "protectee" isn't docking either, they have no chance. If they don't have a jump drive they will be left behind.

I can fix this by recursively looking through the "followers tree", but it will be tricky coding. The need to keep a count and not try to dock too many ships as per the first bug makes things difficult. It might be too slow to work with if people are constructing a massive war fleet. I'm also not sure how to make the best decisions about which ships to dock and which to leave behind.


Finally, the least important thing is that after your carrier is done with the SAS mission and jumps back to where it came from, it doesn't undock the ships again. So the carrier will go back to it's old orders, but all the small ships won't. I don't know if fixing that will be profitable for the effort I'd need to put it, so for the moment this at the bottom of the list. But my overall goal though is that after you call the ships they all go back exactly as they were, so it is as least on the list.

User avatar
Deta7
Posts: 54
Joined: Fri, 2. Dec 05, 22:40
x3

Post by Deta7 » Tue, 14. Mar 06, 22:48

Thanx again for spelling it out for me :) - that explains why one of my elephants didn't make it (had one of it's M3's out to make room for a fresh cap and forgot about that.)

One thing I ALSO like a lot is that you actually give support to your 'users' - which is more than one dares to ask software corps these days
:roll:

User avatar
Klyith
Posts: 594
Joined: Fri, 6. Jan 06, 01:38
x3

Post by Klyith » Sun, 19. Mar 06, 01:29

Version 1.2
Fixed the "carrier tries to dock too many ships" bug.

Added recursive follower docking. This changes the autodock for carriers so that they will dock their entire "follower tree" (or as many as can fit) as described above. It doesn't do any "smart" decisions about which ships to take and which to leave behind unfortunatly... So if your Elephant has 20 ships escorting it, you won't be sure to end up with the maximum firepower. It depends on how the formation is set up.

I think I've gotten rid of just about all the real problems. I think I'm going to take a short break from working on this script to do a new idea that I had. Then I'll be back to do the automatic refueling.

User avatar
Wundagore
Posts: 124
Joined: Sun, 15. Jan 06, 20:18
x3

Post by Wundagore » Sun, 19. Mar 06, 22:48

I have a couple of questions regarding your script

1) I just downloaded the next version of your script so I might overlook the answer to this.
is the SAS group 3 working now ?
and what exactly is the difference between group 1 and 3

My elephant stands in group 1 and just launches fighters to protect him and me

2) Could it be that your script doesn't work together with Anarkis Carrier Commands ?
If I use the automate carrier command on my TL then it doesn't respond to an SAS call
also any ship that has the TL for homebase thn will not respond if you try to fly it.

I do believe that it might be more of a problem for anarkis
Creator Of The Agian Empire
[quote = "apricotslice"] The generation of random numbers is far too important to be left to chance! [/quote]

Delphis
Posts: 28
Joined: Fri, 25. Aug 06, 03:18
x3

Bug report for SAS - autopilot that won't shut off

Post by Delphis » Sat, 28. Oct 06, 22:44

I had the SAS script installed (1.2) and I had a ship get itself unable to go off autopilot. i.e. you press the key, it goes off autopilot and goes right back on again.

I originally posted my problem in this thread: http://forum2.egosoft.com/viewtopic.php?t=158675

"Has anyone experienced autopilot not being able to be turned off in a carrier ship after docking with it?

I've tried 'reinit script caches' and undocking and redocking, also setting command to 'None' but the ship's command remains at 'Standby' and when in the ship as the player, the autopilot toggle key turns it off but it comes right back on again.

Has anyone else experienced this? X3, with 1.4.03 patch."

This is the content of my report after I found out what was causing the problem

"Okay.. time to report back. Thanks for the hint about the script editor.. I knew I'd seen debugging options but in tinkering with it I saw that going to it through the ship's orders menu you can select the debug level for just that object. Nice.

I loaded up the last save game I have, and I am onboard the ship in question. I cleared turret commands (since that was mentioned). Went into the script editor, set it to 'Trace' for my ship, cleared the debug log and then re-enabled 'Attack all enemies' on the turrets. I don't know if the turrets made any difference but the autopilot went off when clicked the button, then it came back on again. So, I go to the debug output and see:

plugin.pdp.sas.fueltask and a 'while [TRUE]' statement. so.. 'Summon Assisting Ships' was to blame. Sure enough, removal of this script, reloading the same save position then doing the reinitalization (reinit script cache, and turn autopilot off) and it stays off, the command is listed in the debug log but since the script is removed it does not get restarted and hang itself in the loop."

Posted here for completeness.

dostillevi
Posts: 184
Joined: Thu, 9. Mar 06, 02:32
x3

Post by dostillevi » Sun, 10. Dec 06, 08:43

This looks like a really useful script that has maybe been overlooked. Any chance these last few bugs can be worked out?

dostillevi
Posts: 184
Joined: Thu, 9. Mar 06, 02:32
x3

Post by dostillevi » Fri, 22. Dec 06, 06:56

Maybe someone who has used this can help me out. No matter what I do I can't get the special menu to show up with the commands in it. I've tried reinitializing the script cache.. everything. I've never once had the commands show up, even on a clean game install with just this mod. I really want to use this.. but I can't! help please :)

Post Reply

Return to “X³: Reunion - Scripts and Modding”