Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Change Player/Character Animation Frame Count, Help please!
Resource Dragon
post Dec 6 2011, 11:17 AM
Post #1


Dragon has RAWR. So... RAWR.
Group Icon

Group: Local Mod
Posts: 984
Type: Developer
RM Skill: Masterful
Rev Points: 95




Somewhere in the scripts i've seen the frame count for the characters, but i don't remember where. It's been way to long since i've used VX lol.

example:

a normal sprite animation sheet is 3 wide x 4 long (4 directions, each with three sprites)

I just know i've seen the code in the scripts where you can change this amount.

Any idea where? :S

This post has been edited by Resource Dragon: Dec 6 2011, 11:17 AM


__________________________
click me ->Signup for Digital Hijinks!<- click me
Go to the top of the page
 
+Quote Post
   
Kread-EX
post Dec 6 2011, 11:46 AM
Post #2


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




Within Sprite_Character.

CODE
  #--------------------------------------------------------------------------
  # * Update Transfer Origin Bitmap
  #--------------------------------------------------------------------------
  def update_bitmap
    if @tile_id != @character.tile_id or
       @character_name != @character.character_name or
       @character_index != @character.character_index
      @tile_id = @character.tile_id
      @character_name = @character.character_name
      @character_index = @character.character_index
      if @tile_id > 0
        sx = (@tile_id / 128 % 2 * 8 + @tile_id % 8) * 32;
        sy = @tile_id % 256 / 8 % 16 * 32;
        self.bitmap = tileset_bitmap(@tile_id)
        self.src_rect.set(sx, sy, 32, 32)
        self.ox = 16
        self.oy = 32
      else
        self.bitmap = Cache.character(@character_name)
        sign = @character_name[/^[\!\$]./]
        if sign != nil and sign.include?('$')
          @cw = bitmap.width / 3
          @ch = bitmap.height / 4
        else
          @cw = bitmap.width / 12
          @ch = bitmap.height / 8
        end
        self.ox = @cw / 2
        self.oy = @ch
      end
    end
  end


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
Resource Dragon
post Jan 15 2012, 04:45 PM
Post #3


Dragon has RAWR. So... RAWR.
Group Icon

Group: Local Mod
Posts: 984
Type: Developer
RM Skill: Masterful
Rev Points: 95




Let me rephrase my question.

I meant I needed the amount of frames in one character changed.

I've played around with it but I can't figure out how to change it so the '$name.png'
will change from a 3 x 4 animation to a 5 x 4 animation.

Could you post how it would be changed?

This post has been edited by Resource Dragon: Jan 15 2012, 04:46 PM


__________________________
click me ->Signup for Digital Hijinks!<- click me
Go to the top of the page
 
+Quote Post
   
Kread-EX
post Jan 16 2012, 02:48 AM
Post #4


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




Basically, look at this:
CODE
        if sign != nil and sign.include?('$')
          @cw = bitmap.width / 3
          @ch = bitmap.height / 4

If you have a $ in the name, the bitmap width is divided per 3 and the height per 4.
To change it into a 5x4 sheet, you just need to replace this:
CODE
          @cw = bitmap.width / 3
with this:
CODE
          @cw = bitmap.width / 5

Obviously this won't show in the editor, just in the game.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
Resource Dragon
post Jan 16 2012, 04:01 PM
Post #5


Dragon has RAWR. So... RAWR.
Group Icon

Group: Local Mod
Posts: 984
Type: Developer
RM Skill: Masterful
Rev Points: 95




EDIT: For some reason when I try to add another one, e.g. "#(name).png", It keeps giving me an ErCode, "nil can't be coerced into Fixnum"

I changed the $ one to 5 x 4,

and it takes the first 3 frames of each row and plays them instead of all 5.

...?

This post has been edited by Resource Dragon: Jan 16 2012, 11:14 PM


__________________________
click me ->Signup for Digital Hijinks!<- click me
Go to the top of the page
 
+Quote Post
   
Kread-EX
post Jan 16 2012, 11:40 PM
Post #6


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




QUOTE
EDIT: For some reason when I try to add another one, e.g. "#(name).png", It keeps giving me an ErCode, "nil can't be coerced into Fixnum"

If you want to use another symbol other than $, you need to update the regexp. Like this:
CODE
        sign = @character_name[/^[\!\$\#]./]
        if sign != nil and sign.include?('$')
          @cw = bitmap.width / 3
          @ch = bitmap.height / 4
       elsif sign != nil and sign.include?('#')
          @cw = bitmap.width / 5
          @ch = bitmap.height / 4
        else
          @cw = bitmap.width / 12
          @ch = bitmap.height / 8
        end


QUOTE
and it takes the first 3 frames of each row and plays them instead of all 5.

Because by default, there is only 3 animation patterns. Patterns are more or less universal, so differentiate between certain characters can be tricky. You need to alter both Game_Character and Sprite_Character, but I can't give you more precise informations without knowing a bit more what you want to do. Can this apply to the player? Or only events? Things like that.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
Resource Dragon
post Jan 18 2012, 12:39 PM
Post #7


Dragon has RAWR. So... RAWR.
Group Icon

Group: Local Mod
Posts: 984
Type: Developer
RM Skill: Masterful
Rev Points: 95




QUOTE
Because by default, there is only 3 animation patterns. Patterns are more or less universal, so differentiate between certain characters can be tricky. You need to alter both Game_Character and Sprite_Character, but I can't give you more precise informations without knowing a bit more what you want to do. Can this apply to the player? Or only events? Things like that.


The '#' symbol would be the same as the '$' symbol, except it would play a 5 x 4 animation instead of a 3 x 4 animation.
It would apply to everything the '$' symbol can.

This post has been edited by Resource Dragon: Jan 18 2012, 12:40 PM


__________________________
click me ->Signup for Digital Hijinks!<- click me
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 09:34 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker