makspll / makspll/bevy_mod_scripting

Make it easy to insert a `Name` component on an entity

Open
#429 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
649
Forks
59
PR merge metrics
No merged PRs in 30d

Description

I'd like to be able to do something like the following so I can add a Name component to my entity.

local entity = world.spawn()
world.add_default_component(entity, types.MyType)
world.insert_component(entity, types.Name, construct(types.Name, {
    name "My Entity"
}))
-- or
world.insert_name(entity, "My Entity")

I haven't been able to get anything to work using construct or Name::new("My Entity") so I'm not sure if it's currently possible to even do this?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the world.spawn, add_default_component, insert_component, and construct entry points shown in the issue, then check how the Name component is represented and exposed to Lua. Confirm whether an existing insertion path can support Name or whether a dedicated helper is needed. Done means the issue's example, or an equivalent supported API, successfully adds a Name component with the value "My Entity".

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, rust
Domain
game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.