Page 1 of 1

Changing ROF for a loadout with Lua?

Posted: Fri Oct 15, 2021 10:43 am
by BeirutDude
My different attempts to override the Loadout's ROF of 1 second. I get the reload for the unit but it fires immediately, and nothing seems to be able to override it. Any thoughts????

ScenEdit_AddReloadsToUnit({unitname='666th SSM 1st Bn', guid='XMJRWB-0HMCFPKHBT058', wpn_dbid=569, number=4, TimeToReady_Minutes=30, ROF=21600})
ScenEdit_AddReloadsToUnit({unitname='666th SSM 2nd Bn', guid='XMJRWB-0HMCFPKHBT1UP', wpn_dbid=569, number=4, TimeToReady_Minutes=30, ROF=300})
ScenEdit_AddReloadsToUnit({unitname='666th SSM 3rd Bn', guid='XMJRWB-0HMCFPKHBT201', wpn_dbid=569, number=4, TimeToReady_Minutes=30, ROF=60})

RE: Changing ROF for a loadout with Lua?

Posted: Fri Oct 15, 2021 11:29 am
by BeirutDude
Just a different attempt with the same result...

ScenEdit_AddReloadsToUnit({unitname='666th SSM 1st Bn', guid='XMJRWB-0HMCFPKHBT058', wpn_dbid=569, number=4, TimeToReady_Minutes=5, ROF=300, new=y})
ScenEdit_AddReloadsToUnit({unitname='666th SSM 2nd Bn', guid='XMJRWB-0HMCFPKHBT1UP', wpn_dbid=569, number=4, TimeToReady_Minutes=10, ROF=600, new=y})
ScenEdit_AddReloadsToUnit({unitname='666th SSM 3rd Bn', guid='XMJRWB-0HMCFPKHBT201', wpn_dbid=569, number=4, TimeToReady_Minutes=15, ROF=900, new=y})

RE: Changing ROF for a loadout with Lua?

Posted: Fri Oct 15, 2021 1:10 pm
by Kushan04
TimeToReady only affects aircraft and ships/boats that are docked.

As far as I know, there is no way to directly override ROF. What are you trying to accomplish by changing the ROF?

RE: Changing ROF for a loadout with Lua?

Posted: Fri Oct 15, 2021 2:58 pm
by BeirutDude
So I can do what I want using an event with a random time trigger, but I was wanting to reload SSMs on a 4-6 hour time frame. Their current ROF is 1 second so they just fire one after another with reloads (or if placed on a magazine). My assumption is it should be a few hours to reload and prepare them on the TELs. So I can just use the Lua Script to reload them and use a random time event with a two hour window to make them available. That would give some randomness to the reloads anyway. I was just looking for a cleaner way to do it.

RE: Changing ROF for a loadout with Lua?

Posted: Fri Oct 15, 2021 3:20 pm
by Kushan04
Instead of changing the ROF you could try to set the launchers ROE to weapons hold for 6 hours.

RE: Changing ROF for a loadout with Lua?

Posted: Fri Oct 15, 2021 3:35 pm
by BeirutDude
That would work.

I'm actually thinking I'm going to go with a more random solution. Looking a PLAAF missile barrage on Okinawa, and think that might work better than if I were able to change the ROF.

RE: Changing ROF for a loadout with Lua?

Posted: Fri Oct 15, 2021 4:08 pm
by BDukes
Thanks guys. This helped me with something as well!

Mike

RE: Changing ROF for a loadout with Lua?

Posted: Fri Oct 15, 2021 7:52 pm
by KnightHawk75
and nothing seems to be able to override it. Any thoughts????
There is no way, other then editing the database.

RE: Changing ROF for a loadout with Lua?

Posted: Sat Oct 16, 2021 9:28 am
by BDukes
Hmm. Maybe deleting the mounts after each salvo and then adding them back when you want them to fire? ScenEdit_UpdateUnit..with add_mount and remove_mount modes might do the trick.

This would only work if the player isn't able to attack them (mounts are aimpoints in that kind of unit). If this is the case using the ScenEdit_UpdateUnit with add unit with 0 records so there is something to attack.

Just checked ScenEdit_AddReloadsToUnit and you can't do 0 number reloads either. That would have been quick.

Mike

RE: Changing ROF for a loadout with Lua?

Posted: Sat Oct 16, 2021 5:11 pm
by KnightHawk75
Hmm. Maybe deleting the mounts after each salvo and then adding them back when you want them to fire? ScenEdit_UpdateUnit..with add_mount and remove_mount modes might do the trick.

This would only work if the player isn't able to attack them (mounts are aimpoints in that kind of unit). If this is the case using the ScenEdit_UpdateUnit with add unit with 0 records so there is something to attack.
Just checked ScenEdit_AddReloadsToUnit and you can't do 0 number reloads either. That would have been quick.


One could just remove all the related weapon(s), mode=remove_weapon,from the mount, adding\removing it back on the schedule you want instead of removing the mount itself.
Also as for ScenEdit_AddReloadsToUnit, you could use the number=X remove=true params when you want subtract\remove things that way.