The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: rofl1337 on June 16, 2011, 12:36:58 PM

Title: [Resolved] Modern Algebra's Fix Picture to Map problem
Post by: rofl1337 on June 16, 2011, 12:36:58 PM
Script found here: http://rmrk.net/index.php/topic,39052.0.html (http://rmrk.net/index.php/topic,39052.0.html)
When I set the FPM_SWITCH to 1 and the FPM_Z_VARIABLE to 2, "above character" events still appear below the picture.
What am I doing wrong?
Also, the comments in the script say, that there are two switches, that must be opperated, but I can only see the FPM_SWITCH.
sincerly
Title: Re: Modern Algebra's Fix Picture to Map problem
Post by: exhydra on June 16, 2011, 09:51:13 PM
Did you set the priority of the event as 'Above Character'? That is necessary for it to be above the image.

EDIT : Oop, eating lunch and reading posts isn't good ... missed that part about that you did change the priority. However, I just tried putting an 'Above Character' event over top of an image and it worked just fine. Are you setting the FPM_SWITCH to true? Or just '1'.
Title: Re: Modern Algebra's Fix Picture to Map problem
Post by: rofl1337 on June 17, 2011, 11:41:53 AM
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fwww7.pic-upload.de%2F17.06.11%2Fu1z8kmakzxg6.png&hash=f7be0b62c1fb81d8728ac36f80269e13481839c0) (http://www.pic-upload.de/view-10357955/screen.png.html)
"Above Character" Events are displayed below the coasthouse_below.png.

The variable and the switch are properly assigned.
Does anyone know, what is up with this Picture_Layer_Switch, talked about here: http://rmrk.net/index.php/topic,39049.0.html (http://rmrk.net/index.php/topic,39049.0.html)?
Title: Re: Modern Algebra's Fix Picture to Map problem
Post by: rofl1337 on June 19, 2011, 01:27:35 PM
Bump
I searched for a conflicting script, but neither moving the script to the top, nor to the bottom of my script list changed a thing.
Title: Re: Modern Algebra's Fix Picture to Map problem
Post by: modern algebra on June 19, 2011, 03:22:09 PM
If you upload a project with the error reproduced, I will take a look.
Title: Re: Modern Algebra's Fix Picture to Map problem
Post by: rofl1337 on June 19, 2011, 08:18:46 PM
Uploaded. I hope it's some obvious noob mistake, thats easy to fix.
Title: Re: Modern Algebra's Fix Picture to Map problem
Post by: modern algebra on June 19, 2011, 10:07:36 PM
Hmm, well try going down to line 84 and changing:



      when 2 then 200


to:


      when 2 then 199
Title: Re: Modern Algebra's Fix Picture to Map problem
Post by: exhydra on June 19, 2011, 10:10:27 PM
I got it to work on mine by adding in a return after line 124. I don't think it breaks anything ... ?


   if @picture.map_locked
      self.ox, self.oy = $game_map.display_x / 8, $game_map.display_y / 8
      return
    end


The Z was getting overwritten (or something) after I stepped past a certain point on the map. Looks like when the map is larger than 17x13 squares, if you step too far away from the displayed image, it loses its Z order and then gets it back after you step within range again.

I shifted everything up to the far upper-left corner of the map to test, because I found that the Above Character functioned the closer it was to that point.

Weird stuff ...



EDIT : Oh, could it be that the picture Z was conflicting with Game_Character > screen_z (line 261)? Both the event and the picture would be set at a z of 200. If I change the z listed within screen_z to 201, the event remains above the picture at all times (when variable is set to '2').

So I guess the proper fix would be to drop '200' within the script to '199', then?

  #--------------------------------------------------------------------------
  # * Get Screen Z-Coordinates
  #--------------------------------------------------------------------------
  def screen_z
    if @priority_type == 2
      return 200
    elsif @priority_type == 0
      return 60
    elsif @tile_id > 0
      pass = $game_map.passages[@tile_id]
      if pass & 0x10 == 0x10    # [?]
        return 160
      else
        return 40
      end
    else
      return 100
    end
  end
Title: Re: Modern Algebra's Fix Picture to Map problem
Post by: rofl1337 on June 20, 2011, 09:16:33 AM
changed it to 199, worked.
Was this a common issue, or just a one I encountered?
Anyway, whats up with this third switch you talked about, Modern Algebra?
Did you remove it?
Title: Re: Modern Algebra's Fix Picture to Map problem
Post by: modern algebra on June 20, 2011, 11:46:19 AM
Yeah, the third switch doesn't exist anymore. Just ignore it.

As far as I know, this is the only time I ever received a complaint about that, but I would have to assume that it is a common problem.