Skip to content

Adds five scifi/space cannons with various projectile-speeds and explosion-strengths.

Notifications You must be signed in to change notification settings

mt-mods/spacecannon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1a86d9a · Dec 29, 2024

History

47 Commits
Jan 10, 2021
Nov 16, 2018
May 31, 2023
Jun 7, 2023
Dec 29, 2024
Dec 29, 2024
Dec 27, 2024
Jun 7, 2023
Jun 7, 2023
Jul 29, 2019
Dec 27, 2024
Jan 10, 2021
Jan 10, 2021
Jan 10, 2021
Dec 29, 2024

Repository files navigation

Spacecannon mod

ContentDB

Overview

Adds five scifi/space cannons with various projectile-speeds and explosion-strengths. 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, 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

About

Adds five scifi/space cannons with various projectile-speeds and explosion-strengths.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages