AsherGlick / Burrito

An overlay tool for Guild Wars 2 that works on linux
GNU General Public License v2.0
81 stars 19 forks source link

Guacamole Programming Language #2

Open AsherGlick opened 3 years ago

AsherGlick commented 3 years ago

Guac will be an event-driven programing language used to control triggers in-game and representable in a taco marker file. It will probably be included as either a compiled AST and or a full text representation that gets compiled to an AST on load.

Maybe this is overkill, but it would allow the creation of more complex markers and guides such as Dungeon, Fractal, and Raid boss instructions.

Example Proposed Syntax

# The set of one or more triggers that would cause this action
triggers {
    player_enters_area()
    player_leaves_area()
    player_enters_radius()
    player_leaves_radius()
    timer_expires()
    timer_reaches_count(count)
    player_enters_combat()
    player_leaves_combat()
}

# The list of zero or more conditions that must all be true for this action to be executed
conditions {
    or (true(), false())
    not(false())
    and(true(), true())

    player_in_area("area_name")
    timer_has_not_reached("timer", count)
    timer_has_passed("timer", count)

    flag_value("flag_name", "value")

    true()
    false()
}

# A series of one or more actions to be executed in order if all the conditions are true
actions {
    set_ui_image("image_path")
    clear_ui_image()

    start_timer(length)
    pause_timer()
    clear_timer()

    show_area("area_name")
    hide_area("area_name")

    show_icon("icon_name")
    hide_icon("icon_name")

    show_path("path_name")
    hide_path("path_name")

    display_message("message") # Future

    set_flag("flag_name", "value")
}

This concept is inspired by the old Warcraft III trigger system but much more simplified and in text-form instead of a more complex GUI.

coderedart commented 3 years ago

I don't think it's a good idea to make a new DSL. Better to use existing plugin languages like lua and expose the functions required as a module. Also, would be better to coordinate such market format extensions with other overlays like blish to try to maintain compatibility where possible IMO.

AsherGlick commented 3 years ago

Lua was considered, but it comes with being a large and complex language with numerous safety issues to be cautions of. While all of them are surmountable, this design, as-is, is not turing complete and lends itself nicely to future iterations having a graphical interface for non-programmers.

If you champion this by implementing Lua integration in a safe manner then I would be happy to use it instead of a custom DSL.

AsherGlick commented 3 years ago

adding player_enters_radius() and player_leaves_radius() stemming from conversation in #10