|
Gunner98 -> Lua assigning Non-unique names to mission (9/25/2016 1:31:52 PM)
|
Trying to make a random script where units pop up regularly and cause the player some minor issues. The script below works for the random generation but when I do the standard - ScenEdit_AssignUnitToMission, Lua does what it's supposed to and grabs the first unit with the name. Is there a way I can make it grab all units with that same name? Thanks B a = math.random(1,6) if a == 1 then ScenEdit_AddUnit({type='Ship', side='Cuba', name='Bandito', dbid='330', latitude='22.448075078579', longitude='-78.9575872674641'}) elseif a == 2 then ScenEdit_AddUnit({type='Ship', side='Cuba', name='Bandito', dbid='330', latitude='22.6824953509623', longitude='-79.5730956697378'}) elseif a == 3 then ScenEdit_AddUnit({type='Ship', side='Cuba', name='Bandito', dbid='330', latitude='23.0265691618325', longitude='-80.451326876993'}) elseif a == 4 then ScenEdit_AddUnit({type='Ship', side='Cuba', name='Bandito', dbid='330', latitude='23.1006901157562', longitude='-81.1965671192377'}) elseif a == 5 then ScenEdit_AddUnit({type='Ship', side='Cuba', name='Bandito', dbid='330', latitude='21.8084144174213', longitude='-77.3702693649615'}) elseif a == 6 then ScenEdit_AddUnit({type='Ship', side='Cuba', name='Bandito', dbid='330', latitude='24.1456777943727', longitude='-78.0061405217515'}) end ScenEdit_AssignUnitToMission('Bandito', 'East Strike')
|
|
|
|