Skip to content

Strange HL assert error on entity.get (probably an error on my part) #20

Answered by pkhead
pkhead asked this question in Q&A
Discussion options

You must be logged in to vote

These are my results from your test:

src/game/Game.hx:846: null, 32, 32
src/game/Game.hx:858: 1
src/game/Game.hx:859: TInt
src/game/Game.hx:860: 1
src/game/Game.hx:861: 1

The third trace is interesting... I added the Mass component to the entity by typing entity.add((1.0 : Mass)). If I instead type entity.add((1.1 : Mass)), the problem disappears and it prints TFloat instead of TInt, as it should. Also, I only have one entity kind that uses the Mass component. So it does look like it's caused by HashLink converting primitive types.

About the floating point inaccuracies thing, I can't really give a concrete example but when using Echoes.update, sometimes the game stutters even though the …

Replies: 6 comments 20 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@player-03
Comment options

Answer selected by pkhead
Comment options

You must be logged in to vote
5 replies
@pkhead
Comment options

@player-03
Comment options

@player-03
Comment options

@pkhead
Comment options

@player-03
Comment options

Comment options

You must be logged in to vote
6 replies
@player-03
Comment options

@pkhead
Comment options

@pkhead
Comment options

@player-03
Comment options

@pkhead
Comment options

Comment options

You must be logged in to vote
8 replies
@pkhead
Comment options

@player-03
Comment options

@player-03
Comment options

@pkhead
Comment options

@player-03
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants