Skip to content

E2: Add entity:linkComponent(entity) function #1900

@CaptainPRICE

Description

@CaptainPRICE

A function similar to what Starfall and Expression Advanced have.
To allow linking wire components (keyboard, cam/pod controller, eyepod, etc.) to the vehicle/prop (appropriately, to whatever entity a link demands to be linked to in order to make a successful link), make certain wiring stuff a whole lot easier.

A full usecase E2 sample, (by default) allowing only owner to type into the keyboard via seat:
https://gist.github.com/CaptainPRICE/0f0d445e437c1499f6a2ae2c8e95c1dd

Removing a link should be possible by passing noentity() as an argument (to avoid creating extra E2 function). Due to how linking works with some components, there will have to be a separate function for unlinking :/
Additionally, there should also be a function which could be used to return an array of entities to which a component is currently being linked to: array=entity:linkedTo().
These new functions should be a part of the wiring E2 core (which is disabled by default).

Metadata

Metadata

Assignees

No one assigned

    Labels

    E2This issue is related to E2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions