[FIXED] LUA - Groups Do Not RAS to Completion Consistently
Moderator: MOD_Command
[FIXED] LUA - Groups Do Not RAS to Completion Consistently
Hello all,
One other issue I noticed while trying out some scripts I’m working on:
When I use the script found in this post to order my group units to RAS when low on fuel, all units move to the tanker but not all units completely fill up on fuel.
It’s like they begin feeling, but when the next ship enters the queue it kicks off the preceding unit then they take their place. This means that units return to formation without having fully refuelled, necessitating a second RAS to be conducted.
As with my previous post, I’m sorry I can’t post a save. My laptop just doesn’t want to work now so I need to buy a new one.
I hope this can be solved in the fullness to time, or someone can figure out where I’m going wrong.
Steps to reproduce:
1. Create a group of around 5 units - with 1 unit being a tanker,
2. Edit my script, linked above, to reflect your unit names,
3. Order the group to charge around for a few hours to use up fuel,
4. Use the script to initiate RAS,
5. Units should all proceed to the tanker and be bumped off the front of the queue as the next unit arrives, regardless of if they have a full tank or not.
One other issue I noticed while trying out some scripts I’m working on:
When I use the script found in this post to order my group units to RAS when low on fuel, all units move to the tanker but not all units completely fill up on fuel.
It’s like they begin feeling, but when the next ship enters the queue it kicks off the preceding unit then they take their place. This means that units return to formation without having fully refuelled, necessitating a second RAS to be conducted.
As with my previous post, I’m sorry I can’t post a save. My laptop just doesn’t want to work now so I need to buy a new one.
I hope this can be solved in the fullness to time, or someone can figure out where I’m going wrong.
Steps to reproduce:
1. Create a group of around 5 units - with 1 unit being a tanker,
2. Edit my script, linked above, to reflect your unit names,
3. Order the group to charge around for a few hours to use up fuel,
4. Use the script to initiate RAS,
5. Units should all proceed to the tanker and be bumped off the front of the queue as the next unit arrives, regardless of if they have a full tank or not.
Re: LUA - Groups Do Not RAS to Completion Consistently
I imagine that you will not have to call the next unit to refuel until the unit that is refueling is finished.
Another option is to change the RefuelUnit method so that if a unit is already refueling, the new unit is added to the refueling queue.
Another option is to change the RefuelUnit method so that if a unit is already refueling, the new unit is added to the refueling queue.
Re: LUA - Groups Do Not RAS to Completion Consistently
Logged 0014946
Si Spiritus pro nobis, quis contra nos?
Re: LUA - Groups Do Not RAS to Completion Consistently
So this is certainly going to be my next step in terms of a work around. Interestingly all the units show as being part of the queue, so the problem doesn’t seem to me to lie there.blu3s wrote: Fri Mar 24, 2023 5:07 pm I imagine that you will not have to call the next unit to refuel until the unit that is refueling is finished.
Another option is to change the RefuelUnit method so that if a unit is already refueling, the new unit is added to the refueling queue.
Re: LUA - Groups Do Not RAS to Completion Consistently
Mmm it seems like a bug in the interaction btw lua and the game engine.Bashkire wrote: Fri Mar 24, 2023 6:17 pm
So this is certainly going to be my next step in terms of a work around. Interestingly all the units show as being part of the queue, so the problem doesn’t seem to me to lie there.
- michaelm75au
- Posts: 12457
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: LUA - Groups Do Not RAS to Completion Consistently
The Lua command is just adding the ship to the REPLEN list of the tanker/mission, so it is not a Lua related issue.
If there is something wrong with the request, the ScenEdit_RefuelUnit() returns a string so you can see why it failed. Which doesn't seem to be the case if you say it shows in the tanker's list.
It may have something to with the 'how it is getting added to the queue, so I can check that.
** I can't see the ship being refueled getting bounced when the next ship comes along side. Really need a save showing the issue
Though having a save would be useful.
If there is something wrong with the request, the ScenEdit_RefuelUnit() returns a string so you can see why it failed. Which doesn't seem to be the case if you say it shows in the tanker's list.
It may have something to with the 'how it is getting added to the queue, so I can check that.
** I can't see the ship being refueled getting bounced when the next ship comes along side. Really need a save showing the issue
Though having a save would be useful.
Michael
Re: LUA - Groups Do Not RAS to Completion Consistently
Apologies. I’m hoping to have a temporary repair done to my laptop by Tuesday, so I’ll try and get a save uploaded then if all goes to plan.michaelm75au wrote: Fri Mar 24, 2023 11:31 pm The Lua command is just adding the ship to the REPLEN list of the tanker/mission, so it is not a Lua related issue.
If there is something wrong with the request, the ScenEdit_RefuelUnit() returns a string so you can see why it failed. Which doesn't seem to be the case if you say it shows in the tanker's list.
It may have something to with the 'how it is getting added to the queue, so I can check that.
** I can't see the ship being refueled getting bounced when the next ship comes along side. Really need a save showing the issue
Though having a save would be useful.
Re: LUA - Groups Do Not RAS to Completion Consistently
Hi Michael and Bashkire.
I create a little test scen. The issue is that the refueling is done but not until the fuel tanks are fill. Idk if this has something to relate how IRL refueling is done but this could be the problem that Bashkire encounters. The refueling is done in a sec, idk if it could be like the AAR that takes some time.
Load scen and run in LUA:
I create a little test scen. The issue is that the refueling is done but not until the fuel tanks are fill. Idk if this has something to relate how IRL refueling is done but this could be the problem that Bashkire encounters. The refueling is done in a sec, idk if it could be like the AAR that takes some time.
Load scen and run in LUA:
Code: Select all
local str = ScenEdit_RefuelUnit ({side = "Royal Navy", unitname = 'D1', tanker = 'Tidespring'})
print("REFUELING 1st:"..str)
str = ScenEdit_RefuelUnit ({side = "Royal Navy", unitname = 'F1', tanker = 'Tidespring'})
print("REFUELING 2nd:"..str)
- michaelm75au
- Posts: 12457
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: LUA - Groups Do Not RAS to Completion Consistently
I see this partial fueling even if I use the UI so definitely not related to Lua.
When refueling happens it calculates the amount to transfer; you can see the numbers changing as it refuels if running at say 15secs.
When refueling happens it calculates the amount to transfer; you can see the numbers changing as it refuels if running at say 15secs.
Michael
Re: LUA - Groups Do Not RAS to Completion Consistently
Hi Michael, perhaps I thought I saw the refueling was faster than normal.
As for the tanks not filling up completely, is it a bug in the game engine? Or is there a reason for it? Maybe some devs can clarify it
although I don't know if they will run away when they see Lua in the title ;P
Thanks Michael
As for the tanks not filling up completely, is it a bug in the game engine? Or is there a reason for it? Maybe some devs can clarify it

Thanks Michael
- michaelm75au
- Posts: 12457
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: LUA - Groups Do Not RAS to Completion Consistently
It has something to do with how it is handling the fuel transfer. Something is triggering it to disconnect from the tanker, though watching the 'kg to transfer' countdown on the unit panel, it does seem to transfer what it calculated??
I will update the bug ticket with these observations.
I will update the bug ticket with these observations.
Michael
Re: LUA - Groups Do Not RAS to Completion Consistently
Hello Michael,
I think the problem is the ship that is refueled is not stopped. It continues to travel and a certain distance it disconnect from the refuel.
If you run the sim at 5x and zoom in the refuel zone, you could see as the ships are moving upwards while refueling and in a certain distance they "disconnect" from the refuel and then stops. This could be the issue.
I think the problem is the ship that is refueled is not stopped. It continues to travel and a certain distance it disconnect from the refuel.
If you run the sim at 5x and zoom in the refuel zone, you could see as the ships are moving upwards while refueling and in a certain distance they "disconnect" from the refuel and then stops. This could be the issue.
- michaelm75au
- Posts: 12457
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: LUA - Groups Do Not RAS to Completion Consistently
I have added that to the defect report. from memory the ship should be matching the tanker's speed and direction
Michael
- michaelm75au
- Posts: 12457
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: LUA - Groups Do Not RAS to Completion Consistently
Sorry to revive a somewhat old thread, but has this been fixed in a beta or official patch?
I'm now working on version 1.05 build 1307.18, but I'm still getting the same problem when I order my units to RAS.
EDIT: Just found some old patch notes. It seems that this was fixed in v1.05 Build 1307.13. Can someone else confirm that this is still a problem and it's not just me doing something stupid?
EDIT 2: Scenario file attached.
I'm now working on version 1.05 build 1307.18, but I'm still getting the same problem when I order my units to RAS.
EDIT: Just found some old patch notes. It seems that this was fixed in v1.05 Build 1307.13. Can someone else confirm that this is still a problem and it's not just me doing something stupid?
EDIT 2: Scenario file attached.
- michaelm75au
- Posts: 12457
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: LUA - Groups Do Not RAS to Completion Consistently
It isn't the original issue of the units not keeping station on the AO due to speed directly.
This time the group speed appears to be the cause.
The refueling units are trying to maintain group speed AND keep station on the AO by the feel of it; eventually the group speed pulls them away from the AO.
When I lower the group speed to cruise or creep, they settle down and keep station on the AO and then resume group station when full.
This time the group speed appears to be the cause.
The refueling units are trying to maintain group speed AND keep station on the AO by the feel of it; eventually the group speed pulls them away from the AO.
When I lower the group speed to cruise or creep, they settle down and keep station on the AO and then resume group station when full.
Michael
Re: LUA - Groups Do Not RAS to Completion Consistently
Thank you very much for sanity checking me, and thank you for coming up with the reason for this.
It looks like I'm going to have to reduce their operational speed during their transit to allow for RASing, or decrease their speed while the RAS is conducted.
It looks like I'm going to have to reduce their operational speed during their transit to allow for RASing, or decrease their speed while the RAS is conducted.