Skip to content

Rune Magic: Targeting Support #131

@brightrim

Description

@brightrim

Rune Magic could use targeting support client side in co-operation with a server side entry point.

In the form of an entry point that requests the user to select a tile (similar to how dialogs work) by turning the cursor into a wand, left clicking on a tile to select it, right clicking to cancel the action. Entry point should return as boolean and position(x,y,z) for whether it succeeded and what the position selected is.

Bonus points if what graphic the cursor turns into can be decided in the entry point, so this function can be used for other areas of the games development as well.

Example of what it would look like lua side:

local function getPlayersTarget(user)

    local callback = function(getTarget)
    --user's cursor turns into the graphic determined previously
        if not freeTargeting:getSuccess() then
            --user right clicked or the targeting failed/was interrupted somehow. Cursor goes back to normal.
            return
        end
        --user left clicked, determining a tile position to be the target. Cursor goes back to normal.
        local targetedPosition = freeTargeting:getPosition()

        return targetedPosition
    end

    user:requestFreeTargeting(entryPointparameters, graphicToTurnTheMouseCursorInto, callback)

end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions