Akaito/reassembly-ai-mod-example

Extra Port Flags

GeckGlobal asked for this feature 5 months ago — 3 comments

GeckGlobal commented 5 months ago

More port flags in general and maybe something like ARMOURIN and ARMOUROUT as a simple example! those two would be handy right off the bat as it would make it easier for you to implement HULL type armours underneath your actual ARMOUR layer, forcing modded armour types to be used as intended.

Currently there are two schools of thought on how this could be done so I will let you and the community decide if and how this should be done!


Some ideas tossed about in the general channel are slightly edited here to condense and are provided in the following list: Prototype: Maybe the ability to make custom coloured ports that can be named according to the hex colour the ports would only connect with the identical number/colour/name. It could be defined as it's own file, alongside shapes.lua and blocks.lua

Wowie: Or just adding a ports thing to shapes.lua and being able to define what it connects to and what it doesn't

Prototype: The way I am thinking about it, you would need to define each block that it can connect to, unless you mean defining the new port under the ports section of each shape wowie - Today at 3:29 PM it's essentially the same thing, but stored in shapes.lua instead of its own file. Like defining a custom shape, but instead of a shape it's a port? something like: {1, color=color, canConnect={`list of all port types it can connect to}}

Jewsus: well so far what i had in mind were: ARMOUR_IN ARMOR_OUT SUBMODULE_IN SUBMODULE_OUT MELEE_IN MELEE_OUT

Prototype: Those would work well, but the color defined ports would include those and more, they would just be defined by what you want them to be.

Jewsus: Yes but you need a port in and a port out. Which one gets to be the in port and which gets to be the out port if they are both just a colour value? do we go with HEXCODEIN and HEXCODEOUT?

Wowie: a pretty roundabout way to do things, why define it with colours when you could y'know define it with IDs like everything else?

Prototype: Ports defined by an ID that have a custom color and ruleset probably wont be too complicated

Jewsus: and here is my current example workaround for custom thrusters

{
    500,
    {
        {
            verts=
            {    
                {-2, 3.5}, {-2, 5}, {5, 5}, {5,-5}, {-2, -5}, {-2, -3.5}, {-5, -3.5}, {-5, 3.5}
            },
            ports=
            {
                {1, 0.285},
                {2, 0.5},
                {3, 0.715}
                {6, 0.5, WEAPON_OUT}, {6, 0.5, THRUSTER_OUT}
            }
        },
    }
},

{
    501,
    {
        {
            verts=
            {
                {2, 5}, {2, -5}, {-2, -5}, {-2, 5},
            },
            ports=
            {
                {0, 0.5, WEAPON_IN},
                {2, 0.5, WEAPON_OUT},{2, 0.5, THRUSTER_OUT}
            }
        },
    }
},

essentially shape 501 can only connect to shape 500 and totally eliminated the need for THRUSTER_IN. But you can connect weapons to your thrusters which can be odd.


If you are reading this line you are awesome!

tanghao290 commented 5 months ago

you can use "|" to combine the different port ,

for example , {6, 0.5, WEAPONOUT|WEAPONIN} can connect to both WEAPONOUT and WEAPONIN port , even itself

add port flag is OK , but current port avilable is already completely enough for mod with 2 tube system

| ConsiderTheFollowing commented about 2 months ago

This would be really useful

Join the discussion!

Sign-in with GitHub to comment