Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rune Magic: Targeting Support #131

Open
brightrim opened this issue Jan 21, 2022 · 0 comments
Open

Rune Magic: Targeting Support #131

brightrim opened this issue Jan 21, 2022 · 0 comments

Comments

@brightrim
Copy link
Member

brightrim commented Jan 21, 2022

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant