Save-Point
Pixelmovement and Zoom - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Code Support (https://www.save-point.org/forum-20.html)
+--- Thread: Pixelmovement and Zoom (/thread-189.html)

Pages: 1 2


Pixelmovement and Zoom - ark - 05-28-2010

Hi!

I've got a script which I adore... Well, make it two.

One is the Pixelmovement script by f0tz!baerchen (I use the light version)
And the other one was made for me by a very sweet scripter, and it makes me able to zoom in on the character set and make it bigger or smaller.

I would like you to help me to make these two scripts compatible with each other. Please, it would be a lot of help!

(the error is: 'No implicit conversion to float from nil' and it points to line 17 in this script:)

self.zoom_x, self.zoom_y = @character.zoom_x, @character.zoom_y

Code:
class Game_Character  
  alias_method :ark_sizing_game_character_initialize, :initialize  
  attr_accessor :zoom_x
  attr_accessor :zoom_y  
  def initialize    
    ark_sizing_game_character_initialize    
    @zoom_x = @zoom_y = 1.0  
  end
  def resize(zoom_x, zoom_y)    
    @zoom_x, @zoom_y = zoom_x, zoom_y  
  end
end
class Sprite_Character < RPG::Sprite  
  alias_method :ark_sizing_sprite_character_update, :update  
  def update    
    ark_sizing_sprite_character_update    
    self.zoom_x, self.zoom_y = @character.zoom_x, @character.zoom_y  
  end
end



[Resolved] Pixelmovement and Zoom - Jaberwocky - 05-29-2010

Put it above the pixelmovement script.


[Resolved] Pixelmovement and Zoom - ark - 05-29-2010

Thanks. It starts the project now, but I get another error when I want to change the size of my charset using a call script...

The call script:
$game_player.resize(2,2)

And the error says:
Wrong number of arguments (2 for 1)
and it poits to the pixelmovement script with line 1987 which is this:
self.turn_toward_event(id, false)
(it is in: def direction_to(id))

I don't know too much about scripting, but I tried this call script, too:
$game_player.resize(2)
and it gave me the same error.
Does it mean that I have problem with pixelmovement rather than the two scripts?

EDIT:
Okay I experimented a little...
I deleted the sizing script and it gave me the same error. If I put in an event and go and hiit action next to it, it gives me this error. Can you help me what would be the problem with the Light Pixelmovement script?


[Resolved] Pixelmovement and Zoom - Jaberwocky - 05-29-2010

I have no idea. I'm using the same pixelmovement script and it works fine for me.
The problem is not with the resize method, but with the turn_toward_event method.
It could be that some other script is writing over the pixelmovement methods, but I can't really tell much unless I know what scripts are being used and in what order.


[Resolved] Pixelmovement and Zoom - ark - 05-29-2010

This is in a clean new project. And I'm using the legal RMXP...

Or could you help me and send me the Scripts.rxdata file of yours?

I can't figure it out what is really the problem...


[Resolved] Pixelmovement and Zoom - Jaberwocky - 05-30-2010

http://www.mediafire.com/?gizygxmygqd

Good luck with that >.>;


[Resolved] Pixelmovement and Zoom - ark - 05-30-2010

Thanks for uploading the file, but it doesn't help me. It is filled with your scripts and it always gives me errors that I haven't got files or something...

And in a fresh environment, I copied only the pixelmovement script from your script-base and the character (the player) is stuck in the top left corner of the screen and cannot walk...

EDIT:
Wow, now I found a website which had the lattest version of the script... (1.6, I only had 1.0) and it works now and doesn't crash. But, now the sizer script just doesn't do anything... I try to size the charset and it just doesn't do it...

EDIT 2:
I've uploaded my project...
http://www.2shared.com/file/y6f4v4qf/Project1.html


[Resolved] Pixelmovement and Zoom - Jaberwocky - 05-30-2010

Wierd, cuz the resize option worked just fine for me.
Can you upload the project on a site that doesn't spam me with popups and actually lets me download the thing? Like mediafire?


[Resolved] Pixelmovement and Zoom - ark - 05-30-2010

Here is the link:
http://www.mediafire.com/?y2tijwmhzzh

I wanted to upload it to mediafire for the first time, but it was down...


[Resolved] Pixelmovement and Zoom - Jaberwocky - 05-31-2010

Remove this part from the sizing script:
Code:
class Sprite_Character < RPG::Sprite  
  alias_method :ark_sizing_sprite_character_update, :update  
  def update    
    ark_sizing_sprite_character_update    
    self.zoom_x, self.zoom_y = @character.zoom_x, @character.zoom_y  
  end
end
And place it below the pixelmovement script. Leave the other half of the sizing script above the pixelmovement script.