Jump to content

Recommended Posts

    Yesterday I saw lines of coding like this:

Quote

TheInput:AddKeyUpHandler(KEY_2, function()
  if TheInput:IsKeyDown(KEY_CTRL) then
  local player = TheSim:FindFirstEntityWithTag("player");
  player.Transform:SetPosition(TheInput:GetMouseWorldPos():Get())
  end
  end
  )

    And the effect of it is to transport character to where your cursor is when pressing Ctrl+2 .

    I was thinking on it when I remember sth from another game and wondered whether I could limit the range of transporting.

    Idk whether it was sth relevant to

local x, y, z = MainCharacter.Transform:GetWorldPosition()

    If so, then how to code it ?

    There also exist some weird thoughts:

    1. adding sound effect when transporting

    2. looking for creatures around the character in a certain range and stopping their actions, then do transporting which takes the creatures as the centre of range. (I'm looking for some codding around and see this one http://forums.kleientertainment.com/topic/69666-help-final-fantasy-mod-soon-character-mod-comming-on-workshop/#comment-805681 . Seems some of the coding there can be somehow useful )

    3. changing the keybind into clicking the right mousebutton

    Wanna learn how to correctly use 'math' as well...

    With lots of appreciation and lots of apologies for bad grammar_(:з」∠)_

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...