Author Topic:  (2.22) User Controlled Directional Teleport. (User Friendly, Quick, Effective.)  (Read 307 times)

0 Members and 1 Guest are viewing this topic.

Dryym

  • Supreme Member
  • *****
  • Posts: 4334
  • What's yours is mine. ~TM's Resident Master Thief~
  • Awards Members who have unlocked the robotic avatar Awarded to exemplary forum members 2 years on site 3 years on site Site art contributions/TPs in-game/Contest winners 1 year on site
    • View Profile
    • Awards
  • Xbox: dryym
Hello everyone, I have come up with an example of a really cool use for the new relative coordinate options coming in the 2.22 update.

This is a directional teleport that is triggered by equiping, Then Dequiping an item.

Here are the scripts.

Teleport\Main
If
  IsEquipped [*Left] [TeleportKey] [True]
  HasHistory [Teleporting] [Player] [False]
// Checks if the player is holding the teleport key item, And does not have a history of "Teleporting" Which wil be explained later.
Then
  History [Teleporting] [Player]
ElseIf
  IsEquipped [*Left] [TeleportKey] [False]
  HasHistory [Teleporting] [Player] [True]
// Checks if the player is not holding the teleport key, And has a history of "Teleporting" This is used to check if the player dequips the teleport key
Then
  Teleport [Player] [vrel:10,0,0]
  History [Teleporting] [Player] [Clear]
// Teleports the player 10 metres forwards, And clears their teleporting history.
EndIf
Script [Teleport\Loop]


Teleport\Loop
Wait [1000]
// You can reduce the wait time, I just have it at 1 second to be forgiving to players who scroll across the key quickly to get to other items
Script [Teleport\Main]


When either script is run for the player, It will start the loop, And allow them the ability to teleport in any direction 10 metres when using the key item.



Note: IsEquipped allows for much smoother magic systems then the previous book system, I'd highly recommend it for any magic systems that you may use in your maps.
« Last Edit: June 04, 2015, 11:33:03 AM by Dryym »

Creator of the term "Deathmine "
Jared [19|Oct 07:12 PM]: "It changes everything" Dryym