Really great that you can now force animations from global/hook scripts, but I was wondering why the following still won't work for me. If I put this in Klint's script under description_p_proc:
then the chap runs towards me, then back towards where I clicked on him. If, however, I put the same thing in hs_keypress (checking for the critter on the tile_under_cursor rather than self_obj), then all he, or any other critter, does is perform the first action: he runs towards me, then stops in his tracks without going back to the location of the cursor.
edit:
Would I be right to conclude from this that the safest way to import procedures across hook and global script would be to export them from the dude script? After all, it's the only one reliably called every time and before all the hook and global scripts, right?
Code:
reg_anim_clear(self_obj);
reg_anim_begin();
reg_anim_obj_run_to_tile(self_obj, dude_tile, -1);
reg_anim_obj_run_to_tile(self_obj, tile_under_cursor, -1);
reg_anim_end();
then the chap runs towards me, then back towards where I clicked on him. If, however, I put the same thing in hs_keypress (checking for the critter on the tile_under_cursor rather than self_obj), then all he, or any other critter, does is perform the first action: he runs towards me, then stops in his tracks without going back to the location of the cursor.
edit:
Just tested it again myself and here's the deal:
- you can use exported procedures between normal scripts (objects and maps), but you must respect scripts loading order. In other words, scripts with "export" should be the one's that loaded first. Typically export everything in map script and import in object script
- however, there is obviously something wrong with them when using from sfall scripts, when I call imported procedure, it works, but the script stops working after that call, and nothing is printed in debug.log (no crash)
- they were even more broken before sfall, some TeamX guy made patches very long time ago, which Timeslip incorporated - it fixed several crashes. Though, looks like more fixing is required for full usage.
Script load order is:
- Map script
- Map objects scripts
- Sfall Hook scripts
- Sfall global scripts
Would I be right to conclude from this that the safest way to import procedures across hook and global script would be to export them from the dude script? After all, it's the only one reliably called every time and before all the hook and global scripts, right?
Last edited: