[SCRIPT] Group Management System

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

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

This script is...

pointless
1
1%
interesting, but I wont use it
5
7%
usefull
66
92%
 
Total votes: 72

User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Thu, 18. Sep 08, 02:52

Hello :)
Firstly, this is a v nice script. But right to the point

I'm writing an extremely dynamic Fleet ReSupply script, and I would like to interface it with GMS. But I'm having unexpected difficulty making heads or tail of your script.

In short, I'm trying to get the array of all ships in a group, and feed that through to my scripts.


And one final question, I'm going to need to put in error checkers to make sure that both GMS and FRS don't run at the same time. (Either by disabling GMS's resup, or by disallowing mine if yours is present). Are the only variables I have to change/check the:
015 |$LOCVAR.mloadout = 'group.mloadout'
016 |$LOCVAR.ammo.mult = 'group.ammo.multiplier'
017 |$LOCVAR.energy.mult = 'group.energy.levels'

i.e. Setting the Local variables respective max and min quantities to 0 (in the arrays)


*edit* Wait... setting to 0 wont work... I'll have to set them to the same as my scripts desired amounts. So essentially both will be running in tandem, but doing the same thing.
Oh and One last Question, can you script ever change those min/max values? (other then when they are ==Null?)

User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 » Thu, 18. Sep 08, 22:32

I think GMS simply uses the get formation ships when looking for other ships in the group.
If you want to get an array of all the ships currently following the group leader then the BP does seem to have lib.xi.groups which will do that. FSUP uses that script to get a list of ships to resupply like this:

Code: Select all

011   * Find ships in group
012 @ $group.leader = [THIS] -> call script 'lib.xi.groups' :  Command='find.leader'  Group  Member=$group.ship  Ships Array=null  Lead ship=null
013   [THIS] -> set command target2: $group.leader
014   $group.ships =  array alloc: size=0
015 @ $group.ships = [THIS] -> call script 'lib.xi.groups' :  Command='find.ships'  Group  Member=$group.leader  Ships Array=$group.ships  Lead ship=null
if you want to switch off the GMS resupply then set
'group.mloadout' to NULL
'group.energy.levels' to array(0,0), and
'group.ammo.multiplier' to array()

That will stop GMS doing any resupply when docking.

Alternatively, if your script does resupply on docking, you could set the appropriate values for those variables and let GMS do it.
'group.energy.levels' takes a 2 element array(min energy before resupply, max energy after resupply)
'group.ammo.multiplier' is an array with 4 elements: Weapon, Ammo, how much to load for each weapon, and minimum level before resupplied.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Fri, 19. Sep 08, 12:34

s9ilent wrote:And one final question, I'm going to need to put in error checkers to make sure that both GMS and FRS don't run at the same time. (Either by disabling GMS's resup, or by disallowing mine if yours is present). Are the only variables I have to change/check the:
015 |$LOCVAR.mloadout = 'group.mloadout'
016 |$LOCVAR.ammo.mult = 'group.ammo.multiplier'
If you want to write a dynamic fleet resupply script you won't get far with the GMS script.

By design it does not resupply the ammo needed by the ships lasers.
What it does is load mass driver ammo if mass drivers are used.
See the difference?

If you check all lasers on the ship you can be sure you got all ammo types and that the script works with all mods.
To me that is what dynamic means - a script where the data isn't hardcoded when it's not at all necessary.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 » Fri, 19. Sep 08, 14:03

Gazz wrote:
s9ilent wrote:And one final question, I'm going to need to put in error checkers to make sure that both GMS and FRS don't run at the same time. (Either by disabling GMS's resup, or by disallowing mine if yours is present). Are the only variables I have to change/check the:
015 |$LOCVAR.mloadout = 'group.mloadout'
016 |$LOCVAR.ammo.mult = 'group.ammo.multiplier'
If you want to write a dynamic fleet resupply script you won't get far with the GMS script.

By design it does not resupply the ammo needed by the ships lasers.
What it does is load mass driver ammo if mass drivers are used.
See the difference?
set the right variables in the array and it'll resupply any ware based on the mount of another ware in your hold. You could resupply delexien wheat based on the number of crystals in the cargo bay if you wanted. And yes it can cope with multiple items.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Fri, 19. Sep 08, 14:19

moggy2 wrote:set the right variables in the array and it'll resupply any ware based on the mount of another ware in your hold. You could resupply delexien wheat based on the number of crystals in the cargo bay if you wanted. And yes it can cope with multiple items.
Yes, that's exactly what I mean.
The script has to be edited before it is compatible with a laser mod.

I'm not complaining about the GMS but merely suggesting that S9 does not hardcode the ammo wares in his script when he could just as easily read them from the lasers (ware maintype 8) that the ship actually has on board. Can't be that many.
That way it always works with all current and future laser mods without the need for maintainance.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
moggy2
Posts: 5505
Joined: Wed, 6. Nov 02, 20:31
x3ap

Post by moggy2 » Fri, 19. Sep 08, 22:40

Gazz wrote:
moggy2 wrote:set the right variables in the array and it'll resupply any ware based on the mount of another ware in your hold. You could resupply delexien wheat based on the number of crystals in the cargo bay if you wanted. And yes it can cope with multiple items.
Yes, that's exactly what I mean.
The script has to be edited before it is compatible with a laser mod.

I'm not complaining about the GMS but merely suggesting that S9 does not hardcode the ammo wares in his script when he could just as easily read them from the lasers (ware maintype 8) that the ship actually has on board. Can't be that many.
That way it always works with all current and future laser mods without the need for maintainance.
No, it was specifically writen to be compatible with any additional weapons that use ammo that mod might create. All you have to do is save the appropriate array in the local variable. GMS will load what ever you ask it to, without any modifications.

User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Fri, 19. Sep 08, 23:32

I'm not trying to make a dynamic fleet resupply out of GMS, I'm just trying to make one that is capable of interfaces with it. (I might consider calling it DFR actually.... I've just dubbed it fleet resupply atm as I couldn't think of anything better....)

Currently Its not very compatible with laser mods... but I could change it easily
I do use subtypes/main types... butttt I was lazy and didn't want to manage multiple arrays, so I just appended the commodities, lasers, shields and missiles subtypes together indexed against a constant value.

But you do have a very good point. I'll change my setup script to just use "get max sub types in main type" and use those values instead of the constants I have now. However... it won't be change mod half way through playing proof (whilst is not recommend to begin with, is usually still do-able).

ie laser index = their subtype, shields index = there subtype + max(laser subtype), missile = their sub + max (shields + lasers)
instead of just missiles = sub + 60 or w/e

But any way... where escaping from the OP's meaning so.. meh

Neko-XIII
Posts: 25
Joined: Thu, 9. Mar 06, 18:49
x3

Post by Neko-XIII » Mon, 15. Jun 09, 18:33

jlehtone wrote:
The group name input can also take several options that make specifying the name easier:
- -unset or -u. This option disbands the group. The group parameters are removed from the ships in the group and the names are reset to their names before they became part of a group.
Were do i type this stuff in to unset groups,

Also the hotkey commands only work if ur in the sector that your group is located in, for example i have 1 carrier and two destroters set to group 1 with the two destroyers set to protect the carrier, so i tell the carrier to jump to a sector and the destroyers follow and the carrier automaticly starts to attack all enemys and starts moving round every were which i find quite annouying as i only wanted him to jump and stay put,...

so i then use the hot key i set to make the group hold postion but nothing happens so i have to go into the property menu and do it all manualy,...if u could update it so u can control groups with the hot key commands from several sectors away this would be very helpful to me,...

And if there is a way to set the defualt command for groups to standby after they finished an order (this would make more sence) could some one plz tell me how to that

o yeah and if a group jump + jump to postion hotkey could be added that works with cycrows advanced jump drive and targeting scanners this would be REALLY helpful,...thanks all
Deliverance of Destruction to Traffic Information


Skunk_17

Post Reply

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