Pixelmovement Script: v1.52 released!

You are great, f0tz!
All problems has gone (now I need only a footprints script working with pixelmovement) =D
Finalyl... released, can't wait to test! Should stop learning javascript"sphere" and learn RGSS/2.
your learning sphere? i been working on that for a while now its good but limited. main reason being that i wa ging to make a Ultima 8 fan game of the expansion (The Lost Vale) that was never realeased. But had major problems with making isometric.

mai problem being in ultima there werent seperate maps for the interior of houses, when you walked through the door the roof dissapeared(which i can do) but the character always appeared over the back walls, when out side the house he should be behind the back walls and infront of the front ones. know what i mean?

----------
\ _______|\
\            \
  |---------|
  |            |
  ----------

you know a site with info on this? or pm me on [email hidden]
Spheres Limited, rmxp is more expandable, and its a better RPG Maker to.
f0tz!baerchen wrote:
Hi.. finally I could finish v1.6. of the Pixelmovement.. :)

You can find it on my homepage in the scripts section like always..^^

Have fun..

edit: seems there was a problem while updating.. I reuploaded the script now..

Wheres 1.6? I only get 1.5, and the move_toward player facing problem still exists...
http://nachtmasken.rmxp.de/wb/pages/bul ... hp?lang=DE
Get the .exe file - it's the 1.6 version. And stop spamming with that "Sphere" of yours ;]
also the textfile and the rarfile are 1.6.. (; maybe you have to delete your cache / cookies to see the current version..
First of all, thanks alot. That's one of the most useful scripts i've seen so far. ;) . Anyway, if i try to
create new Waypoints with "$pixelmovement.create_waypoints", I get a message box with "Script is hanging". And another problem
is, that the game crashes if theres any Event with a start condition on the current map.

Sorry, if these problems have already been solved, but its not that easy to read all
of the 28 pages. ^^
Hi.. Are you sure, you use version 1.6? In 1.6 the problem with the Event's start condition should be solved there.. 1.6 can be found on the page too.. (maybe you have to press F5 once or delete your cache to see the 1.6)
If you already use 1.6.. what start condition do you use exactly?

Just try the $pixelmovement.create_waypoints again and it should work.. this method is quite time consuming and on slow computers, it may hang sometimes.. I cannot do anything against this.. :(
Okay, it works. I really used an older Version. ^^'

Quote:
Just try the $pixelmovement.create_waypoints again and it should work.. this method is quite time consuming and on slow computers, it may hang sometimes.. I cannot do anything against this.. :(

Hm, I already tried it around 15 times and my computer isnt that slow. :/ The Message also appears if i try to create
the Waypoints for 1 Map only, but only if its larger than 75x75 or so. Seems like I have to split some Maps, so they're smaller.^^
I have some problem...
Pathfinding isn't working good, it can't find a good way to the target.
Pathfinding in the version 1.52 was much better ;/
mh.. I will check the create_waypoints method again..

RezydentX: mh.. can you send me some further about the problem with pathfinding? E.g. the player event size, the size of the event which uses the pathfinding and some details of the way (length, many obstacles?), maybe you can make a screenshot of the situation to? Thanks.. :)
Normally pathfinding should work better than before.. maybe its only because of some wrong settings..

edit: the settings of $pixelmovement.waypoints_settings would be interesting too.. ^^
I could use some help with changing the actor graphics of the caterpillars.
I know I PM'd you about this f0tz but I switched from 1.2 to 1.6 so it might be different how it is handled?

I need to change the character graphic of the caterpillar actors instantaneously. If I do it with the standard command event the caterpillar does not update until a new map is loaded. So let's say my party is walking and I walk onto a ladder--I need to change my party to be a climbing sprite, right? Well how can I do that with this script the way it is?

Thank you.
mh.. the way I told you works fine with 1.6... I tested it myself.. I it doesnt work for you.. what did you you change at the script?
Fantastic work fotz, every problem I had was fixed, but another little bug surfaced.  Whenever you're moving around and try to access the menu, the menu won't open until you let go of all the arrow keys.  A minor bug, but a bug none the less.  Great work otherwise.
is there a way to make it face up right or up left or down left or down right? you have commands for walking, but I can't figure out the ones for facing.
Hey f0tz, I've got a problem and I'd appreciate if you could help me. I have an evented ABS, I merged it with your Pixelmovement script. No errors--- but you know how evented ABSes have to have you code X and Y co-ordinates for you to attack right and how Pixelmovement changes these co-ordinates? So now, the monsters can attack me very well, but I can't attack them no matter what.

Do you wish me to take a screenshot of the events? (one is a Common Event to check whether the enemy is in front, the other is an on-map event which tells whether the enemy is in front to the common event)

Or would you like me to send you a demo?

Edit:
Other custom scripts included are Dem0nfire's Curved KH bars. They consist of four scripts:
  • Game System
  • Scene Map**
  • Kingdom Hearts HP Bar
  • Kingdom Hearts SP Bar

Thank you in advance,
~Sieg the Angel
f0tz!baerchen wrote:
mh.. the way I told you works fine with 1.6... I tested it myself.. I it doesnt work for you.. what did you you change at the script?


Maybe I did it wrong... :-(
You said to try: $game_map.game_party_actors[2].character_name = 'new graphic name'
Can you use this in a call script event? I tried but I got an error. I typed the following as a test.
$game_map.game_party_actors[1].character_name = '001-Fighter01'
And yes I made sure I had at least 2 people in my party, but it didn't work. Something about no method for character_name.
Can you give me an example of exactly the line of code to type? Maybe I typed that 'new graphics name' part wrong.

The only non-setting things I changed in the script was change "bla" for events to ( y / 2 ) and added a couple lines of code to get game_party_actors terrain tags into variables.
Ace of Spades: That's strange.. xD I'll see what I can do there..

StarPhantom:
turn_lower_right
turn_lower_left
turn_upper_right
turn_upper_left
I think these are the commands you need.. (;

Sieg The Angel:
A screenshot of the common event may be enough.. Maybe I can tell you then, what you have to change.. ^^

CapnMuffin: The code is correct.. but I think you did another mistake.. If you use the Call Script command, you have to prevent things like this:
$game_map.game_party_actors[1].
character_name = '001-Fighter01'
Expand to see the code.


This could help:
e = $game_map.game_party_actors[1]
g = '001-Fighter01'
e.character_name = g
Expand to see the code.

(or a similar way..
f0tz it still did not work. I was always getting a no method error. SO...

#===============================================================================
# Class for the Caterpillar Characters
#===============================================================================
class Game_Party_Actor < Game_Character
  attr_accessor :move_list
  attr_accessor :ice_sliding
  attr_accessor :character_name #ADDED THIS LINE TO YOUR SCRIPT <---------------------
     
  #-----------------------------------------------------------------------------
  # initialising method
  #-----------------------------------------------------------------------------
Expand to see the code.


I added that there and now that script command works.  😆
Also I simplified it...
a = $game_party.actors[1]
e = $game_map.game_party_actors[1]
e.character_name = a.character_name
Expand to see the code.

That way you don't have to designate a specific file. Just point to the changed actor graphic again.
Hmmm, maybe there's a way to simplify it more so you don't even have to put in a specific ID #?

Thanks so much for the help!
mh.. I think this is the easiest way.. ^^

It's funny that I didn't have to add the "attr_accessor :character_name" in my pixelmovement..
f0tz!baerchen wrote:
StarPhantom:
turn_lower_right
turn_lower_left
turn_upper_right
turn_upper_left
I think these are the commands you need.. (;


dammit >.< I thought I had tried that...but I think I had turn_towards_upper_right >___< maybe thats why it didn't work aha :P thanks a ton dude this script pwns ^_^
I have some problem with a commend for changing frame order.
$game_map.events[x].frame_order = [1,2,3,4]
Expand to see the code.

I can't make it work... Is there something wrong?
And what's about the pathfinding, is there anything you can do, or I should adjust my maps to make it work right?
RezydentX: What is the problem with the frame order? Do you get an error?

For the pathfinding.. keep sure, that you created waypoints for the maps, where you want to use pathfinding..

First use this:
$pixelmovement.waypoints_settings: settings for creating waypoints for Pathfinding ([all maps?, map ids, waypoints for isometrix movement?])
e.g.: [true , [2, 3], false]: Creates waypoints for all maps except 2 and 3, no iso waypoints.
or: [false , [2, 3], true]: Creates waypoints for map 2 and 3, including isometric waypoints.


Then you have to call this during the game on a map via event command:
$pixelmovement.create_waypoints

The waypoints are static.. so if you edit a map, where you already have created waypoints for, you need to recreate the waypoints.. the creating of waypoints can take a long time, especially on huge maps and if you want to have them for many maps..
Quote:
For the pathfinding.. keep sure, that you created waypoints for the maps, where you want to use pathfinding...

I know that, but the problem lies in the script. You wrote:
Quote:
The problem is the quite narrow path, the event has to take.. I'll see what I can do there.. But I think it will be difficult to improve this.. :(

So I'm asking... Can you fix that or should I find another solution?
About frame_order:
http://img218.imageshack.us/img218/6940/bladcw2.png[/img]
I tried to change frame order in Set Move Route ('frame_order = ...') but nothing happens.
o0 sorry.. I didnt know anymore that you meant this problem... :D Well I dont think there is a way for me to fix this.. :( I had to rebuild the whole Pathfinding thing (and I dont know how..)

The error because of the frame_order says, that you're event does not exist.. maybe the "x" is a wrong id?
Quote:
o0 sorry.. I didnt know anymore that you meant this problem... :D Well I dont think there is a way for me to fix this.. :( I had to rebuild the whole Pathfinding thing (and I dont know how..)

Pathfinding form 1.52 was the best ;<
Quote:
The error because of the frame_order says, that you're event does not exist.. maybe the "x" is a wrong id?

No, it was an 'example value'
id -1 -> error
id 0 -> error
id of some event (for example 1) -> there is no effect
ok.. I remember now what the problem is with changing the frame order like this.. the only possibility to change the frame order is to add a command at the beginning of the first page of the event..
"Frame Order: 1,2,3,4"
for example.. (;
I have question. Is there a way for make a length for single move? I thinking about a variable such as $pixelmovement.step_length, by default 1. Or a way to disable pixel movement, because I need for actual project only sized events (eventually pathfinding and minimap). Is that possible?
copy this directly below the pixelmovement:
$steps = 32

#===============================================================================
# Game_Character Class
#===============================================================================
class Game_Character
  #-----------------------------------------------------------------------------
  # New Move Route (more pixellike)
  #-----------------------------------------------------------------------------
  def move_type_custom
    return if jumping? or moving?
   
    #---------------------------------------------------------------------------
    # commands
    #---------------------------------------------------------------------------
    while @move_route_index < @move_route.list.size
      command = @move_route.list[@move_route_index]
      command.parameters[0] = $steps ###
      if command.code == 0
        @move_route_index = 0 if @move_route.repeat

        unless @move_route.repeat
          if @move_route_forcing and not @move_route.repeat
            @move_route_forcing = false
            @move_route = @original_move_route
            @move_route_index = @original_move_route_index
            @original_move_route = nil
           
            # for pathfinding
            if @pathfinding.active
              @pathfinding.active = false
              self.turn_toward_coords(@pathfinding.target_x,
                                      @pathfinding.target_y)
            end
          end
          @stop_count = 0
        end
        return
      end
     
      if command.code <= 14
        command.parameters[0] = 32 if command.parameters[0] == nil
        case command.code
        when 1
          move_down(command.parameters[0], true)
        when 2
          move_left(command.parameters[0], true)
        when 3
          move_right(command.parameters[0], true)
        when 4
          move_up(command.parameters[0], true)
        when 5
          move_lower_left(command.parameters[0], true)
        when 6
          move_lower_right(command.parameters[0], true)
        when 7
          move_upper_left(command.parameters[0], true)
        when 8
          move_upper_right(command.parameters[0], true)
        when 9
          move_random(command.parameters[0], true)
        when 10
          move_toward_player(command.parameters[0])
        when 11
          move_away_from_player(command.parameters[0])
        when 12
          move_forward(command.parameters[0])
        when 13
          move_backward(command.parameters[0])
        when 14
          jump(command.parameters[0] * 32, command.parameters[1] * 32)
        end

        if @max_steps != 0 and @max_steps != command.parameters[0] and
        command.code != 14
          length = @move_route.list.length - 1
          if @move_route_index - 1 < 0
            part1 = []
          else
            part1 = @move_route.list[0..@move_route_index - 1]
          end
          part2 = @move_route.list[@move_route_index + 1..length]
          partnew1 = command.clone
          partnew2 = command.clone
          partnew2.parameters = [partnew2.parameters[0] - @max_steps]
          partnew1.parameters = [@max_steps]
          @move_route.list = part1 + [partnew1, partnew2] + part2
        elsif not @move_route.skippable and not moving? and not jumping?
          return
        end
       
        @move_route_index += 1
        return
      end

      if command.code == 15
        @wait_count = command.parameters[0] * 2 - 1
        @move_route_index += 1
        return
      end
 
      if command.code >= 16 and command.code <= 26
        case command.code
        when 16
          turn_down
        when 17
          turn_left
        when 18
          turn_right
        when 19
          turn_up
        when 20
          turn_right_90
        when 21
          turn_left_90
        when 22
          turn_180
        when 23
          turn_right_or_left_90
        when 24
          turn_random
        when 25
          turn_toward_player
        when 26
          turn_away_from_player
        end
        @move_route_index += 1
        return
      end

      if command.code >= 27
        case command.code
        when 27
          $game_switches[command.parameters[0]] = true
          $game_map.need_refresh = true
        when 28
          $game_switches[command.parameters[0]] = false
          $game_map.need_refresh = true
        when 29
          @move_speed = command.parameters[0]
        when 30
          @move_frequency = command.parameters[0]
        when 31
          @walk_anime = true
        when 32
          @walk_anime = false
        when 33
          @step_anime = true
        when 34
          @step_anime = false
        when 35
          @direction_fix = true
        when 36
          @direction_fix = false
        when 37
          @through = true
        when 38
          @through = false
        when 39
          @always_on_top = true
        when 40
          @always_on_top = false
        when 41
          @tile_id = 0
          @character_name = command.parameters[0]
          @character_hue = command.parameters[1]
          if @original_direction != command.parameters[2]
            @direction = command.parameters[2]
            @original_direction = @direction
            @prelock_direction = 0
          end
          if @original_pattern != command.parameters[3]
            @pattern = command.parameters[3]
            @original_pattern = @pattern
          end
        when 42
          @opacity = command.parameters[0]
        when 43
          @blend_type = command.parameters[0]
        when 44
          $game_system.se_play(command.parameters[0])
        when 45
          result = eval(command.parameters[0])
        end
        @move_route_index += 1
      end
    end
  end
end

#===============================================================================
# Game_Player Class
#===============================================================================
class Game_Player < Game_Character
 
  #-----------------------------------------------------------------------------
  # update method
  #-----------------------------------------------------------------------------
  def update    

    #---------------------------------------------------------------------------
    # checks input + moves
    #---------------------------------------------------------------------------
    if not (self.moving? or self.jumping? or
    $game_system.map_interpreter.running? or
    @move_to_place or @move_route_forcing or @direction != @old_direction or
    $game_temp.message_window_showing or @ice_sliding)
      steps = $steps#[(2 ** (@move_speed - 1)).round, 2].max

      # Sprint fix?
      if @sprint and $pixelmovement.sprint_fix
        move_forward(steps)
       
      # Input
      else
        case Input.send($pixelmovement.movement_type)
        when 1
          move_lower_left(steps, true, true)
        when 2
          move_down(steps, true, true)
        when 3
          move_lower_right(steps, true, true)
        when 4
          move_left(steps, true, true)
        when 6
          move_right(steps, true, true)
        when 7
          move_upper_left(steps, true, true)
        when 8
          move_up(steps, true, true)
        when 9
          move_upper_right(steps, true, true)
        end
      end

      #Sprint Script off
      if @sprint
        @move_speed -= $pixelmovement.sprint_speed
        @sprint = false
      end
    end

    @last_real_x = @real_x
    @last_real_y = @real_y
   
    if not moving?
      @move_to_place = false if @move_to_place
      if Input.trigger?(Input::C) and !(@move_route_forcing or @move_to_place)
        self.check_event_trigger_here([0])
        self.check_event_trigger_there([0, 1, 2])
      end
    end

    # checks if sprint is activated
    self.check_sprint_input
   
    # checks if player shall jump
    self.check_jump_input
 
    # checks if player is sliding on ice
    self.check_ice_sliding
   
    super
   
    if not (@move_route_forcing or @move_to_place)
      # Event determinant is via touch of same position event
      result = check_event_trigger_here([1, 2])
      # updates encounter count according to move_speed
      if result == false and (@encounter_count > 0 and
      not ($DEBUG and Input.press?(Input::CTRL)))
        @encounter_count -= @max_steps
      end
    end
   
    @pattern = @original_pattern if @ice_sliding
                       
    # checks if the player stands on a jump tile
    self.check_jump

    # updates scrolling
    if @real_y > @last_real_y and @real_y - $game_map.display_y > CENTER_Y
      $game_map.scroll_down(@real_y - @last_real_y)
    end
    if @real_x < @last_real_x and @real_x - $game_map.display_x < CENTER_X
      $game_map.scroll_left(@last_real_x - @real_x)
    end
    if @real_x > @last_real_x and @real_x - $game_map.display_x > CENTER_X
      $game_map.scroll_right(@real_x - @last_real_x)
    end
    if @real_y < @last_real_y and @real_y - $game_map.display_y < CENTER_Y
      $game_map.scroll_up(@last_real_y - @real_y)
    end

  end
end
Expand to see the code.


This should give you the possibility to change the step length.. (just change the variable $steps at the top)

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=624