https://linen.dev logo
Join Discord
Powered by
# 🦴bones
  • z

    Zicklag

    05/15/2023, 12:39 AM
    Entity
    doesn't implement
    PartialEq
    ?
  • z

    Zicklag

    05/15/2023, 12:40 AM
    Yeah, that should be implemented.
  • z

    Zicklag

    05/15/2023, 12:40 AM
    I must just not have needed it yet, but I really would have thought that'd have been derived already.
  • t

    TeaSkittles

    05/15/2023, 12:44 AM
    Please let me know when that's been updated. I only really get time to write code for my personal projects on the weekend (and it's almost up) so you'll be able to get to it faster than I can.
  • t

    TeaSkittles

    05/15/2023, 12:44 AM
    I assume the
    Cargo.toml
    file in jumpy will need to be updated too, to pull down the newest version of
    bones_lib
    .
  • z

    Zicklag

    05/15/2023, 12:45 AM
    We're using a git dep on bones so once I push it you'll just have o run
    cargo update
    to update the lock file.
  • z

    Zicklag

    05/15/2023, 12:46 AM
    Just looked at it and
    Entity
    already implements
    Eq
    and
    PartialEq
    .
  • t

    TeaSkittles

    05/15/2023, 12:51 AM
    Interesting. I'll dig deeper into this and see what the disconnect is. Sorry about that.
  • z

    Zicklag

    05/15/2023, 12:51 AM
    No problem!
  • t

    TeaSkittles

    05/15/2023, 2:39 AM
    Oh, it's yelling at me that references to
    Entity
    do not implement
    PartialEq
    compared to non-references. The
    Entity
    copy is cheap, so that'll just be my solution.
  • z

    Zicklag

    05/15/2023, 2:39 AM
    Ah, yeah. You can also just take a reference of the other entity so you're comparing a
    &Entity
    to a
    &Entity
    .
  • z

    Zicklag

    05/15/2023, 2:39 AM
    I'm not actually sure what's more efficient.
  • z

    Zicklag

    05/15/2023, 2:40 AM
    both the reference and the
    Entity
    are 64 bits on a 64 bit system. :man_shrugging:
  • t

    TeaSkittles

    05/15/2023, 2:41 AM
    My instinct says that comparing the references is slower (since both would need to be dereferenced instead of just one), but it's probably super trivial with types this light that implement
    Copy
    .
  • z

    Zicklag

    05/15/2023, 2:41 AM
    Yeah, I think you're right. Copying is probably more efficient. I bet the compiler already picks whatever is better anyway, regardless of what you do in this case.
  • t

    TeaSkittles

    05/15/2023, 2:46 AM
    The compiler is awesome, so probably.
  • t

    TeaSkittles

    05/15/2023, 3:10 AM
    Can a component have a generic? Can I have
    Spawner<T>
    so that I can have
    Spawner<PlayerSpawner>
    ?
  • z

    Zicklag

    05/15/2023, 3:10 AM
    Yeah, I'm pretty sure that works fine.
  • t

    TeaSkittles

    05/15/2023, 3:10 AM
    What a relief. Thanks, I'll try it out then.
  • z

    Zicklag

    05/15/2023, 3:10 AM
    Wait, maybe not...
  • t

    TeaSkittles

    05/15/2023, 3:10 AM
    Boo!
  • z

    Zicklag

    05/15/2023, 3:10 AM
    Maybe it can, but you have to manualy implement
    TypeUlid
    .
  • z

    Zicklag

    05/15/2023, 3:11 AM
    Because it has to have a different ULID for every
    Spawner<Whatver>
    combination.
  • z

    Zicklag

    05/15/2023, 3:11 AM
    Yeah, I think that'd work.
  • z

    Zicklag

    05/15/2023, 3:12 AM
    So you couldn't derive
    TypeUlid
    , but you coudl still
    impl TypeUlid for Spawner<PlayerSpawner> { /*  impl */ }
    .
  • t

    TeaSkittles

    05/15/2023, 3:13 AM
    Interesting, okay. I'll go that route then. I want to continue to make the
    Spawner
    very flexible, so I'm giving it a boolean if "the children of this spawner are shared with all other spawners of this type". That way I can know to check if this
    Spawner
    is the last one.
  • t

    TeaSkittles

    05/15/2023, 3:16 AM
    I'm going to move this non-bones related topic to jumpy
  • t

    TeaSkittles

    05/21/2023, 12:23 AM
    It looks like the
    AudioEvents
    resource, when a resource does not exist, the error message in
    world.rs
    does not contain the actual audio handle information such that it can be easily understood which audio file is missing. Code in world.rs: pub fn resource(&self) -> AtomicResource { match self.resources.try_get::() { Some(r) => r, None => panic!( "Requested resource {} does not exist in the
    World
    . Did you forget to add it using
    world.insert_resource
    /
    world.init_resource
    ?", std::any::type_name::() ), } } Error: thread 'main' panicked at 'Requested resource bones_render::audio::AudioEvents does not exist in the
    World
    . Did you forget to add it using
    world.insert_resource
    /
    world.init_resource
    ?', /home/austin/.cargo/git/checkouts/bones-b608aa0d074178a4/5e8436e/crates/bones_ecs/src/world.rs:126:21
  • z

    Zicklag

    05/21/2023, 12:24 AM
    I don't think that actually means the audio file is missing.
  • z

    Zicklag

    05/21/2023, 12:25 AM
    I think it means that the audio plugin hasn't been installed, though I'm not sure why.
1...1112131415Latest