Go to file
Dennis Jenkins cdb3b89b56
Merge pull request #23 from SwissalpS/is_ground_content
cannons aren't ground content
2024-02-27 13:58:50 -08:00
.github/workflows add luacheck workflow 2021-01-10 19:34:08 +01:00
sounds added sound on shoot 2018-11-16 08:43:37 +01:00
textures feat: add basic textures for railguns (#19) 2023-05-31 17:32:45 +02:00
.luacheckrc Adds pipeworks support for the railguns (#22) 2023-06-07 20:39:08 +10:00
ammo.lua Add railgun cannons (#16) 2023-05-30 05:44:29 +02:00
cannon.lua cannons aren't ground content 2024-02-27 22:53:21 +01:00
digiline.lua Make cannon 'fire' response optional, defaulting to off. 2021-03-08 18:17:02 +01:00
init.lua Adds pipeworks support for the railguns (#22) 2023-06-07 20:39:08 +10:00
mod.conf Adds pipeworks support for the railguns (#22) 2023-06-07 20:39:08 +10:00
node_resilience.lua node resilience wip 2019-07-29 13:37:56 +02:00
readme.md Update readme.md 2023-06-02 02:22:45 +02:00
screenshot_1.png update readme / mod.conf / screenshots 2021-01-10 19:55:15 +01:00
screenshot_2.png update readme / mod.conf / screenshots 2021-01-10 19:55:15 +01:00
screenshot_3.png update readme / mod.conf / screenshots 2021-01-10 19:55:15 +01:00
util.lua Adds pipeworks support for the railguns (#22) 2023-06-07 20:39:08 +10:00

Spacecannon mod

ContentDB

Overview

Adds five scifi/space cannons with various projectile-speed and explosion-strength. The cannons need HV-Power from a technic network and can be controlled via formspec/hand, mesecons or digilines. They also need to charge first, which can take a couple of seconds depending on cannon-type.

The projectile detonates on impact but only in non-protected areas!

Screenshots

Dependencies

Depends on:

  • technic

Supports:

  • mesecons
  • digilines

Mesecons

An "on" signal triggers a fire-action.

Digilines

Fire a cannon:

if event.type == "program" then
 digiline_send("cannon", { command="fire", verbose=false })
end

Example response from a "get" request:

{
        type = "digiline",
        channel = "c7",
        msg = {
                HV_EU_input = 0,
                HV_EU_demand = 0,
                dir = {
                        y = 0,
                        x = 0,
                        z = 1
                },
                powerstorage = 10000,
                ready = true,
                origin = "c7",
                name = "spacecannon:cannon_green",
                pos = {
                        y = 10,
                        x = -64,
                        z = -53
                }
        }
}

The "fire" request can specify an optional "verbose" flag. If this flag evaluates to true, then the following example response will be sent back. Note that if you have a large number of cannons that you will likely want to disable responses. N cannons firing and generating responses will cause N^2 messages to be processed, as each cannon receives the fire response from all of its peers. If N>20, your LUAC will overheat. N>900, and your server admin will want to have a chat with you.

{
        type = "digiline",
        channel = "c2",
        msg = {
                pos = {
                        y = 10,
                        x = -59,
                        z = -53
                },
                origin = "c2",
                success = true
        }
}

Api

Modify the ability to shoot depending on position or playername:

spacecannon.can_shoot = function(pos, playername)
	return true
end

Contributors

  • @BuckarooBanzay
  • @dennisjenkins75
  • @kiedtl

License

Code: MIT Textures: CC-BY-SA 3.0

Attributions