[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4760: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4763: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3887)
Baloogan Campaign Forum • View topic - Lua event problems

Lua event problems

Moderators: Dandin384, Kushan, ckfinite

Lua event problems

Postby Coiler12 » Tue Dec 30, 2014 1:08 pm

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.
Coiler12
 
Posts: 45
Joined: Thu Oct 02, 2014 11:11 pm

Return to Command Lua




Users browsing this forum: No registered users and 3 guests

cron