mt-mods / spacecannon

2 stars 4 forks source link

Implemented digiline support for spacecannon #8

Closed dennisjenkins75 closed 3 years ago

dennisjenkins75 commented 3 years ago

This PR adds digiline support to the spacecannon mod. It was heavily copied from the "jumpdrive" mod.

I tested the changes on Minetest-5.3.0, Gentoo Linux, both with and without digilines (to ensure that the lack of digiline mod would not break spacecannon).

Here is a video demoing 7 cannons firing at 0.1s intervals via a Lua controller: https://youtu.be/b_PiJnP4-fo

Example response from a "get" request (maybe I should put this into the readme)

{
        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
                }
        }
}

Example response from a "fire" request:

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

Here is a video demoing 7 cannons firing at 0.1s intervals via a Lua controller: https://youtu.be/b_PiJnP4-fo

Nice, thanks! :+1: for using the technic_plus mod :wink:

Example response from a "get" request (maybe I should put this into the readme)

I'll look into that, maybe add it to the contentdb while i'm at it, haven't touched the code in a while :confounded: