BeirutDude
Posts: 2625
Joined: 4/27/2013 From: Jacksonville, FL, USA Status: offline
|
I found this code in the Silent Service DLC and there is a part I don't understand... quote:
x = ScenEdit_GetUnit({guid='c0e0b7a4-2ec7-4c75-add0-c53dead2fad8'}) if x.altitude < -21 then ScenEdit_MsgBox('Satellite connection lost.', 6) assets = { {name='Kosmos 2221',guid='7861ff62-d7fd-405d-b768-8e9271bc414f'}, {name='Kosmos 2227',guid='0e7f4bc3-3185-4c6c-9403-de8aae1f43a6'}, {name='Kosmos 2237',guid='18cc2131-a9db-4a2c-a6ae-3e1637c66d3f'}, {name='Kosmos 2263',guid='1bdaacb3-94b9-45b0-9548-071973fb6689'}, {name='Kosmos 2263',guid='1bdaacb3-94b9-45b0-9548-071973fb6689'}, {name='Kosmos 2278',guid='f4c61907-6802-4fa3-83df-7433def6d8d8'}, {name='Kosmos 2297',guid='585ed1d5-920d-42be-b57c-2a83d5260bb5'}, {name='Kosmos 2333',guid='bdcf7c78-eb2b-4e84-ba7d-7f57129f1756'}, {name='Kosmos 2335',guid='b6b7296d-1684-47fc-9ac6-8c6c86f8d0bd'}, {name='Kosmos 2347',guid='0e012194-01b5-46fe-8b78-4abaf814b5fe'}, {name='Kosmos 2359',guid='98ba4ce3-6686-46ec-b21b-5081dfb9ac16'}, {name='Kosmos 2360',guid='9e968956-a328-491e-90c2-8052cdf25161'}, {name='FV Castro el Gato',guid='5d4c309d-0894-4bd8-b0e8-2f54c0d02c95'}, {name='FV Viktor Kot', guid='fcee49f9-5df5-451f-a721-9d763083e876'}, } for i = 1,#assets do unit = ScenEdit_GetUnit({guid=assets.guid}) if unit ~= nil then ScenEdit_SetUnit({side='Russia',guid=assets.guid,OutOfComms=true}) end end ScenEdit_SetEvent('SatelliteCheck', {isactive=false}) end I'm not familiar with a "for" statement what is this doing? "for i = 1,#assets do" And this as well? " unit = ScenEdit_GetUnit({guid=assets.guid})"
_____________________________
"Some people spend an entire lifetime wondering if they made a difference. The Marines don't have that problem." PRESIDENT RONALD REAGAN, 1985 I was Navy, but Assigned TAD to the 24th MAU Hq in Beirut. By far the finest period of my service!
|