Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Reset primary attack weapon

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Reset primary attack weapon Page: [1]
Login
Message << Older Topic   Newer Topic >>
Reset primary attack weapon - 3/4/2019 10:10:22 AM   
DMAN

 

Posts: 98
Joined: 1/11/2019
Status: offline
Hi all,

Is there a way to reset a platform's primary attack weapon?
I've added a mount to a submarine and want it to withdraw once the rounds are expended from that mount (specifically).

Also, no matter which weapon record I add to the magazine, the mount does not reload.
Is there a way to achieve this? (Avoiding LUA, preferably; if not, I'll have a look at it).

These units will be AI-controlled so I'd like to get it to work.

I've attached a save. See if you can have the Golfs reload their Strobile VLS.
Every P-800 Onyx magazine weapon record is there (I don't want to use Yakhont because it cannot strike land targets).

Cheers!

Attachment (1)

< Message edited by DMAN -- 3/4/2019 10:31:23 AM >
Post #: 1
RE: Reset primary attack weapon - 3/5/2019 5:41:36 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
I can see the issue. The SS-N-26 isn't the default weapon on the mount, and the weapon has a 'default' load of 0. Which means it wont reload.

_____________________________

Michael

(in reply to DMAN)
Post #: 2
RE: Reset primary attack weapon - 3/5/2019 5:43:03 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
Worked around.
1. Remove all weapon records from the mount.
2. Add the SS-N-26 8/8 ROF 2 (with a value it is probably setting the default load value.)
3. Set current number to 0
4. Sub RTB due to lack of weapons.

Sub replenishes from port magazines and deploys.

Set the current count back to '0', and it withdraws again.

You can also use Lua to set the default load value for the SS-N-26 on the mount.

< Message edited by michaelm75au -- 3/5/2019 5:50:43 AM >


_____________________________

Michael

(in reply to michaelm75au)
Post #: 3
RE: Reset primary attack weapon - 3/5/2019 5:53:50 AM   
DMAN

 

Posts: 98
Joined: 1/11/2019
Status: offline

quote:

ORIGINAL: michaelm75au

Worked around.
1. Remove all weapon records from the mount.
2. Add the SS-N-26 8/8 ROF 2 (with a value it is probably setting the default load value.)
3. Set current number to 0
4. Sub RTB due to lack of weapons.

Sub replenishes from port magazines and deploys.

Set the current count back to '0', and it withdraws again.

You can also use Lua to set the default load value for the SS-N-26 on the mount.


Thanks, Michael.

After doing this workaround, can I then copy the unit and integrate it in my scenario for the AI?

(in reply to michaelm75au)
Post #: 4
RE: Reset primary attack weapon - 3/5/2019 6:05:37 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
If you do the work around when you create the unit (ie add the mount, remove all weapons, and then add back the SS-N-26 as above), it should be be okay. It just needs the 'default' load set for the first time. I doubt it will change unless you try adding more weapons. Not sure what initially sets the 'default' but I assume it sets the default load when the mount is retrieved from database.

_____________________________

Michael

(in reply to DMAN)
Post #: 5
RE: Reset primary attack weapon - 3/5/2019 6:34:11 AM   
DMAN

 

Posts: 98
Joined: 1/11/2019
Status: offline
Hi Michael,

It seems the clones units don't RTB as desired. So the workaround for that is to mod each one as they are cloned using the method you developed.

It's ok. I have only 14 Golf II SSBs to do :)

Thanks for your help yet again!

(in reply to michaelm75au)
Post #: 6
RE: Reset primary attack weapon - 3/5/2019 6:42:31 AM   
DMAN

 

Posts: 98
Joined: 1/11/2019
Status: offline
If you'll run that test at 30 mins, you'll observe some odd behaviour exhibited by the units.

For instance, instead of approaching the west coast of Japan and then firing their missiles, the subs go around to the east coast to fire!

I also had one sub dead in the water with full diesel but no battery, which then recharged after I manually surfaced it.
(this just happened again to 2 more subs: bug maybe?)

Subs redeploying from the base are going to the north rather than out to sea.
(the unit eventually did deploy)

And now, you'll see the course of the submarine to the south. Do you know why it is doing that?

Attachment (1)

< Message edited by DMAN -- 3/5/2019 6:49:41 AM >

(in reply to DMAN)
Post #: 7
RE: Reset primary attack weapon - 3/5/2019 8:06:21 AM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
For your monitoring a particular mount on a unit for a weapon count and wanting it to 'do something' when it hits zero..
See the embedded script in this version of your sample for ideas on how to do that.
At present it just checks every 1 minute and refills it when it and stop it from firing on land...when it sees it go under 7. but you can change that easy and of course whatever it is you really want in the GoDoSomeThingWithTheResults() function.

BTW on your other simple issue all I did was add munition mag to unit and some ss-n-26's to and it reloaded fine, though I see you were trying to get it do that from the dock vs. itself, wasn't clear in the first post.


"It's ok. I have only 14 Golf II SSBs to do :)"
---
Set one up the way you want first. shift-c 13 times after that should be fine.

Attachment (1)

< Message edited by KnightHawk75 -- 3/5/2019 8:14:10 AM >

(in reply to DMAN)
Post #: 8
RE: Reset primary attack weapon - 3/5/2019 9:32:46 AM   
DMAN

 

Posts: 98
Joined: 1/11/2019
Status: offline

quote:

ORIGINAL: KnightHawk75

For your monitoring a particular mount on a unit for a weapon count and wanting it to 'do something' when it hits zero..
See the embedded script in this version of your sample for ideas on how to do that.
At present it just checks every 1 minute and refills it when it and stop it from firing on land...when it sees it go under 7. but you can change that easy and of course whatever it is you really want in the GoDoSomeThingWithTheResults() function.

BTW on your other simple issue all I did was add munition mag to unit and some ss-n-26's to and it reloaded fine, though I see you were trying to get it do that from the dock vs. itself, wasn't clear in the first post.



Hi Knighthawk,

Thanks for the advice!
It is working now.
I followed the previous advice, ran some tests, and it does what I want it to do.
I also added the submarines directly to the base so if there are no more land targets, they RTB and only deploy when new land contacts are detected within their strike range.

Did you write the LUA script specifically for this?
Thank-you! But I tell you what, that's WAY over my head. I'm flatout getting overlays to load!

Also, if it works when the scenario is built, great; if not, then it's ok. There will be plenty of other events for the human player to concern themselves with

quote:



"It's ok. I have only 14 Golf II SSBs to do :)"
---
Set one up the way you want first. shift-c 13 times after that should be fine.



Yes, I tried that. My efforts resulted in the clone firing it's missiles then sitting there.

(in reply to KnightHawk75)
Post #: 9
RE: Reset primary attack weapon - 3/5/2019 9:46:48 AM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
The oddity your seeing with RTB (I was able to repo) is that copies for whatever reason don't seem to get their primary weapon updated to include the p-800, seems the editor and scripting trigger that but a copy\clone maybe does not for some reason? I noticed messages on the manual ones about weapon exhaustion but on the clones in same mission and base etc no such message when empty.

Definitely something to remember in future for my own stuff.


< Message edited by KnightHawk75 -- 3/5/2019 9:47:54 AM >

(in reply to DMAN)
Post #: 10
RE: Reset primary attack weapon - 3/5/2019 10:12:19 AM   
DMAN

 

Posts: 98
Joined: 1/11/2019
Status: offline

quote:

ORIGINAL: KnightHawk75

The oddity your seeing with RTB (I was able to repo) is that copies for whatever reason don't seem to get their primary weapon updated to include the p-800, seems the editor and scripting trigger that but a copy\clone maybe does not for some reason? I noticed messages on the manual ones about weapon exhaustion but on the clones in same mission and base etc no such message when empty.

Definitely something to remember in future for my own stuff.



Hopefully it's just this time, for me. I have performed hundreds of mods on the platforms in my scenario.

I can't go back now.

Perhaps a better way to do the Withdraw/Deploy settings would be to have each weapon on the platform, or all, or none, able to be set, rather than 'Primary Attack' and 'Primary Defence' only?
There are so many other more-detailed options, I don't see this as an impossible change.

(in reply to KnightHawk75)
Post #: 11
RE: Reset primary attack weapon - 3/5/2019 10:18:06 AM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
Hey michael if you still reading... looks like scripting doesn't trigger the primary weapon thing either in testing right now.

I run the following (txt file) which creates the units, adds the mount in question, removes all 3 weapons and then adds back the one desired. No weapon-state RTB exhaustion triggered like in an 'editor' manually touched unit using same data. Is there something that I could do in script that would trigger that getting updated?





Attachment (1)

(in reply to KnightHawk75)
Post #: 12
RE: Reset primary attack weapon - 3/5/2019 10:25:06 AM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline

quote:

ORIGINAL: DMAN

Hopefully it's just this time, for me. I have performed hundreds of mods on the platforms in my scenario.

I can't go back now.

Perhaps a better way to do the Withdraw/Deploy settings would be to have each weapon on the platform, or all, or none, able to be set, rather than 'Primary Attack' and 'Primary Defence' only?
There are so many other more-detailed options, I don't see this as an impossible change.


Yeah it would be nice to define\set\query what are considered primary.

I'm gonna try the delta file route as well, see if that acts like the gui-editor or not, at least we'll know.;)

(in reply to DMAN)
Post #: 13
RE: Reset primary attack weapon - 3/5/2019 10:45:17 AM   
DMAN

 

Posts: 98
Joined: 1/11/2019
Status: offline

quote:

ORIGINAL: KnightHawk75

Yeah it would be nice to define\set\query what are considered primary.

I'm gonna try the delta file route as well, see if that acts like the gui-editor or not, at least we'll know.;)



I have used the delta template to make sensor and communications changes for my scenario, and I'll be using it for magazines, but that's the limit of my knowledge

(in reply to KnightHawk75)
Post #: 14
RE: Reset primary attack weapon - 3/5/2019 10:48:43 AM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
Update: Never mind it does work with scripting. I failed to notice you removed the nuke mount (noticed it in the delta) :--)) Big impact that on primary weapon selection I'm sure lol.

I updated script to take off the nukes and now they act just like the gui touched version rtbing after done firing automatically, was worried there for a minute (I do lots of mass setup via scripts).

Anyway if do ever need to recreate your 14, you can plop this in the console just change the '3' to '14' and it'll do it all for you (including the torpedo update in the mag).



Attachment (1)

< Message edited by KnightHawk75 -- 3/5/2019 11:00:19 AM >

(in reply to KnightHawk75)
Post #: 15
RE: Reset primary attack weapon - 3/5/2019 10:53:58 AM   
DMAN

 

Posts: 98
Joined: 1/11/2019
Status: offline
Thanks, Knighthawk!

I don't know how you understand it, though.

(in reply to KnightHawk75)
Post #: 16
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Reset primary attack weapon Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.018