Hi,
Our adventuron game is nearly finished and we are mainly on "quality of life" improvement phase based on feedback (and improving tutorial).
I wanted to do some test about maybe about adding some action when clicking a part of the graphic, this should be possible by injecting a script in compiled html, and then the script would handle click over banner using gid attribute (from `<div gid="my_first_room" ...>`), but there is two things that make this a little ugly:
- if there is overlay, we just get a `<div gid="my_room_name" ...><canvas /></div>` that doesn't indicates which overlay are present
- the code particular to each graphics would need to be in the injected javascript, I would prefer if all code particular to a game is in the adventuron file only.
So there is a solution but not perfect, and I was wondering if through experimental_javascript command (I have not been able to use it, the editor not allowing experimental_javascript anywhere I tried) or something else, there would be a way to send a variable between adventuron and a custom javascript outside, so for example I would like to have something equivalent to this in adventuron:
: setcookie current_region_area_commands "[[0, 0, 5, 5, '/look book'], [15, 15, 25, 20, '/look car']]"
and in javascript the code would just use the cookie `current_region_area_commands` (next time we detect that banner image has changed) and do what is needed.
I give cookie as example, but it could be anything else as long as the information can be gotten to external script from adventuron. The cookbook example of experimental_javascript would be perfect if I understood how to use it and if we could give parameter the the function that is called.