You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm new to C and flecs. I would like to create a sync point between two systems using a relationship tag. I succeeded with the C binding for query building but I failed with the DSL.
Here is a restricted example : the first system create a new pair (DockedTo, earth) and the second system query (DockedTo, *). The goal is to have a sync point so the both systems must write a message in sdtout in the same round.
$ cc main.c flecs.c -o spaceship
$ ./spaceship
spaceship dock to 533
spaceship repaired to 6/16
This works well. But I'd like to do the same with the DSL to save a few lines in the source code. I replaced the ecs_system call by ECS_SYSTEM(ecs, Docking, EcsOnUpdate, [in] (DockTo, *), [out] (DockedTo, *)); but I get an error :
error: Docking: expected end of expression or next term
[in] (DockTo, *), [out] (DockedTo, *)()
^
fatal: flect_test.c: 44: assert: ecs_id(Docking) != 0 INVALID_PARAMETER
./spaceship(+0x3b86b) [0x5579fe2ff86b]
./spaceship(+0x62602) [0x5579fe326602]
./spaceship(+0x13377) [0x5579fe2d7377]
./spaceship(+0xaf33) [0x5579fe2cef33]
./spaceship(+0x2b14) [0x5579fe2c6b14]
/usr/lib/libc.so.6(+0x27cd0) [0x7ff7c48d7cd0]
/usr/lib/libc.so.6(__libc_start_main+0x8a) [0x7ff7c48d7d8a]
./spaceship(+0x2505) [0x5579fe2c6505]
Abandon (core dumped)
The reason for this is that (Foo, Bar) is short for Foo($this, Bar), where $this is a builtin variable that represents the entity on which components got matched. Replacing that with 0 is equivalent to what happens in the C API.
Hello, I'm new to C and flecs. I would like to create a sync point between two systems using a relationship tag. I succeeded with the C binding for query building but I failed with the DSL.
Here is a restricted example : the first system create a new pair
(DockedTo, earth)
and the second system query(DockedTo, *)
. The goal is to have a sync point so the both systems must write a message in sdtout in the same round.This works well. But I'd like to do the same with the DSL to save a few lines in the source code. I replaced the
ecs_system
call byECS_SYSTEM(ecs, Docking, EcsOnUpdate, [in] (DockTo, *), [out] (DockedTo, *));
but I get an error :I conclude this syntax do not exist. But just I mixed a syntax from the documentation with relationships so I do not understand why.
https://www.flecs.dev/flecs/md_docs_Systems.html#autotoc_md290
Is there a DSL syntax to do this ?
The text was updated successfully, but these errors were encountered: