iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!
9 Pages V   1 2 3 > »   
Reply to this topicStart new topic
> Catterpillar Script, Get members of your party to follow you!
Rating 4 V
RidgeVortex
post Jun 18 2008, 07:45 PM
Post #1



Group Icon


Type: Undisclosed




I did not make this! I am placing here because many people will find it useful.
QUOTE (woratana)
This script is originally by Trickster.
And ported to VX by Diedrupo.


This Lets people in your party follow you around!

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###########
###########
###########


Instructions: Place above main!


This post has been edited by MrAnonymous: Jul 24 2008, 03:08 PM
Reason for edit: Credit to the author!


--------------------
Currently playing: Sitar hero 3
Current RMVX Game: Dark Knight
Go to the top of the page
 
+Quote Post
   
Blank
post Jun 18 2008, 11:23 PM
Post #2


Lord o' Death <BLANK>
Group Icon


Type: Designer




lol, KGC, also this script isnt compatible by itself ya know... you need 4 others i think.


--------------------
Go to the top of the page
 
+Quote Post
   
fmjpr
post Jun 18 2008, 11:53 PM
Post #3



Group Icon


Type: Writer
Alignment: Chaotic Neutral




You shouldn't post anything without crediting the original creator. People look down on that. And if this is KGC, then it has been posted already and is probably in the KGC scripts library at the least.


--------------------
Trailer for It Came From Yesterday: Click Me

This was made by a dear friend of mine. Any support is appreciated! Also, Like the Facebook page while you're at it: It Came From Yesterday

New and improved official site: ICFY

Swagbucks referral link: http://www.swagbucks.com/refer/jbart321
Go to the top of the page
 
+Quote Post
   
RidgeVortex
post Jun 19 2008, 05:16 AM
Post #4



Group Icon


Type: Undisclosed




I said this was not mine. I don't know who made it.
Anyway this one works on its own. You don't need any other scripts.

Actually i think this is a different one to KGC. Blank said you need 4 but on this one you need only one.

I will check who made it, but this was found in a really old game i made.

This post has been edited by RidgeVortex: Jun 19 2008, 05:19 AM


--------------------
Currently playing: Sitar hero 3
Current RMVX Game: Dark Knight
Go to the top of the page
 
+Quote Post
   
woratana
post Jun 19 2008, 09:42 AM
Post #5


*O* ~(>_<)~
Group Icon


Type: Coder




This script is originally by Trickster.
And ported to VX by Diedrupo.

http://www.rpgrevolution.com/forums/?showtopic=8040


--------------------
Check out my new blog!!!

Go to the top of the page
 
+Quote Post
   
RidgeVortex
post Jun 19 2008, 03:42 PM
Post #6



Group Icon


Type: Undisclosed




Thanks for finding the creator Woratana. =)


--------------------
Currently playing: Sitar hero 3
Current RMVX Game: Dark Knight
Go to the top of the page
 
+Quote Post
   
Blank
post Jun 19 2008, 06:00 PM
Post #7


Lord o' Death <BLANK>
Group Icon


Type: Designer




lol, I said I think there were 4 others. For example Also im pretty sure it wont work without KGC_InterfaceForWin32API script. Im not home to test ti right now.


--------------------
Go to the top of the page
 
+Quote Post
   
sargunster
post Jun 20 2008, 03:13 PM
Post #8



Group Icon


Type: Undisclosed




ok...
i copied the script, and put it above main, but it came up as one big line
could you post a demo so i can copy it from there?
Go to the top of the page
 
+Quote Post
   
Blank
post Jun 20 2008, 06:45 PM
Post #9


Lord o' Death <BLANK>
Group Icon


Type: Designer




copy it into a text file first then to the script database. I think that should work.


--------------------
Go to the top of the page
 
+Quote Post
   
sargunster
post Jun 20 2008, 06:47 PM
Post #10



Group Icon


Type: Undisclosed




ok ill try
EDIT: YAY!!! laugh.gif
and it works without that script you were talking about

This post has been edited by sargunster: Jun 20 2008, 07:05 PM
Go to the top of the page
 
+Quote Post
   
RidgeVortex
post Jun 20 2008, 07:11 PM
Post #11



Group Icon


Type: Undisclosed




Hehe! Im sure that this script is very useful, especially because you only need one script.


--------------------
Currently playing: Sitar hero 3
Current RMVX Game: Dark Knight
Go to the top of the page
 
+Quote Post
   
Blank
post Jun 20 2008, 07:36 PM
Post #12


Lord o' Death <BLANK>
Group Icon


Type: Designer




Guess your right. eh, sorry for the hassle. I cant just install any old program at my cousins house so I really didnt know. Anyways i guess its okay since Mr.A made a topic for all the scripts he translated until he compiled the KGC Library with TouchFuzzy and he didnt make a topic for this so yeah.


--------------------
Go to the top of the page
 
+Quote Post
   
jim42
post Jun 27 2008, 02:06 PM
Post #13


*burp* I eat lurkers...
Group Icon






Works perfectly! Thank you very much! rolleyes.gif biggrin.gif


--------------------
p.s why not have a look at the demo for my game while your at it?

Cheers

jim42


--------------------

OMG! Granny Gave me Cookies!!!
» Click to show Spoiler - click again to hide... «


Go to the top of the page
 
+Quote Post
   
Cadaboo
post Jun 27 2008, 08:57 PM
Post #14



Group Icon


Type: Designer




Anyone know how to make this work so it doesn't freeze your game whenever someone leaves your party?
Go to the top of the page
 
+Quote Post
   
raeta1
post Jun 28 2008, 08:02 PM
Post #15



Group Icon






I need help when i copy and paste it's just one long line
Go to the top of the page
 
+Quote Post
   
Kirbysuperstar
post Jun 29 2008, 05:59 AM
Post #16



Group Icon






QUOTE (raeta1 @ Jun 29 2008, 06:58 AM) *
I need help when i copy and paste it's just one long line


Perhaps try reading the posts above.
Go to the top of the page
 
+Quote Post
   
fmjpr
post Jun 29 2008, 06:07 AM
Post #17



Group Icon


Type: Writer
Alignment: Chaotic Neutral




QUOTE (raeta1 @ Jun 28 2008, 04:58 PM) *
I need help when i copy and paste it's just one long line


There you go.


--------------------
Trailer for It Came From Yesterday: Click Me

This was made by a dear friend of mine. Any support is appreciated! Also, Like the Facebook page while you're at it: It Came From Yesterday

New and improved official site: ICFY

Swagbucks referral link: http://www.swagbucks.com/refer/jbart321
Go to the top of the page
 
+Quote Post
   
ell
post Jun 29 2008, 01:25 PM
Post #18


Ell
Group Icon






Just copy into word then into rpgmaker then it works.
Go to the top of the page
 
+Quote Post
   
jim42
post Jun 30 2008, 07:41 PM
Post #19


*burp* I eat lurkers...
Group Icon






QUOTE (Cadaboo @ Jun 27 2008, 10:53 PM) *
Anyone know how to make this work so it doesn't freeze your game whenever someone leaves your party?


I have just tried this in my own game, and I have no trouble whatever when I remove a party member. Maybe you have copied and pasted the script incorrectly?


--------------------
p.s why not have a look at the demo for my game while your at it?

Cheers

jim42


--------------------

OMG! Granny Gave me Cookies!!!
» Click to show Spoiler - click again to hide... «


Go to the top of the page
 
+Quote Post
   
Blank
post Jul 1 2008, 01:57 AM
Post #20


Lord o' Death <BLANK>
Group Icon


Type: Designer




No to add a member to the catepiller or remove them from it you must use remove or add character twice.

EX:

Effect Removes from Line:
Remove Actor 01

Effect Both removes and removes from party
Remove Actor 01
Remove Actor 01

Vice A Versa for adding, at least this is how the KGC Version works as far as I know or something of the sort.

This post has been edited by Blank: Jul 1 2008, 02:07 AM


--------------------
Go to the top of the page
 
+Quote Post
   

9 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: 29th July 2014 - 03:56 PM

RPGMakerVX.net is an Privacy Policy, Legal.