Creation Asylum Banner

Welcome Guest ( Log In | Register )

"A quote is not a story. Try to make it 3 lines or less..."

Dubealex

Check out the site too!

Quick Jump: The AsylumV | EntertainmentV | Game MakingV | Creative ForumV | Technology & ComputersV | TranslationsV

 
Reply to this topicStart new topic
> CharSet Frame Change, Use this code if you have a CharSet that uses more than 4 frames.
XeroVolume
post Oct 22 2006, 11:57 PM
Post #1


Newbie
Group Icon


Newbie

Member No.: 5,050
Joined: 17-October 06
Posts: 20
-->
From: Texas

RPG Maker Level:
Getting good

Class Title:
Spriter, Ripper, Learning RGSS



CharSet Frame Change

Use this code if you have a CharSet that uses more than 4 frames for animation.

Features:

Allows loading of CharSets being of any column width, such as that of 8-frame movement characters.

Usage:

If you do not wish to use the default 4 frames movement, place "w_x" within the filename of the CharSet to be used. "x" represents the number of frames being used. For example:

"hero2 w_8.png" might be the name of a CharSet that uses 8 frames for movement.

Installation:

Apply the edits found in the sections below.



Game_Character 1

Add on line 28, after attr_accessor: transparent
CODE
#-------------Edit-----------------------------Edit-----------------------------Edit----------------
attr_accessor :charset_tile_width          # Amount of frames, i.e. columns of characters in the charset.
#-------------Edit-----------------------------Edit-----------------------------Edit----------------



Game_Character 2

Replace @pattern = (@pattern + 1) % 4 (should be line 31) with:
CODE
#-------------Edit-----------------------------Edit-----------------------------Edit----------------
# Pattern is the current movement frame (i.e. column) the character is currently on.
@pattern = (@pattern + 1) % @charset_tile_width
#-------------Edit-----------------------------Edit-----------------------------Edit----------------

Replace @character_name = command.parameters[0] (should be line 323) with:
CODE
#-------------Edit-----------------------------Edit-----------------------------Edit----------------
#Def: @character_name = command.parameters[0]
set_charset command.parameters[0]
#-------------Edit-----------------------------Edit-----------------------------Edit----------------




Game_Event

Replace @character_name = actor.character_name (should be line 141) with:
CODE
#-------------Edit-----------------------------Edit-----------------------------Edit----------------
#def: @character_name = @page.graphic.character_name
set_charset @page.graphic.character_name
#-------------Edit-----------------------------Edit-----------------------------Edit----------------



Game_Player

Replace @character_name = actor.character_name (should be line 106) with:
CODE
#-------------Edit-----------------------------Edit-----------------------------Edit----------------
#Def: @character_name = actor.character_name
# Update character name, auto sets tile width.
set_charset actor.character_name
#-------------Edit-----------------------------Edit-----------------------------Edit----------------



Sprite_Character

Replace @cw = bitmap.width / 4 (should be line 47) with:
CODE
#-------------Edit-----------------------------Edit-----------------------------Edit----------------
# def: @cw = bitmap.width / 4
@cw = bitmap.width / @character.charset_tile_width
#-------------Edit-----------------------------Edit-----------------------------Edit----------------



Now add a new class after Game_Character 3 called Game_Character_CFC

Paste this into it:
CODE
class Game_Character
  #--------------------------------------------------------------------------
  # Reads the name of the charset to determine the tile width of the
  # character.
  #--------------------------------------------------------------------------
  def set_charset(charname)
    @character_name=charname
    # Default tile width.
    @charset_tile_width = 4
    charname.gsub(/w\_(\d+)/) {@charset_tile_width = $1.to_i}
  end
end


*NOTE*

I did not write this script!!! Sorry, but I don't know who the original author is. That being said, if anyone recognizes this or knows who wrote it, please let me know so I can give them the credit they deserve!!!

P.S. This is my first script post. How'd I do?

This post has been edited by XeroVolume: Oct 23 2006, 12:00 AM



Userbars

Now what?

Thanks

Go to the top of the page
 
+Quote Post
samamanjaro
post Nov 10 2006, 06:49 AM
Post #2


X-Treme
Group Icon


X-Treme

Member No.: 4,537
Joined: 25-August 06
Posts: 266
-->
From: Australia

RPG Maker Level:
Good

Class Title:
Writer, Mapper, Wannabe Spriter, Artist



Could you please post a demo?



What SephirothSpawn really said:
QUOTE
@dragonslayer: lmao. Coming from you, that is about like me saying that scripting is pointless.

My Contributations to CA:
Smithing and Lockpicking System - Event v1.1
Addon Update Script System BETA - Script
Project - Necromancers Moon - Last Update 20th October 2006

Tutorials

My Email is: sam.lockart@gmail.com
Click me!
Deviant ~samamanjaro
Go to the top of the page
 
+Quote Post
Myonosken
post Nov 10 2006, 11:04 AM
Post #3


Member
Group Icon


Member

Member No.: 4,730
Joined: 17-September 06
Posts: 54
-->

RPG Maker Level:
Expert

Class Title:
Writer, Eventing, Non-Pixel Graphics, Basic Scripting



These have been around for a while...but an SDK version biggrin.gif.
Go to the top of the page
 
+Quote Post
Samo
post Nov 16 2006, 01:05 PM
Post #4


Expert
Group Icon


Expert

Member No.: 5,001
Joined: 13-October 06
Posts: 160
-->
From: From Argentina, Mar del Plata

RPG Maker Level:
Master

Class Title:
C++ Coder

Country:



Demo Please. Bugs



I´ve done many, many scripts, but no one can be at the height of this Engine, the Advanced Real Time Battle System gives a new look to RMXP, and you must have it...

http://www.creationasylum.net/index.php?sh...mp;#entry192656
Go to the top of the page
 
+Quote Post
Dirtie
post Mar 21 2007, 07:22 AM
Post #5


Newbie
Group Icon


Newbie

Member No.: 175
Joined: 16-January 05
Posts: 2
-->

RPG Maker Level:
Getting good

Class Title:
Giant Monkey



If you're looking for someone to credit this script to, I do believe it is Fuso (if you've been around awhile you should remember him from the RMXP.net days). If you have a look at the Zelda Engine demo, it uses this particular script and attributes it to him. :)

This post has been edited by Dirtie: Mar 21 2007, 06:50 PM
Go to the top of the page
 
+Quote Post
Samo
post Apr 5 2007, 12:47 PM
Post #6


Expert
Group Icon


Expert

Member No.: 5,001
Joined: 13-October 06
Posts: 160
-->
From: From Argentina, Mar del Plata

RPG Maker Level:
Master

Class Title:
C++ Coder

Country:



I think i can do this script in one to evitate this methods of replacing. You know, aliasing methods. I will give the credits a little to me and all to that author.



I´ve done many, many scripts, but no one can be at the height of this Engine, the Advanced Real Time Battle System gives a new look to RMXP, and you must have it...

http://www.creationasylum.net/index.php?sh...mp;#entry192656
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:

 



- The Staff Team Lo-Fi Version Time is now: 3rd September 2010 - 03:05 AM


Affiliated Sites: