Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

LUA for Nuclear Escalation (RWA)

 
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 >> LUA for Nuclear Escalation (RWA) Page: [1]
Login
Message << Older Topic   Newer Topic >>
LUA for Nuclear Escalation (RWA) - 5/22/2017 4:18:19 PM   
Fer_Cabo

 

Posts: 111
Joined: 9/17/2015
Status: offline
Hi guys,

Could anyone give me an example about the LUA script (or any simpler & easier alternative in case it exists) for a Trigger that activates a "Nuclear Escalation" Event?

i.e. => Trigger: DPRK Side Uses a Nuclear Weapon (no matter if for EMP or airbust purposes)

(The resulting Action in the Event would be: ChangeSide RWA Grant Use of Nuclear Weapons = "Yes")

Thanks!
Post #: 1
RE: LUA for Nuclear Escalation (RWA) - 5/22/2017 4:24:42 PM   
mikmykWS

 

Posts: 11524
Joined: 3/22/2005
Status: offline
Hmm.. you might be able to do a destroyed weapon trigger on the nuke itself? Little tricky though.

Mike

_____________________________


(in reply to Fer_Cabo)
Post #: 2
RE: LUA for Nuclear Escalation (RWA) - 5/22/2017 4:34:32 PM   
Fer_Cabo

 

Posts: 111
Joined: 9/17/2015
Status: offline
A weapon-used-up is/counts as a weapon-destroyed?

I have no idea how to figure out this... And the point is...this is basics of escalation and WRA for Nuclear Weapons.

Another example of Trigger: The side which first uses a Nuclear Weapon (again, any kind of use), is penalised with -(minus)10.000 Points.

(in reply to mikmykWS)
Post #: 3
RE: LUA for Nuclear Escalation (RWA) - 5/22/2017 4:54:07 PM   
Owllord


Posts: 96
Joined: 7/15/2014
From: Tokyo, Japan
Status: offline
You could first have the DPRK fire nuclear weapons triggered by something of your choosing. Start with no nuclear weapons allowed, and then create a LUA action for that event, call it "Nuclear Strike Event":

ScenEdit_SetDoctrine({side="DPRK"}, {use_nuclear_weapons= "yes" })
ScenEdit_SetMission('DPRK', 'Nuclear Land Strike', {isactive=1})
ScenEdit_AssignUnitToMission({'Nuclear Unit','Nuclear Land Strike'})
ScenEdit_SetEvent('Nuclear Countdown',{isactive='active'})

You will of course have to create the mission if you want them to strike any specific targets with nukes.

Find out how long it roughly takes for the nuke to impact. Then, you can create another event called Nuclear Countdown for the opposing side which you should put on repeatable and inactive, authorizing them to use nukes once a timer has passed using a 'Regular Time' trigger corresponding roughly to the time it takes the nuke to impact as well as any reaction time from the decision to retaliate being taken to actually executing a retaliatory strike you deem to be appropriate. Next, set up a LUA condition for it:

local x = ScenEdit_GetDoctrine({side="DPRK"}).use_nuclear_weapons
local y = ScenEdit_GetEvent('Nuclear Strike Event')
if x.use_nuclear_weapons == 'yes' and y.isactive == false then
return true
else
return false
end

And the action would be:

ScenEdit_SetDoctrine({side="Other Side"}, {use_nuclear_weapons= "yes" })
ScenEdit_SetEvent('Nuclear Countdown',{isactive='false'})

As well as other actions for point loss for any side you want to penalize, and also you might want to assign nuclear missions to the second side if it is not player controlled, using AssignUnitToMission as above.

This is not a perfect solution, I am still learning LUA as well. But I think this should be a reasonably defensive setup to account for any changes in WRA and such that you might set up in the meantime through other events.


< Message edited by Owllord -- 5/22/2017 4:57:11 PM >

(in reply to Fer_Cabo)
Post #: 4
RE: LUA for Nuclear Escalation (RWA) - 5/23/2017 8:31:05 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
Yes, when the weapon 'dies', it is destroyed. So the event trigger will work.
However at the moment you can't be specific about the weapon type or class. Just thing how big that drop-down list would be if you included every weapon on a side.
Work is being done on making the existing event trigger/condition/actions maintainable by Lua. I just tried this out by creating a Lua trigger for a specific type of weapon, and then used it in the normal Editor event. It fired fine when the weapon impacted/died.

_____________________________

Michael

(in reply to Owllord)
Post #: 5
RE: LUA for Nuclear Escalation (RWA) - 5/23/2017 8:50:26 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
Thinking about it, you could use the existing 'destroyed' trigger, but you would need a condition or action on it to check that it is the weapon type you want, and if so, deactivate it.
--Condition
local answer = false
local unit = ScenEdit_UnitX()
if unit.type == 'Weapon' then
if unit.dbid = 'the nuke weapon' then
answer = true
end
end
return answer
---

_____________________________

Michael

(in reply to michaelm75au)
Post #: 6
RE: LUA for Nuclear Escalation (RWA) - 5/23/2017 4:23:01 PM   
Fer_Cabo

 

Posts: 111
Joined: 9/17/2015
Status: offline
Much appreciated guys!!

However, still many leaking pipes and flaws in the proposals put forward (no offense... on the contrary!!)

1) OK, so a "Destroyed (nuclear-type, checked by condition) Weapon Trigger"...

BUT: This would work regardless of WHERE, AGAINST WHAT, and HOW the weapon is destroyed (it can be shot down -nobody would ever know if it was a nuclear-tipped missile-, or detonate on another side territory/targets, or even malfunction...).

i.e. China does not have to necessarily escalate and go nuclear against all its hostiles at any given moment because DPRK went crazy and launched a nuclear attack on ROK or the US. China would go nuclear ONLY against and if DPRK (or any other Side for that sake) attacked CHINA or CHINESE FORCES with nuclear weapons.

2) OK, but what about "DOOMSDAY WEAPONS" whose only Launching would inmediately escalate the TARGET SIDE of those weapons??

i.e. Detection of ANY ICBM LAUNCH (which is a weapon type that has no other raison-d'être than nuclear attack) AIMED at US territory or Forces would make US go nuclear INMEDIATELY. I can't imagine Mr. Mad-Dog-Mattis awaiting the "Destroyed (nuclear-type, checked by condition) Weapon Trigger" to allow the smoldering remains of the US deterrence forces use of nuclear weapons...

(in reply to michaelm75au)
Post #: 7
RE: LUA for Nuclear Escalation (RWA) - 5/24/2017 1:08:07 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
Since starting on Lua Events, one trigger I have been trying to work out is 'Weapon Fired', but I don't want to take away too much processing power from game by checking every second on every unit to see if it released a weapon. There are other ways to check; just need to find the most expedient.
But as to the target of the launch, you really don't want that known until it is detected and tracked; detected okay, but tracked???

_____________________________

Michael

(in reply to Fer_Cabo)
Post #: 8
RE: LUA for Nuclear Escalation (RWA) - 5/24/2017 4:25:56 AM   
michaelm75au


Posts: 13500
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
You could use the 'enter area' trigger based on weapon to handle the 'fired at'

_____________________________

Michael

(in reply to michaelm75au)
Post #: 9
RE: LUA for Nuclear Escalation (RWA) - 5/24/2017 8:18:39 AM   
Fer_Cabo

 

Posts: 111
Joined: 9/17/2015
Status: offline
This pretty much reminds me of a previous consultation i made in the forum about the "Counter-Battery-Radars", which up until version 1.11 at least were only "sitting-duck" facilities with no real counter-battery-sensors able to pinpoint firing artillery or MRLS within their range.

The answer at that time (just a few months ago) was that CMANO was not yet adressing all the aspects of land-combat, and that i should try to script some LUA simulating the detection, which after testing some scripts i found really convoluted and messy (even messier when multiple units and radars were involved and overlapping).

This was a bit uncomprehensible and dissappointing, since counterbattery-fire is a basic tool, for instance, in Naval bombardment of inland targets, or Coastal-Gun-Battery fires. Even more so, if we're talking about modeling incidents such as the Yeonpyeong inter-Island artillery exchange between DPRK and ROK.

But the underlaying question was the same: Detection of a Firing Unit and TRACKING ability of the fired rounds/ordenance.

When it comes to Ballistic Missiles (either SRBM, SLBM, IRBM or ICBM), there is a real myriad of Satellites, Land Long-Range Radars and Alert Systems in the Strategic Commands of US, RUSSIA, CHINA and probably India, Pakistan, Israel, France, UK... In Short, every country relying on a deterrence-Nuclear-Force. The exclusive aim of all those systems is to DETECT and TRACK the launching and trajectories of such weapons, in order to provide as much reaction time as possible.

I just hope that there is a way CMANO can provide those Satellites, Radar FAcilities (which are already in CMANO's DB) with their real sensors functioning and collecting the info and data they're devised to collect and transmit to the CHAINS-OF-COMMAND ;-)

(in reply to michaelm75au)
Post #: 10
RE: LUA for Nuclear Escalation (RWA) - 5/24/2017 9:08:40 AM   
Dan109

 

Posts: 175
Joined: 4/27/2017
Status: offline
But how can you identify the difference between a nuclear tipped tomahawk vs. a conventional tipped? Even if you looked at the trajectories and analyzed them, how can you tell the difference between a DPRK nuke or a conventional warhead bearing down at Japan or Guam? Or a DPRK test launch? I'd think USA doctrine for a "limited strike" would be 'lets wait' in regards to the nuke authorization, while tracking it. But I'm sure DEFCON is immediately changed on every single DPRK test launch.

But yeah, if you detected dozens of long range ballistic missile trajectories coming from China or Russia, yeah if I were Prez, I'd say go ahead and authorize nukes, before they hit. Limited Strikes I believe were the most arguable scenarios to deal with....but if you want to assume any long range ballistic missile is a nuke, just check the all contact's alt and speed every 15s and see if it matches a BM.

(in reply to Fer_Cabo)
Post #: 11
RE: LUA for Nuclear Escalation (RWA) - 5/24/2017 10:03:28 AM   
Fer_Cabo

 

Posts: 111
Joined: 9/17/2015
Status: offline
Escalation (Authorize Use of Nuclear Weapons) is not going to be "triggered" (literally) because of a cruise missile attack => DEFCON will change... but not to DEFCON 1 or Nuclear Weapons release. That is because those weapons are "Dual-Use" (Conventional or Nuclear/WMD).

For those cases, escalation (Authorize Use of Nuclear Weapons) can't occur upon LAUNCH or TRACK, but only if there is a WMD detonation (or "Weapon Destruction").

But for NUCLEAR/WMD ONLY weapons, the ability to have a LAUNCH/TRACK trigger (even if only on a LUA-script basis) should exist. It's up to the Scenario developper or editor to go "Back to DEFCON 5"= Unauthorize again the use of Nuclear Weapons if, for instance, the NUCLEAR LAUNCH/TRACKED attack is beaten without a detonation finally occuring.

I.e. => China launches 30 ICBMs aimed against US targets, but all of them are shot down. At that moment, the scenario can include a "de-activating" trigger for the Use of Nuclear Weapons by US.

(in reply to Dan109)
Post #: 12
RE: LUA for Nuclear Escalation (RWA) - 5/24/2017 6:18:08 PM   
Dan109

 

Posts: 175
Joined: 4/27/2017
Status: offline
Well, determining the actual trajectory would be pretty difficult I think, given you only have access to altitude, speed, and heading. Need to determine the missile's arc to determine if it's headed for the US, or Mexico. Then of course it still depends on how many. If China had 1000 nukes and launched only 30, does that deserve a full or proportional response.

I see what you are asking for, there are just a lot of conditions to go through. I'm sure everyone would love for a LUA script to be written to account for this scenario, but there are numerous variables that would need to be set to adjust to everyone's taste.

(in reply to Fer_Cabo)
Post #: 13
RE: LUA for Nuclear Escalation (RWA) - 5/24/2017 6:41:24 PM   
Fer_Cabo

 

Posts: 111
Joined: 9/17/2015
Status: offline
OK Dan, let's start with something "easy" to script (i don't know how to to this, too complicate a LUA for me):

If [SIDE A "WMD Weapon-Type {table}" launched]=TRIGGER against a ["SIDE B Target Unit" located inside a certain "Country-Area"]=CONDITION1 & [120 Seconds have passed since launch]=CONDITION2=Trajectory Asessment Time, then [change SIDE B Nuclear-Weapons-Use-Doctrine to "Yes"]=ACTION.

True, this would allow a MASSIVE nuclear retaliation by all the availabe attacked-side (SIDE B) nuclear assets. OK, we can then go down to specific units' doctrine or counting the number of "WMD Weapon Type" launched... But can anyone /is it possible given the available LUA commands to script the above drafted Event ?¿

(in reply to Dan109)
Post #: 14
RE: LUA for Nuclear Escalation (RWA) - 5/24/2017 8:14:29 PM   
Dan109

 

Posts: 175
Joined: 4/27/2017
Status: offline
Well the math is going to be the hardest part. Taking info that only Side B knows, to calculate the trajectory and determine a possible area of impact...sure its possible, but I'd have to research the hell out of it first. No trigger exists today for weapon being launched, but that's cheating - the realistic trigger should be Side B's contact detection. And trajectory can only begin to be tracked when you have altitude/course/speed - but to get that, you might have to check every 1s after the initial contact as I "think" you can only trust the contact's altitude/course/speed when the contact.areaofuncertainty = NIL.

Now, if you wanted to "cheat" and use a Side A's weapon launch trigger(not avail today, but as Michael said, maybe it will get developed), I don't believe there is a field for a unit to keep track of its target (internal there probably is, for example SARH missiles tracking an aircraft), so there is no easy cheat way to do it via LUA. Sure, you know the missile's course (which really shouldn't change ever, but I think I remember reading about Russia's Satan II ICBM which can adjust course, a very cutting edge advancement).

Like I said, the only way I would know that its is possible to do it is to calculate trajectory every 1s and attempt to predict where it is going, however we STILL need to assume a few things a) CMANO's physics are perfect, which I am not doubting though b) that an ICBM has a perfectly elliptical flight profile - it may very well be like many other missiles, and shoot up very high, flatten out, cruise, and then go down in its terminal phase. If that is the case, which I actually think it is, then you can only calculate trajectory in the terminal phase.

(in reply to Fer_Cabo)
Post #: 15
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> LUA for Nuclear Escalation (RWA) 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

5.188