I would like to know how to make this script alter how it reads tilesheets

Status
Not open for further replies.

deathsia

Pegisister
Veteran
Joined
Feb 26, 2014
Messages
648
Reaction score
55
First Language
English
Primarily Uses
I came a crossed a really nice script in my google searches that allows me to play an 8-frame walk animation sprite sheet, now I've ran into a small snag:



As you can see, while my frontal walk animation fits within the 9x4 format the script calls for, my side walking animation does not fit within this ratio.

Beyond shrinking the second row to an a smaller size (which makes the sprites look like **** no how you resize them), I don't know how to make this work properly.

Now this is where my theory came into play, if this script alter's how it reads the above sprite sheet, then maybe I can alter it to read it how I want it to, the problem is, I can't figure it out. I mean yeah I can read and know what the script is saying to a degree but I'm afraid if I alter one value it will not work right due to the fact that the other parts of the script(That I can't understand) are asking for a value that no longer exists.

So If someone could tell me what changes to make and where then I'd be grateful.

Here's the specs of the sprites for reference.(this is going by the 9x4 ratio the script was calling for btw)

my frontal and hide view sprites fit exactly within a 32x64 px ratio

My side view sprites fit within a 64x64 px ratio.

What I need to know:

  • What values to change within the script and where so that it reads all 8 frames within a 64x64px ratio
  • Exact size I need to make my new sprite sheet.
Once I know this I can change these values with ease since I can read scripts fairly well, just give me the info above, what line it's on and values I need to change.

The script:

Code:
#----------------------------------# Thera's variation of the multiple frame script.## My first RSS script ever. I'm pretty proud of it.# It's meant to be used with a sprite set of 9 frames wide, with the first frame# being a 'standing still' frame, and the rest the actual walkcycle.## It only works on files using a '%' at the beggining of their name.#----------------------------------class Sprite_Character < Sprite_Base  #--------------------------------------------------------------------------  # * Set Character Bitmap  #  # Thera's notes: Character Bitmap analyses the spriteset and sets how big  # the frames in the sprite set are.  # It also checks before hand whether the file start with a '!', '$' or '%'  # After wards it sets the drawing origin of the sprite relative to the  # character origin.  #--------------------------------------------------------------------------  def set_character_bitmap	self.bitmap = Cache.character(@character_name)	#start changes#	# Yes, this is a nested if_statement, but files starting with '!' would	# complain if I did otherwise.		sign = @character_name[/^[\!\$\%]./]		  if sign && sign.include?('$')		  @cw = bitmap.width / 3		  @ch = bitmap.height / 4		  @sixframes = false		  else			if sign && sign.include?('%')			@cw = bitmap.width / 9			@ch = bitmap.height / 4			@sixframes = true			  			else			  @cw = bitmap.width / 12			  @ch = bitmap.height / 8			  @sixframes = false			end		  end				#end changes#	self.ox = @cw / 2	self.oy = @ch  end  #--------------------------------------------------------------------------  # * Update Transfer Origin Rectangle  #  # Thera's notes: Update Transfer Origin Rectangle changes the part of the  # spritesheet that is being used as the current sprite of the character.  # So it moves this rectangle around on the spritesheet.  # I make it check whether 'sixframes' and thus the special sheet is true,  # applying different rectangle movements for different spritesheets.  #--------------------------------------------------------------------------  def update_src_rect	if @tile_id == 0	  index = @character.character_index	  #start changes#	  if @sixframes			pattern = @character.pattern+1 #I had to do this, this way, so that the		#animation doesn't do back to the second frame after visiting the third.		#The '+1" Allows it to skip over the first frame, the standing still		#frame		sx = (index % 4 * 9 + pattern) * @cw	  else		pattern = @character.pattern < 3 ? @character.pattern : 1		sx = (index % 4 * 3 + pattern) * @cw	  end	  sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch	  self.src_rect.set(sx, sy, @cw, @ch)	end  endendclass Game_CharacterBase	    #--------------------------------------------------------------------------  # * Update Animation Pattern  #  # Thera's notes: Update Animation Pattern makes sure that a character cycles  # through it's sprite animation. Again, it first checks the filename before  # applying operations.  # The @pattern variable if very important when editing sprite animation.  # Thus I edited basically any instance of it being modified when making this  # script.  #--------------------------------------------------------------------------  def update_anime_pattern	if @character_name[0, 1] == '%'	if !@step_anime && @stop_count > 0		@original_pattern = -1		@pattern = @original_pattern	  else		@pattern = (@pattern + 1) % 8		#Changed it to 8 here because we want to have an 8 frame animation.	  end	else  	if !@step_anime && @stop_count > 0	  @original_pattern = 1	  @pattern = @original_pattern	else	  @pattern = (@pattern + 1) % 4	end	end  end  # Thera's notes: I actually don't know what straighten position is supossed to  # do exactly, but as it was modifying the @pattern variable, I decided to  # adapt it to this script's standards.  def straighten	if @character_name[0, 1] == '%'	@pattern = -1 if @walk_anime || @step_anime	@anime_count = 0  	else  	  @pattern = 1 if @walk_anime || @step_anime	  @anime_count = 0	end  end  # Similar as with straighten, I adapted this one because of the appearance of  # the @original_pattern variable.  def set_graphic(character_name, character_index)	@tile_id = 0	@character_name = character_name	@character_index = character_index	#changed from 1 to -1	if @character_name[0, 1] == '%'	@original_pattern = -1	else	@original_pattern = 1	end	#end change  endendclass Game_Event < Game_Character#--------------------------------------------------------------------------  # * Set Up Event Page Settings  #  # Thera's notes: This sets up the event with all the parameters defined in  # the event page in the editor. I chenged the part where the character graphic  # was set up, because otherwise it would default to the second frame when  # character were standing still.  #--------------------------------------------------------------------------  def setup_page_settings	@tile_id		  = @page.graphic.tile_id	@character_name   = @page.graphic.character_name	@character_index  = @page.graphic.character_index	if @original_direction != @page.graphic.direction	  @direction		  = @page.graphic.direction	  @original_direction = @direction	  @prelock_direction  = 0	end	if @character_name[0, 1] == '%'	if @original_pattern != @page.graphic.pattern	  @pattern			= @page.graphic.pattern	  @original_pattern   = -1	end	else	if @original_pattern != @page.graphic.pattern	  @pattern			= @page.graphic.pattern	  @original_pattern   = @pattern	end	end	@move_type		  = @page.move_type	@move_speed		 = @page.move_speed	@move_frequency	 = @page.move_frequency	@move_route		 = @page.move_route	@move_route_index   = 0	@move_route_forcing = false	@walk_anime		 = @page.walk_anime	@step_anime		 = @page.step_anime	@direction_fix	  = @page.direction_fix	@through			= @page.through	@priority_type	  = @page.priority_type	@trigger			= @page.trigger	@list			   = @page.list	@interpreter = @trigger == 4 ? Game_Interpreter.new : nil  endend
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
You would have to alter how each combination of row + column is worked out, which is a lot of editing script-wise. Like for example there's a Holder Battler script that can set a custom amount of columns to animate per row, allowing for more lengthy animations instead of a strict 4x14, (column X row) One animation line can be 6x1 while another can be 8x1 while another can be default 4x1, the whole sheet being 8x14

So it's definitely possible.

Edit: yeah as Shaz mentioned each cell still needs to be the same size.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Please post a LINK to the script. If you show us where you got it, we can also read the creator's notes and discussion that he/she has had with other people using the script, as well as any screenshots or explanatory images they might have provided.


Your spritesheet is not set up for ANY Ace format. Ace requires ALL cells to be the same width and height, even if it means a narrow sprite has a lot of transparency around it because one of the others in the same column is quite wide.


You need to redo your spritesheet to fit the Ace format. Specifically the format required by that script.
 
Last edited by a moderator:

deathsia

Pegisister
Veteran
Joined
Feb 26, 2014
Messages
648
Reaction score
55
First Language
English
Primarily Uses
Please post a LINK to the script. If you show us where you got it, we can also read the creator's notes and discussion that he/she has had with other people using the script, as well as any screenshots or explanatory images they might have provided.

Your spritesheet is not set up for ANY Ace format. Ace requires ALL cells to be the same width and height, even if it means a narrow sprite has a lot of transparency around it because one of the others in the same column is quite wide.

You need to redo your spritesheet to fit the Ace format. Specifically the format required by that script.
I don't know how havign the link will help much speaking as they don't provide much info but okay here it is: http://www.rpgmakervxace.net/topic/1958-9x4-sprite-bases/
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Well, THIS is useful and you didn't tell us anything about it:

Just insert the code above main and under the rest(above the 'insert here' spot). It may not be fully compatible with other scripts, but your multiple animation sprites should work alongside the rtp-format sprites. In that case you might want to get someone with some experience in RSS to take a look at it.


It's made so that it only work this way on files which start with "%", so make sure all files that are arranged in this format(standing sprite and then an 8 frame walk animation) have names that start with "%".


There's still a minor bug with the animation when setting an event to walk backward, but I'm fixing that.
And the sprites included in that post are also confirmation that the script was made with the standard RTP "all frames must be the same size" requirement.


So there's a couple of useful things I got just from the first post in that thread. I haven't even started to look through the comments yet, which are likely to cover some interesting points as well :) Yes, a scripter COULD just read through the script and eventually figure that out themselves, but I wouldn't want to spend half an hour trying to decipher a script someone else wrote just so I could help someone, when they could point me to a thread that spells it all out clearly.


Look at it this way ... if you're not a scripter, you're not in a position to say what information is important and what isn't, so it's better to provide more than enough, than not enough (assume it's ALL important). And if you WERE in a position to say what's important and what isn't, you wouldn't need help ;)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
I don't know how havign the link will help much speaking as they don't provide much info but okay here it is: http://www.rpgmakervxace.net/topic/1958-9x4-sprite-bases/
Getting a look at the correctly set up sprites there instead of the ones you provided above did help ;-)
There is no fixed pixel size for the sprites, as with all sprites the spritesize depends on a regular grid for all used pictures.


Your side-walking variants need a size of 64x64 pixels. That means that ALL elements of the sprite have to use a grid of 64x64 pixels.


The fact that your front-walking pictures only need 32x64 pixels does not change the fact that for the spritesheet, they need to fit into a 64x64 grid.


Make a template with a 64x64 grid - in a 9x4 sheet, that sums up to a image size of 576x256 pixels.


Then distribute the single sprite pictures into that grid, placing the front view pictures in the center of their (much bigger) grid cells.


The resulting spritesheet will then work.
 

deathsia

Pegisister
Veteran
Joined
Feb 26, 2014
Messages
648
Reaction score
55
First Language
English
Primarily Uses
Close the thread, I figured out how to format my image by doing a few google searches, everything works now.

Sorry to waste time, if I had figured this out from the get-go I would have not bothered to make this thread.
 

deathsia

Pegisister
Veteran
Joined
Feb 26, 2014
Messages
648
Reaction score
55
First Language
English
Primarily Uses
Getting a look at the correctly set up sprites there instead of the ones you provided above did help ;-)

There is no fixed pixel size for the sprites, as with all sprites the spritesize depends on a regular grid for all used pictures.

Your side-walking variants need a size of 64x64 pixels. That means that ALL elements of the sprite have to use a grid of 64x64 pixels.

The fact that your front-walking pictures only need 32x64 pixels does not change the fact that for the spritesheet, they need to fit into a 64x64 grid.

Make a template with a 64x64 grid - in a 9x4 sheet, that sums up to a image size of 576x256 pixels.

Then distribute the single sprite pictures into that grid, placing the front view pictures in the center of their (much bigger) grid cells.

The resulting spritesheet will then work.
 I figured this out shorttly before you made this post. but thank you for the help!
 
Last edited by a moderator:

deathsia

Pegisister
Veteran
Joined
Feb 26, 2014
Messages
648
Reaction score
55
First Language
English
Primarily Uses
Well, THIS is useful and you didn't tell us anything about it:

And the sprites included in that post are also confirmation that the script was made with the standard RTP "all frames must be the same size" requirement.

So there's a couple of useful things I got just from the first post in that thread. I haven't even started to look through the comments yet, which are likely to cover some interesting points as well :) Yes, a scripter COULD just read through the script and eventually figure that out themselves, but I wouldn't want to spend half an hour trying to decipher a script someone else wrote just so I could help someone, when they could point me to a thread that spells it all out clearly.

Look at it this way ... if you're not a scripter, you're not in a position to say what information is important and what isn't, so it's better to provide more than enough, than not enough (assume it's ALL important). And if you WERE in a position to say what's important and what isn't, you wouldn't need help ;)
Fair point. I sometimes let my very limited scripting knowledge go to my head and think the solutions are easy as long as I get some help and don't think providing links is nessary if i provide enough details. my bad. ^^;
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
deathsia, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Just edit your last post instead of posting several times in a row. If you want to quote different people, check out the MultiQuote button :)


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,074
Members
137,578
Latest member
JamesLightning
Top