I have this script for my North Atlantic scenario:
a = math.random(1,2)
if a == 1 then
ScenEdit_AddUnit({type='Sub', side='USSR', name='B-23', dbid='187', latitude='49.3812997111192', longitude='-36.8903957715054'})
elseif a == 2 then
ScenEdit_AddUnit({type='Sub', side='USSR', name='B-25', dbid='147', latitude='49.3812997111192', longitude='-36.8903957715054'})
end
a = math.random(1,3)
if a == 1 then
ScenEdit_AddUnit({type='Sub', side='USSR',name='B-10', dbid='278', latitude='50.52351341355', longitude='-37.177899984719'})
elseif a == 2 then
ScenEdit_AddUnit({type='Sub', side='USSR',name='B-15', dbid='278', latitude='50.52351341355', longitude='-37.177899984719'})
elseif a == 3 then
ScenEdit_AddUnit({type='Sub', side='USSR',name='K-115', dbid='391', latitude='50.52351341355', longitude='-37.177899984719'})
end
a = math.random(1,3)
if a == 1 then
ScenEdit_AddUnit({type='Sub', side='USSR', name='K-18', dbid='159', latitude='49.8531552461574', longitude='-36.2143146634912'})
end
a=math.random(1,2)
if a == 1 then
ScenEdit_AddUnit({type='Sub', side='USSR', name='K-16', dbid='363', latitude='50.1531552461574', longitude='-36.3143146634912'})
elseif a == 2 then
ScenEdit_AddUnit({type='Sub', side='USSR', name='K-5', dbid='363', latitude='50.1531552461574', longitude='-36.3143146634912'})
end
if a == 1 then
ScenEdit_AddUnit({type='Sub', side='USSR', name='B-7', dbid='287', latitude='50.051014008713', longitude='-41.5623833495527'})
end
When I run it with the console (after removing a fixed Scenedit_addunit that may have messed it up), it produces the random subs. When I try to run it with an event, it seems, even after I break it into multiple actions, it always produces the same result:
Julliet B-15
Foxtrot B-23
November appears (1/3rd chance in the script)
Hotel K-5.
No Whiskey B-7
I've posted a , but want to ask here as well.