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
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!
....
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
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.