Here is an experimental scripted hookshot!
It is meant to replace the built-in one. I have attached it to this post and added it to the libsolarus-mudora project.
There is a hookshot.lua item script, you just have to add it to your quest in the entities folder (as the structure of the zip file suggests).
Also add hookshot_config.lua there. hookshot_config.lua is where you can customize things: edit it to set your hookshot properties:
-- Configuration of the hookshot.
-- Feel free to change these values.
local config = {
-- Range of the hookshot in pixels.
distance = 120,
-- Speed in pixels per second.
speed = 192,
-- What types of entities can be cought.
-- Additionally, all entities that have a method "is_catchable_with_hookshot"
-- returning true will be catchable.
catchable_entity_types = { "pickable" },
-- What types of entities the hookshot can attach to.
-- Additionally, all entities that have a method "is_hookable"
-- returning true will be hookable.
hookable_entity_types = { "chest", "destructible", "block" },
}
return config
There is also a custom entity model called "hookable". Useful if you want something hookable without other behavior. The trick of creating an empty destructible object is no longer needed.