Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

11 Pages V   1 2 3 > »   
Reply to this topicStart new topic
> RMVX Caterpillar Script
Diedrupo
post Jan 19 2008, 01:55 PM
Post #1


Level 10
Group Icon

Group: Revolutionary
Posts: 150
Type: Event Designer
RM Skill: Undisclosed




This is a quick modification of Trickster's caterpillar script to make it work in RMVX. Just copy and paste and add somewhere above Main.
UPDATE: I have updated the script to fix the dash problem.

CODE

class Game_Player
#--------------------------------------------------------------------------
# * Move Down
# turn_enabled : a flag permits direction change on that spot
#--------------------------------------------------------------------------
def move_down(turn_enabled = true)
super(turn_enabled)
end
#--------------------------------------------------------------------------
# * Move Left
# turn_enabled : a flag permits direction change on that spot
#--------------------------------------------------------------------------
def move_left(turn_enabled = true)
super(turn_enabled)
end
#--------------------------------------------------------------------------
# * Move Right
# turn_enabled : a flag permits direction change on that spot
#--------------------------------------------------------------------------
def move_right(turn_enabled = true)
super(turn_enabled)
end
#--------------------------------------------------------------------------
# * Move up
# turn_enabled : a flag permits direction change on that spot
#--------------------------------------------------------------------------
def move_up(turn_enabled = true)
super(turn_enabled)
end
#--------------------------------------------------------------------------
# * Move Lower Left
#--------------------------------------------------------------------------
def move_lower_left
super
end
#--------------------------------------------------------------------------
# * Move Lower Right
#--------------------------------------------------------------------------
def move_lower_right
super
end
#--------------------------------------------------------------------------
# * Move Upper Left
#--------------------------------------------------------------------------
def move_upper_left
super
end
#--------------------------------------------------------------------------
# * Move Upper Right
#--------------------------------------------------------------------------
def move_upper_right
super
end
end

class Game_Follower < Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :actor
attr_accessor :move_speed
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super()
@through = true
@actor = actor
end
#--------------------------------------------------------------------------
# * Set Actor
#--------------------------------------------------------------------------
def actor=(actor)
@actor = actor
setup
end
#--------------------------------------------------------------------------
# * Setup
#--------------------------------------------------------------------------
def setup
if @actor != nil
@character_name = $game_actors[@actor].character_name
@character_index = $game_actors[@actor].character_index
else
@character_name = ""
@character_index = 0
end
@opacity = 255
@blend_type = 0
@priority_type = 0
end

#--------------------------------------------------------------------------
# * Screen Z
#--------------------------------------------------------------------------
def screen_z
if $game_player.x == @x and $game_player.y == @y
return $game_player.screen_z - 1
end
super
end
#--------------------------------------------------------------------------
# * Same Position Starting Determinant (Disabled)
#--------------------------------------------------------------------------
def check_event_trigger_here(triggers)
result = false
return result
end
#--------------------------------------------------------------------------
# * Front Envent Starting Determinant (Disabled)
#--------------------------------------------------------------------------
def check_event_trigger_there(triggers)
result = false
return result
end
#--------------------------------------------------------------------------
# * Touch Event Starting Determinant (Disabled)
#--------------------------------------------------------------------------
def check_event_trigger_touch(x, y)
result = false
return result
end
end

class Spriteset_Map
alias_method :spriteset_map_create_characters, :create_characters
def create_characters
spriteset_map_create_characters
$game_party.followers.each do |char|
@character_sprites << Sprite_Character.new(@viewport1, char)
end
end
end

class Game_Party
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
MAX_SIZE = 8
CATERPILLAR = 2
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :followers
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_party_initialize, :initialize
def initialize
trick_caterpillar_party_initialize
@followers = Array.new(MAX_SIZE - 1) {Game_Follower.new(nil)}
@move_list = []
end
#--------------------------------------------------------------------------
# * Update Followers
#--------------------------------------------------------------------------
def update_followers
flag = $game_player.transparent || $game_switches[CATERPILLAR]
@followers.each_with_index do |char, i|
char.actor = @actors[i + 1]
char.move_speed = $game_player.move_speed
if $game_player.dash?
char.move_speed += 1
end
char.update
char.transparent = flag
end
end
#--------------------------------------------------------------------------
# * Move To Party
#--------------------------------------------------------------------------
def moveto_party(x, y)
@followers.each {|char| char.moveto(x, y)}
@move_list.clear
end
#--------------------------------------------------------------------------
# * Move Party
#--------------------------------------------------------------------------
def move_party
@move_list.each_index do |i|
if @followers[i] == nil
@move_list[i...@move_list.size] = nil
next
end
case @move_list[i].type
when 2
@followers[i].move_down(*@move_list[i].args)
when 4
@followers[i].move_left(*@move_list[i].args)
when 6
@followers[i].move_right(*@move_list[i].args)
when 8
@followers[i].move_up(*@move_list[i].args)
when 1
@followers[i].move_lower_left
when 3
@followers[i].move_lower_right
when 7
@followers[i].move_upper_left
when 9
@followers[i].move_upper_right
when 5
@followers[i].jump(*@move_list[i].args)
end
end
end
#--------------------------------------------------------------------------
# * Add Move List
#--------------------------------------------------------------------------
def update_move(type, *args)
move_party
@move_list.unshift(Game_MoveListElement.new(type, args))
end
end

class Game_MoveListElement
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(type, args)
@type = type
@args = args
end
#--------------------------------------------------------------------------
# * Type
#--------------------------------------------------------------------------
def type
return @type
end
#--------------------------------------------------------------------------
# * Args
#--------------------------------------------------------------------------
def args
return @args
end
end

class Game_Player
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :move_speed

#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_update, :update
def update
$game_party.update_followers
trick_caterpillar_player_update
end
#--------------------------------------------------------------------------
# * Moveto
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_moveto, :moveto
def moveto(x, y)
$game_party.moveto_party(x, y)
trick_caterpillar_player_moveto(x, y)
end
#--------------------------------------------------------------------------
# * Move Down
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_move_down, :move_down
def move_down(turn_enabled = true)
if passable?(@x, @y+1)
$game_party.update_move(2, turn_enabled)
end
trick_caterpillar_player_move_down(turn_enabled)
end
#--------------------------------------------------------------------------
# * Move Left
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_move_left, :move_left
def move_left(turn_enabled = true)
if passable?(@x-1, @y)
$game_party.update_move(4, turn_enabled)
end
trick_caterpillar_player_move_left(turn_enabled)
end
#--------------------------------------------------------------------------
# * Move Right
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_move_right, :move_right
def move_right(turn_enabled = true)
if passable?(@x+1, @y)
$game_party.update_move(6, turn_enabled)
end
trick_caterpillar_player_move_right(turn_enabled)
end
#--------------------------------------------------------------------------
# * Move Up
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_move_up, :move_up
def move_up(turn_enabled = true)
if passable?(@x, @y-1)
$game_party.update_move(8, turn_enabled)
end
trick_caterpillar_player_move_up(turn_enabled)
end
#--------------------------------------------------------------------------
# * Move Lower Left
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_move_lower_left, :move_lower_left
def move_lower_left
if passable?(@x - 1, @y) and passable?(@x, @y + 1)
$game_party.update_move(1)
end
trick_caterpillar_player_move_lower_left
end
#--------------------------------------------------------------------------
# * Move Lower Right
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_move_lower_right, :move_lower_right
def move_lower_right
if passable?(@x + 1, @y) and passable?(@x, @y + 1)
$game_party.update_move(3)
end
trick_caterpillar_player_move_lower_right
end
#--------------------------------------------------------------------------
# * Move Upper Left
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_move_upper_left, :move_upper_left
def move_upper_left
if passable?(@x - 1, @y) and passable?(@x, @y - 1)
$game_party.update_move(7)
end
trick_caterpillar_player_move_upper_left
end
#--------------------------------------------------------------------------
# * Move Upper Right
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_move_upper_right, :move_upper_right
def move_upper_right
if passable?(@x + 1, @y) and passable?(@x, @y - 1)
$game_party.update_move(9)
end
trick_caterpillar_player_move_upper_right
end
#--------------------------------------------------------------------------
# * Jump
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_jump, :jump
def jump(x_plus, y_plus)
new_x = @x + x_plus
new_y = @y + y_plus
if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y)
$game_party.update_move(5, x_plus, y_plus)
end
trick_caterpillar_player_jump(x_plus, y_plus)
end
end###########
###########
###########


Posted with Trickster's permission. Please give him credit if you use this script (even though I made the RMVX modifications, it is still his work).

Screenshot of it in action:


NOTE: I noticed that the CODEBOX tag messed the formatting of the script up, so I uploaded a text file attachment with the script as well.

This post has been edited by Diedrupo: Feb 23 2008, 04:38 PM
Attached File(s)
Attached File  trick_caterpillarvx.txt ( 13.2K ) Number of downloads: 3907
 
Go to the top of the page
 
+Quote Post
   
jasonicus
post Jan 19 2008, 04:08 PM
Post #2


All Lies Lead to the Truth
Group Icon

Group: Revolutionary
Posts: 1,573
Type: Developer
RM Skill: Advanced




Nice upload, man. I was hoping to see one of these as the first scripts.
Go to the top of the page
 
+Quote Post
   
KaneBlueriver
post Jan 20 2008, 12:56 PM
Post #3



Group Icon

Group: Member
Posts: 1
Type: None
RM Skill: Undisclosed




This may be a little silly question here but when I change the opacity (not the script) for certain events and such. The main character would disappear and the party wouldn't. My question is, am I doing something wrong here?
Go to the top of the page
 
+Quote Post
   
Diedrupo
post Jan 20 2008, 02:08 PM
Post #4


Level 10
Group Icon

Group: Revolutionary
Posts: 150
Type: Event Designer
RM Skill: Undisclosed




QUOTE (KaneBlueriver @ Jan 20 2008, 02:03 PM) *
This may be a little silly question here but when I change the opacity (not the script) for certain events and such. The main character would disappear and the party wouldn't. My question is, am I doing something wrong here?


That's pretty odd, I will try it and see if I can fix it.

As a temporary workaround, if you want to turn on/off the catepillar, you can do it with a switch.
The script right now defaults to switch#2, if you want to change that, look for:

CATERPILLAR = 2

in the code, and change the 2 to whatever switch you want. the switch needs to be on for the followers to disappear.
Be sure to add a call script right after you toggle the switch with:

$game_map.need_refresh = true

This post has been edited by Diedrupo: Jan 20 2008, 03:30 PM
Go to the top of the page
 
+Quote Post
   
SeeYouAlways
post Jan 20 2008, 11:44 PM
Post #5


Demented Moogle
Group Icon

Group: Banned
Posts: 1,130
Type: None
RM Skill: Undisclosed




Looks great, thank you for the script! I will make good use for this because the train of chibi characters is so cute, compared to RPG Maker XP's RTP. pinch.gif


__________________________
Go to the top of the page
 
+Quote Post
   
jasonicus
post Jan 20 2008, 11:57 PM
Post #6


All Lies Lead to the Truth
Group Icon

Group: Revolutionary
Posts: 1,573
Type: Developer
RM Skill: Advanced




I thought the same thing, but I noticed that when you dash the party members don't and it looks kind of odd.
Go to the top of the page
 
+Quote Post
   
Diedrupo
post Jan 21 2008, 04:08 AM
Post #7


Level 10
Group Icon

Group: Revolutionary
Posts: 150
Type: Event Designer
RM Skill: Undisclosed




QUOTE (jasonicus @ Jan 21 2008, 01:04 AM) *
I thought the same thing, but I noticed that when you dash the party members don't and it looks kind of odd.


Yeah, I am going to fix that, don't worry.
Go to the top of the page
 
+Quote Post
   
jasonicus
post Jan 21 2008, 04:21 AM
Post #8


All Lies Lead to the Truth
Group Icon

Group: Revolutionary
Posts: 1,573
Type: Developer
RM Skill: Advanced




Oh, cool.
Go to the top of the page
 
+Quote Post
   
Diedrupo
post Jan 21 2008, 06:15 PM
Post #9


Level 10
Group Icon

Group: Revolutionary
Posts: 150
Type: Event Designer
RM Skill: Undisclosed




Here's the fix for followers not dashing when you do:

CODE

#--------------------------------------------------------------------------
# * Update Followers
#--------------------------------------------------------------------------
def update_followers
flag = $game_player.transparent || $game_switches[CATERPILLAR]
@followers.each_with_index do |char, i|
char.actor = @actors[i + 1]
char.move_speed = $game_player.move_speed
if $game_player.dash?
char.move_speed += 1
end
char.update
char.transparent = flag
end
end


Replace def update_followers in class Game_Party with the one above. I will update the first post accordingly as well.

This post has been edited by Diedrupo: Jan 21 2008, 06:16 PM
Go to the top of the page
 
+Quote Post
   
X-Snake-X
post Jan 22 2008, 11:32 AM
Post #10


Level 6
Group Icon

Group: Member
Posts: 88
Type: Event Designer
RM Skill: Skilled




Very nice Script^^
I might use it wink.gif


__________________________

I'm from Germany o.o
Go to the top of the page
 
+Quote Post
   
jasonicus
post Jan 22 2008, 01:56 PM
Post #11


All Lies Lead to the Truth
Group Icon

Group: Revolutionary
Posts: 1,573
Type: Developer
RM Skill: Advanced




Update works great! Thanks!
Go to the top of the page
 
+Quote Post
   
X-Auron
post Jan 22 2008, 11:50 PM
Post #12



Group Icon

Group: Member
Posts: 1
Type: Artist
RM Skill: Skilled




I copied the script and "glue" in the Editor of Scripts, but an error ocurred: He appears everything in one line
Go to the top of the page
 
+Quote Post
   
Diedrupo
post Jan 23 2008, 12:16 AM
Post #13


Level 10
Group Icon

Group: Revolutionary
Posts: 150
Type: Event Designer
RM Skill: Undisclosed




QUOTE (X-Auron @ Jan 23 2008, 12:57 AM) *
I copied the script and "glue" in the Editor of Scripts, but an error ocurred: He appears everything in one line



Did you place it directly above Main?
Go to the top of the page
 
+Quote Post
   
ss3dj
post Jan 23 2008, 09:21 PM
Post #14


Level 6
Group Icon

Group: Member
Posts: 76
Type: None
RM Skill: Beginner




cool script

This post has been edited by ss3dj: Jan 23 2008, 09:22 PM


__________________________
"NEW YORK, NY. A man was knocked down by a car and got up uninjured, but lay back down in front of the car when a bystander told him to feign injury in order to collect insurance money. The car rolled forward and crushed him to death."
- Associated Press, 1977
Go to the top of the page
 
+Quote Post
   
Wimpy
post Jan 27 2008, 11:10 PM
Post #15


Level 2
Group Icon

Group: Member
Posts: 15
Type: None
RM Skill: Skilled




I love me some caterpillary goodness! happy.gif It works smoothly, and it's SO cute when the characters run around...kinda like a choo-choo train, haha.


__________________________
BACON.
Go to the top of the page
 
+Quote Post
   
X-Snake-X
post Jan 28 2008, 08:47 AM
Post #16


Level 6
Group Icon

Group: Member
Posts: 88
Type: Event Designer
RM Skill: Skilled




Hey I have some problems...
Everytime I add a Third Chara all the Charas are disappearing?
e.g when i have a map with three charas with an add to team thing...
The first chara appears.. But when i recruit another one they all
disappear^^"


__________________________

I'm from Germany o.o
Go to the top of the page
 
+Quote Post
   
Diedrupo
post Jan 28 2008, 09:57 AM
Post #17


Level 10
Group Icon

Group: Revolutionary
Posts: 150
Type: Event Designer
RM Skill: Undisclosed




QUOTE (X-Snake-X @ Jan 28 2008, 09:54 AM) *
Hey I have some problems...
Everytime I add a Third Chara all the Charas are disappearing?
e.g when i have a map with three charas with an add to team thing...
The first chara appears.. But when i recruit another one they all
disappear^^"


That doesn't happen to me. Are you using other scripts? Make sure Caterpillar goes below them.
Go to the top of the page
 
+Quote Post
   
X-Snake-X
post Jan 28 2008, 12:07 PM
Post #18


Level 6
Group Icon

Group: Member
Posts: 88
Type: Event Designer
RM Skill: Skilled




QUOTE (Diedrupo @ Jan 28 2008, 06:04 PM) *
QUOTE (X-Snake-X @ Jan 28 2008, 09:54 AM) *
Hey I have some problems...
Everytime I add a Third Chara all the Charas are disappearing?
e.g when i have a map with three charas with an add to team thing...
The first chara appears.. But when i recruit another one they all
disappear^^"


That doesn't happen to me. Are you using other scripts? Make sure Caterpillar goes below them.


But this will even happen when i only have you script in my game.


__________________________

I'm from Germany o.o
Go to the top of the page
 
+Quote Post
   
Diedrupo
post Jan 28 2008, 01:45 PM
Post #19


Level 10
Group Icon

Group: Revolutionary
Posts: 150
Type: Event Designer
RM Skill: Undisclosed




QUOTE (X-Snake-X @ Jan 28 2008, 01:14 PM) *
QUOTE (Diedrupo @ Jan 28 2008, 06:04 PM) *
QUOTE (X-Snake-X @ Jan 28 2008, 09:54 AM) *
Hey I have some problems...
Everytime I add a Third Chara all the Charas are disappearing?
e.g when i have a map with three charas with an add to team thing...
The first chara appears.. But when i recruit another one they all
disappear^^"


That doesn't happen to me. Are you using other scripts? Make sure Caterpillar goes below them.


But this will even happen when i only have you script in my game.


Can you upload your project somewhere?
Go to the top of the page
 
+Quote Post
   
X-Snake-X
post Jan 28 2008, 04:14 PM
Post #20


Level 6
Group Icon

Group: Member
Posts: 88
Type: Event Designer
RM Skill: Skilled




QUOTE (Diedrupo @ Jan 28 2008, 09:52 PM) *
QUOTE (X-Snake-X @ Jan 28 2008, 01:14 PM) *
QUOTE (Diedrupo @ Jan 28 2008, 06:04 PM) *
QUOTE (X-Snake-X @ Jan 28 2008, 09:54 AM) *
Hey I have some problems...
Everytime I add a Third Chara all the Charas are disappearing?
e.g when i have a map with three charas with an add to team thing...
The first chara appears.. But when i recruit another one they all
disappear^^"


That doesn't happen to me. Are you using other scripts? Make sure Caterpillar goes below them.


But this will even happen when i only have you script in my game.


Can you upload your project somewhere?


Yeah:
http://rapidshare.com/files/87414492/Project3.rar.html
I hope rapidshare is okay.


__________________________

I'm from Germany o.o
Go to the top of the page
 
+Quote Post
   

11 Pages V   1 2 3 > » 
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: 24th May 2013 - 11:36 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker