Giter Club home page Giter Club logo

bevy_scriptum's Introduction

And Alexander wept, seeing as he had no more code to write.

bevy_scriptum's People

Contributors

jarkonik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bevy_scriptum's Issues

Commands not working when using a function with a In<> param!

Thanks again for fixing #4 so fast. Sadly I found out it did not fix my particular bug!

Describe the bug
A function just like you showed in the new example works perfectly fine:

fn spawn_entity(mut commands: Commands) {
    commands.spawn(Name::new("CONTROL ENTITY"));
}

In my particular case I want a function that takes in an argument:

fn spawn_entity(In((mod_names,)): In<(ImmutableString,)>,mut commands: Commands) {
    println!("Spawning entity: {:?}", mod_names);
    commands.spawn(Name::new("CONTROL ENTITY"));
}

And as soon as I add this In<> param it doesnt work anymore! (Same bug as described in #4)

To Reproduce
Steps to reproduce the behavior:

  1. Repeat steps for #4
  2. Add a In<> param to the function
  3. It shouldn't work anymore

Expected behavior
For it to spawn the entity with all components.

Screenshots
(see screenshot in #4)

Commands spawning Entity doesnt seem to work.

Hi I really like this plugin! It allowed me to very quickly add basic scripting support to my project, appreciate all the hard work!

Describe the bug
I encountered a bug where I tried to spawn an entity via script. for this i simply created a function, something like this:

fn spawn_modded_entity(
    mut commands: Commands,
) {
    commands.spawn(Name::new("ModdedEntity"));
}

And if I then call this via script, it indeed spawns an entity, but it has no components (in this case it should have a Name component, See screenshots below).
commands.entity(entity).insert() also doesnt seem work.

I'm not sure if this is a bevy or scriptum problem, but i tried to also call the same function as a normal bevy system and there it works fine.

To Reproduce
Steps to reproduce the behavior:

  1. Spawn an entity with a script, this script should call a rust function in which you spawn a very simple entity with at least one component.
  2. start the game
  3. check if entity has the specified components

Expected behavior
It to spawn an entity with all the specified components.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Desktop (please complete the following information):

  • OS: [Windows]

Additional context
I was able to work around this by making the functon send out a bevy event which then runs a system in which the entity gets spawned. but i would like to be able to instantly return the id of the entity to keep using it via scripts, and with this workaround i won't be able to do so.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.