Page 1 of 5

[SCRIPT] Group Management System

Posted: Tue, 3. Oct 06, 18:47
by moggy2
[Readme] . [Bug Tracking] . [Download]

Script: Group Management System
Author: Xai Corporation
Download: http://www.xai-corp.net/project/XaiCorp-gms
  • The Group Management System allows you to quickly define a group from a collection of ships in the same location. You can define a Group Name, a Group Number and you can limit the selection to a specific number and class of ship.

    In addition to quickly defining groups the GMS also provides a mechanism for automatically refueling and rearming as well as a mechanism for keeping ships in the group if they lose their command for some reason.

    The Commands

    1. Setup Group
    - this command allows you to define the group
    - the ship you run this command on will be the group leader
    - you can set the name and number of the group,
    - entering nothing for the name will use the existing group name
    - you select the number, and type of ships to add to the group.
    - by default, ships added to the group will be given the command to protect the leader
    - ships will take the leader's homebase as their own

    2. This Group: Attack Leader's Target
    - this command allows you to set some or all ships in the group to the command __attack target of...leader__
    - you can select how many ships should ''not'' be set to attack their leader's target

    3. Group Management System
    - this command allows the ships to be have as group members
    - it makes sure the group stays together, by giving the order to protect the leader if this ship has nothing else to do.
    - it handles the automatic resupply of energy for jumpdrives, missile and ammo, when docked at stations that sell the supplies.

    The ''Group Management System'' Command is what performs the group maintenance such as refueling or restating ships to follow their leader. It is automatically started when you create the group with the ''Setup Group'' command, but can be shut down and restarted when ever necessary.

Posted: Tue, 3. Oct 06, 18:53
by Kagurati
Ooooooh.... Spiffy looking.

And it sounds like it's a good alternative for Anarkis Carrier Commands, but can you assign a group to like, all docked ships for instance?

Posted: Tue, 3. Oct 06, 19:49
by moggy2
Kagurati wrote:...but can you assign a group to like, all docked ships for instance?
When setting up a group you specify how many ships from the pool of docked ships to become members of the group. You could set this number to the number of ships docked and it'd add all of them.

Posted: Wed, 4. Oct 06, 09:22
by jlehtone
This package seems to have many features that are listed in "wanted in scripts considered for signing", not to mention "better fleet commands"-threads in the DevNet. 8)

:thumb_up:


IMO, Anarkis Carrier Commands is something different. There, the Carrier manages its fighters, IS and OOS.


Q1: What happens if I start with 30 Nova and do:
- Setup Group "1", 10 ships
- Setup Group "2", 10 ships
- Setup Group "3", 10 ships
Will I get three groups of 10 ships each, or one 10-ship, maybe two smaller and still free ships?


Q2: Group in Carrier. All have homebase set to the Carrier, because the Leader has. Set to "Attack target of Leader". AI Carrier gets hit IS. It sets "Attack all and land to homebased and armed fighters". When will GMS revert the group to the "Attack target of Leader"?

Posted: Wed, 4. Oct 06, 17:33
by moggy2
Q1: If you've got 30 Nova's docked at a carrier. You select 1 and run Setup Group: number 1, 9 ships. This'll give you a group of 10 ships, 9 protecting the one you ran the setup command from.
Select another unused Nova and do the same, calling it group 2. You now have 2 groups of 10 ships and 10 free ships left...

Q2 I haven't tested it on carriers, but if X3 works like the previous games, fighters are only automatically launched if they have no other commands. So what should happen is the group leaders will recieve the command to attack all then land and their group will follow them.

Posted: Wed, 4. Oct 06, 21:57
by jlehtone
So the Setup will always pick from unused ships and not from ones already running a command. Good.

And now that you say it, I've already had manually set up "Attack target of leader" groups and yes, it is only the leaders without commands that "attack-and-land". The rest follow obediently. But I have not used them much, because the manual setup is such a pain.

Posted: Thu, 5. Oct 06, 06:27
by moggy2
jlehtone wrote:So the Setup will always pick from unused ships and not from ones already running a command. Good.
...
It'll use up the ones already following the leadship first, then make up the extras from any ships without commands.

///

Posted: Thu, 5. Oct 06, 07:55
by darkelfsin
nice one..

will there be any group formation feature?. :?:

Re: ///

Posted: Thu, 5. Oct 06, 09:41
by jlehtone
darkelfsin wrote:will there be any group formation feature?. :?:
Vanilla game already has "group formations". You do choose formation in the command console of the leader ship. Line, X, Delta, Delta-X, Pyramid, Dragonclaw, ...

Re: ///

Posted: Thu, 5. Oct 06, 16:23
by moggy2
darkelfsin wrote:nice one..

will there be any group formation feature?. :?:
:?
please explain

Posted: Mon, 16. Oct 06, 18:04
by Puruco
Hi Moggy2: In accordace with the reading of this post I can use the Anarkis Command for the managment of the carrier ships and your group managment for the fleet?

Posted: Mon, 16. Oct 06, 18:55
by moggy2
as far as I know they don't clash, so there's no reason not to have both scripts installed.

I don't know what Anarkis Carrier Commands is capable of so I've no idea if it will interfere with GMS managed groups on a carrier. They may well complement each other.

try it and see.

Posted: Mon, 16. Oct 06, 20:00
by Puruco
Thanks moggy2 I will try it and let you known.

Posted: Thu, 19. Oct 06, 01:52
by retro19
I have a question about this...
If I make a convoy of 3 M6 and 7 M3, 1 of the M6 is a flag ship the other 2 are set to protect the flag ship and the M3 are set into 2 groups and protect the 2 asisting M6 what will happer if for eg. a pirate ship chooses to atack 1 of the M3? Will the whole convoy react? Or will the M3's wait untill 1 of their protected ships get attacked and let the lone M3 escort get waisted? And how to set the convoy right?

Posted: Thu, 19. Oct 06, 06:31
by moggy2
depends on the commands I think. If they're all running the protect command then they all react. If they're running other commands then they don't always react.

Grouping ships / combining differens ships

Posted: Thu, 19. Oct 06, 10:38
by wanderer
Hey moggy2,


had a problem, with combining groups of different ship types.
(Seems same as the feature request 'Creating groups of non-combat ships' on your Xai side).


Well what I want:
- Create a Battle group with M1, 2xM2, 3M6 + Moded M7,M8 (from XtendedMod)
- Create Trader Groups *xTS, TL,...
- Mixed Groups

As a solution I checked your code in 'plugin.Xai.grp.gms.setupGrp.cmd.xml'. There you had a code snipped 'setup ships currently in formation with us'. This I copied and changed (see here). Now, I can setup groups as I described above.

Here my additions:

Code: Select all

046   * setup ships currently in formation with us without filter
047   * -1 as count of ships to only use followers
048   if $amount == -1
049    $ships.list = [THIS] -> get formation follower ships
050    if  is datatyp[ $ships.list ] == DATATYP_ARRAY
051     append [THIS] to array $ships.list
052     $ships.list.num =  size of array $ships.list
053     $filter = Ship
054     while $ships.list.num
055      dec $ships.list.num = 
056      $ship = $ships.list[$ships.list.num]
057 @    = wait randomly from 100 to 150 ms
058   * DEBUG: Log the ship when it is assigned
059      $Ship.name = $ship -> get name
060      write to player logbook: printf: fmt='XAI Group Commands: Adding ship %s; to group %s, number %s', $Ship.name, $f.num, $ships.list.num, null, null
061      gosub setDetails
062     end
063    end
064    return null
065   end
066   
This changes has to be done BEFORE the code part '* setup ships currently in formation with us'. Also, you have to change the following parts a little bit:

Code: Select all

....
068   * setup ships currently in formation with us
069   if $amount > 0   <-- New!

and

135   *= wait null ms
136    return null
137   end  <-- New!
....
Here you need an IF because, your script goes down and tries to add even ships in the sector which are not following (eg. Nav.Sats :D ). As you see, normally you don't need the 4th input anymore, I set it fix to the type 'ship'. This I need because of your gosub routine, which checks the ship type.

How it works:
You define a ship taking some actions. Then you define followers. Use the command to setup group; Input: 'Name', 'Group number', now as 3rd '-1', 'ship' (will not be used, you can select every type).

With this only the followers now are in the group no other ships. So, now you have a defined Group eg. of traders, Battle ships, or mixed...
Be aware, all group members still get the command protect leader after the group is set - Here nothing is changed.

so long,
wanderer

PS: Some notes - I had some strange results while testing, so sometimes I got in the command 2 times the command slot :wink:
Also, using the missle plugIn - Only when I set the Missile Fire Probability from the leader it works. Setting it from a group member brings up some curious effects. No Missile Fire Probability will be set to the group, and the command for the group management disapears.
As with the naming, it would be cool, if you save the old name, and when deselecting the command for the group, rename the ship back to its original name.

Posted: Thu, 19. Oct 06, 16:52
by moggy2
If I do that, you wont be able to create a group from 5 of your 10 newly bought Novas, without first launching one and telling 4 to follow it, the running the setup group command.

Posted: Fri, 20. Oct 06, 14:08
by wanderer
Hi moggy2,


moggy2 wrote:If I do that, you wont be able to create a group from 5 of your 10 newly bought Novas, without first launching one and telling 4 to follow it, the running the setup group command.
Nop, because as in the code example above i use '-1' as 'How many ships?' (Variable: $amount) to go around the original ship selection code. When you are using 0,1,2 or more in the 3rd input parameter, the script is working as before. So you will get the Noves without the following order as well.

Well may be the if in the second example above should be 'if $amount => 0'. Will test it.

regards
wanderer

Hm, thinking...
I should point out more clearly, that above example is a dupplicate of your codesnipped 'setup ships currently in formation with us'. I dupplicated your code snipped BEFORE yours a second time, and changed it as described. So in case the $amount is -1, it goes only here. In case its 0,1 or greater it goes down to your code and processes as you want it.

Posted: Fri, 27. Oct 06, 20:02
by moggy2
updated to allow groups to automatically resupply from carriers.

Posted: Mon, 6. Nov 06, 17:04
by Puruco
I want to make a group of 1 Centaur 3 M3's and 3 M4's. I can only get in the group the Centaur (lider) and the M3's, not the M4's. How I can include them?