Despite the fact that the entity database got reworked, some codes for entities are from early versions of the game and might be outdated with the current version of the engine (some code aren't updated, the minecart is unchanged since the alpha 0.1 and still use set_tunic_sprite_id()).
For example, the Guard use 3 scripts (normal guard, chasing guard and it's detection field graphic), normal guard and chasing guard can be merged, and now, as I mastered a bit the engine, the destination id for guards should be managed through the map script (entity:set_caught_dest_id()), the current code redirrect Link into an unexisting test map.
[x] Minecart
Code was untouched since 2015 and used very primitive way to work (storing equipment, freeze the hero, game value to check if the minecart is active, global variable, etc :-> https://youtu.be/99qQJfXXVjI?t=2m14s), it is now updated and cleaned
What remain to do on the minecart ?
Add a state counter which will allow the minecart to go in the opposite direction
Switch may altern the path of the minecart, however, the switch need to be set becore going on the minecart as the minecart is like the Minish Cap minecart
[x] Guard
Script used on_update and collision tests, it now only use collision_tests for efficiency, as the AI system (detection script entity) is linked to the parent entity (the guard)
Destination map is now set by a map call (entity:set_caught_dest_id(map, destination))
EDIT:
Guard system is linked to the npc metatable now, the only custom entity is the detection field
[x] Platform
Platform collision size now depend to the entity size, it is not 32x32
Todo:
add entity:set_path({path}) so the platfform can be configured through script call
add entity:set_waiting_time(time) to control how much time the platform stays until it restarts
add entity:set_speed() to well you know
Despite the fact that the entity database got reworked, some codes for entities are from early versions of the game and might be outdated with the current version of the engine (some code aren't updated, the minecart is unchanged since the alpha 0.1 and still use set_tunic_sprite_id()).
For example, the Guard use 3 scripts (normal guard, chasing guard and it's detection field graphic), normal guard and chasing guard can be merged, and now, as I mastered a bit the engine, the destination id for guards should be managed through the map script (entity:set_caught_dest_id()), the current code redirrect Link into an unexisting test map.
Code was untouched since 2015 and used very primitive way to work (storing equipment, freeze the hero, game value to check if the minecart is active, global variable, etc :-> https://youtu.be/99qQJfXXVjI?t=2m14s), it is now updated and cleaned
What remain to do on the minecart ?
Add a state counter which will allow the minecart to go in the opposite direction
Switch may altern the path of the minecart, however, the switch need to be set becore going on the minecart as the minecart is like the Minish Cap minecart
[x] Guard Script used on_update and collision tests, it now only use collision_tests for efficiency, as the AI system (detection script entity) is linked to the parent entity (the guard) Destination map is now set by a map call (entity:set_caught_dest_id(map, destination))
EDIT: Guard system is linked to the npc metatable now, the only custom entity is the detection field
Todo: add entity:set_path({path}) so the platfform can be configured through script call add entity:set_waiting_time(time) to control how much time the platform stays until it restarts add entity:set_speed() to well you know