Ballistic Missile


A new missile silo for tactical strikes against the biters. The missile payload bay can be filled with ammo and capsules of your choice, so you can decide if you want a single nuclear warhead, a cluster napalm shell or something completely different.

Content
8 hours ago
1.1 - 2.0
30.3K
Combat Circuit network

i Bugfix for achievment triggers

10 months ago
(updated 10 months ago)

You can avoid triggering rocket launch achievments with the following code. This code does not include "lazy-bastard" and "raining-bullets". If you want to prevent the last two, you need to manually track their states using on_player_crafted_item and on_built listeners.

-- data-updates.lua
local co_achievments = data.raw["complete-objective-achievement"]
for i, achievment in pairs(co_achievments) do
if achievment.objective_condition == "rocket-launched" then
achievment.type = "achievement"
data.raw["achievement"][achievment.name] = util.table.deepcopy(achievment)
co_achievments[achievment.name] = nil
log("Set " .. achievment.name .. " to only trigger manually.")
end
end

-- control.lua
local function trigger_launch_achievments(force)
local f_players = {}
for i, player in pairs(game.players) do
if player.force == force then
table.insert(f_players, player)
player.unlock_achievement("smoke-me-a-kipper-i-will-be-back-for-breakfast")
end
end
if game.tick <= 3240000 then
for i, player in ipairs(f_players) do
player.unlock_achievement("no-time-for-chitchat")
end
end
if game.tick <= 1728000 then
for i, player in ipairs(f_players) do
player.unlock_achievement("there-is-no-spoon")
end
end
end

-- EVENT: ROCKET LAUNCHED
script.on_event(defines.events.on_rocket_launched, function(event)
local rocket = event.rocket
if rocket.name ~= "ballistic-missile" then
trigger_launch_achievments(rocket.force)
end
...

10 months ago

That's great, thanks! Didn't think of disabling them and granting them manually.
New version with your fix is online.

10 months ago

It would seem this fix may have broke the game for me...

10 months ago

He added it as a local function, while adding it to the end of the script. Either "local" has to be removed or the function needs to be declared before the listener.

10 months ago

Fixed :)

This thread has been locked.