Jump to content


Photo

Compass move commands


  • Please log in to reply
No replies to this topic

#1 Tsukihime

Tsukihime

    Advanced Member

  • Ace Member
  • 7,120 posts
  • LocationToronto
  • RM Skill - Coder

Awards Bar:

Users Awards

Posted 03 September 2012 - 06:54 PM

Compass move commands
-Tsukihime

Set move commands based on the current "north" direction.
The north direction can be set in the move route using a script call.

For example, this allows your move routes to be based on the the player's current direction without writing cases for each direction.

Usage

So for example, suppose the following cases

North direction = up
   move_north = up
   move_south = down

North direction = left
   move_north = left
   move_south = right

The following methods are available

set_north(direction)
     -takes a numerical direction (2, 4, 6, 8) to specify the north dir
     -2 = down, 4 = left, 6 = right, 8 = up

   move_north(count)
   move_south(count)
   move_west(count)
   move_east(count)
   turn_north
   turn_west
   turn_east
   turn_south

Where `count` is the number of times you want to move in that direction

Download

Script: http://db.tt/oxBX6LjG

Note

These methods have been implemented in FP: Move Routes as well as Event Wrapper under the same method names.

I am also looking for a way to force the entire move route to be direction-relative rather than absolute, but it is not as straightforward as hardcoding some commands. Naturally, setting a flag would be a more useful approach because you could just add an extra script call to your existing move routes to make them direction-aware rather. And I wouldn't have to write direction-relative methods for every command.

Edited by Tsukihime, 03 September 2012 - 06:59 PM.

All of my work can be found on my website:

banner200x40.png

You can follow me on any of these platforms:

logo_facebook40x40.pnglogo_twitter40x40.pnglogo_youtube40x40.pnglogo_patreon40x40.png

Go here for Bugs and Requests.

 

Want to become a beta tester for my plugins before they are released to the public?





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users