Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: diagostimo on June 16, 2012, 12:16:59 am

Title: script call for event direction?
Post by: diagostimo on June 16, 2012, 12:16:59 am
hey, im trying to change the direction an event is facing depending on which way it is currently facing, through looking through the interpreter i found out how to change its direction, but i can find any method to check what direction it is curently facing, im trying to achieve this in the interpreter class under a new call: heres what i have so far:

class Interpreter
  def respawn_wait
    if $game_party.randomizer > 0
      character = get_character(0)
      if #character is facing down
        character.turn_left
      else
        character.turn_up
      end
      @wait_count = $game_party.randomizer
 
    end
  end
end

so ye i need to replace #character is facing down with something that checks the direction  :huh:
Title: Re: script call for event direction?
Post by: KK20 on June 16, 2012, 01:02:05 am
class Game_Character
  attr_accessor :direction
end

You should be able to handle it from there.
Title: Re: script call for event direction?
Post by: diagostimo on June 16, 2012, 01:25:18 am
Spoiler: ShowHide
(http://img337.imageshack.us/img337/3063/jackiechanwtf.jpg)

i actually tried to set the direction using character.direction = 4 but when it threw an error i didnt think i could use it through the get_character method at all, but thanks changing it to an accessor makes it so i can set it to now :D