UltimaForum

Skrypty [VX] - Gąsienica

Ayene - Pon 20 Lip, 2009 19:49
Temat postu: Gąsienica
~ Gąsienica ~

Krótki opis
Skrypt powoduje, że aktualne osoby w drużynie poruszają się gęsiego po mapie (patrz screenshot).

Autor skryptu
Trickster

Tłumaczenie i poprawki
Ayene [yurika@o2.pl]

Kompatybilność
Tylko VX

Skrypt

Spoiler:

Kod:

# =========================================================
# ~ Gąsienica ~
# Data publikacji: 20.07.2009
# Autor: Trickster
# Tłumaczenie i poprawki: Ayene [yurika@o2.pl]
# Zapraszamy na stronę Ultima Forum - http://www.ultimateam.pl
# =========================================================
# Instalacja: Umieść ten skrypt nad Main w Edytorze Skryptu.
# =========================================================
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


# --------------------------- POCZĄTEK SKRYPTU ---------------------------------
module TT
# ---------------------------- POCZĄTEK EDYCJI ---------------------------------   
  # ID przełącznika, dzięki któremu można wyłączyć gąsienicę w dowolnym momencie
  # gry. Przełącznik ON - wyłącza gąsienice, OFF - ponownie włącza.
  ID_PRZEŁĄCZNIKA_GĄSIENICA = 2
 
  # maksymalna ilość osób w gąsienicy (domyślnie - 4, czyli maksymalna ilość
  # bohaterów w drużynie)
  MAKSYMALNA_DŁUGOŚĆ = 4     
# ----------------------------- KONIEC EDYCJI ----------------------------------
end 


# -----------NIE EDYTUJ PONIŻEJ, CHYBA ŻE WIESZ CO ROBISZ ^^--------------------
class Game_Player
#--------------------------------------------------------------------------
# * W dół
#--------------------------------------------------------------------------
def move_down(turn_enabled = true)
super(turn_enabled)
end
#--------------------------------------------------------------------------
# * W lewo
#--------------------------------------------------------------------------
def move_left(turn_enabled = true)
super(turn_enabled)
end
#--------------------------------------------------------------------------
# * W prawo
#--------------------------------------------------------------------------
def move_right(turn_enabled = true)
super(turn_enabled)
end
#--------------------------------------------------------------------------
# * W górę
#--------------------------------------------------------------------------
def move_up(turn_enabled = true)
super(turn_enabled)
end
#--------------------------------------------------------------------------
# * W dolne lewo
#--------------------------------------------------------------------------
def move_lower_left
super
end
#--------------------------------------------------------------------------
# * W dolne prawo
#--------------------------------------------------------------------------
def move_lower_right
super
end
#--------------------------------------------------------------------------
# * W górne lewo
#--------------------------------------------------------------------------
def move_upper_left
super
end
#--------------------------------------------------------------------------
# * W górne prawo
#--------------------------------------------------------------------------
def move_upper_right
super
end
end

class Game_Follower < Game_Character
#--------------------------------------------------------------------------
# * Przykładowe zmienne
#--------------------------------------------------------------------------
attr_reader :actor
attr_accessor :move_speed
#--------------------------------------------------------------------------
# * Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(actor)
super()
@through = true
@actor = actor
end
#--------------------------------------------------------------------------
# * Ustawienie bohatera
#--------------------------------------------------------------------------
def actor=(actor)
@actor = actor
setup
end
#--------------------------------------------------------------------------
# * Ustawienia
#--------------------------------------------------------------------------
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 = 1
end
#--------------------------------------------------------------------------
# * Ekran Z
#--------------------------------------------------------------------------
def screen_z
if $game_player.x == @x and $game_player.y == @y
return $game_player.screen_z - 1
end
super
end
#--------------------------------------------------------------------------
# * Determinanty określonych zdarzeń
#--------------------------------------------------------------------------
def check_event_trigger_here(triggers)
result = false
return result
end

def check_event_trigger_there(triggers)
result = false
return result
end

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
#-------------------------------------------------------------------------- 
# * Przykładowe zmienne
#--------------------------------------------------------------------------
attr_reader :followers
#--------------------------------------------------------------------------
# * Rozpoczęcie
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_party_initialize, :initialize
def initialize
trick_caterpillar_party_initialize
@followers = Array.new(TT::MAKSYMALNA_DŁUGOŚĆ - 1) {Game_Follower.new(nil)}
@move_list = []
end
#--------------------------------------------------------------------------
# * Aktualizacja podążających
#--------------------------------------------------------------------------
def update_followers
flag = $game_player.transparent || $game_switches[TT::ID_PRZEŁĄCZNIKA_GĄSIENICA]
@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
#--------------------------------------------------------------------------
# * Przesuń w kierunku drużyny
#--------------------------------------------------------------------------
def moveto_party(x, y)
@followers.each {|char| char.moveto(x, y)}
@move_list.clear
end
#--------------------------------------------------------------------------
# * Przesuń drużynę
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * Dodaj listę ruchów
#--------------------------------------------------------------------------
def update_move(type, *args)
move_party
@move_list.unshift(Game_MoveListElement.new(type, args))
end
end

class Game_MoveListElement
#--------------------------------------------------------------------------
# * Rozpoczęcie
#--------------------------------------------------------------------------
def initialize(type, args)
@type = type
@args = args
end
#--------------------------------------------------------------------------
# * Typ
#--------------------------------------------------------------------------
def type
return @type
end
#--------------------------------------------------------------------------
# * Argumenty
#--------------------------------------------------------------------------
def args
return @args
end
end

class Game_Player
#--------------------------------------------------------------------------
# * Przykładowe zmienne
#--------------------------------------------------------------------------
attr_reader :move_speed
#--------------------------------------------------------------------------
# * Aktualizacja
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_update, :update
def update
$game_party.update_followers
trick_caterpillar_player_update
end
#--------------------------------------------------------------------------
# * Przesuń do
#--------------------------------------------------------------------------
alias_method :trick_caterpillar_player_moveto, :moveto
def moveto(x, y)
$game_party.moveto_party(x, y)
trick_caterpillar_player_moveto(x, y)
end
#--------------------------------------------------------------------------
# * W dół
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * W lewo
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * W prawo
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * W górę
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * W dolne lewo
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * W dolne prawo
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * W górne lewo
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * W górne prawo
#--------------------------------------------------------------------------
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
#--------------------------------------------------------------------------
# * Skok
#--------------------------------------------------------------------------
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
# --------------------------- KONIEC SKRYPTU -----------------------------------



Demo
niepotrzebne

Screenshot


Instrukcja
1. Wklej skrypt nad "Main" w Edytorze Skryptu.
2. Reszta instrukcji znajduje się w treści skryptu.

Piszcie w razie problemów.

Cyklop - Czw 17 Wrz, 2009 07:38

postanowiłem skorzystac z gąsienicy ale mam mały problem.
Da radę wyłaczyc ją w trakcie gry bo nie za bardzo mi pasuje w niektórych momentach. widzę że jest jakiś przełacznik ale robię tak jak napisane i nie wychodzi.

SaE - Czw 17 Wrz, 2009 07:59

To proste, dajesz odpowiednie zdarzenie, potem control switches na stronie pierwszej i ustawiasz przełącznik nr 2 (bo taki jest domyślny w skrypcie z gąsienicą) najlepiej to nazwij go sobie jakoś np gąsienica. Dodatkowo ustaw czy ma być ON czy OFF, a w skrypcie jest napisane:
Kod:
  # ID przełącznika, dzięki któremu można wyłączyć gąsienicę w dowolnym momencie
  # gry. Przełącznik ON - wyłącza gąsienice, OFF - ponownie włącza.
  ID_PRZEŁĄCZNIKA_GĄSIENICA = 2

Valdali - Sro 14 Kwi, 2010 14:23

mam pytanie. czy jak ktoś zginie w drużynie to w gąsienicy dalej jest?
Piotro888 - Sob 26 Mar, 2011 12:22

Tak dalej w niej jest.
karajakatak - Wto 07 Cze, 2011 16:17

//Post powinien wyglądać tak:
To jest bez sensu! Nie umiem tego wkleić! Mam spolszczoną wersję i najlepiej by było, jakby to się samo instalowało, czy coś! Jak to wkleić? ;-(
//Post NIE powinien wyglądać tak:
Spoiler:

To jest bez sensu! NIE UMIEM TEGO WKLEIĆ! MAM SPOLSZCZONĄ WERSJĘ I NAJLEPIEJ BY BYŁO JAKBY TO SIE SAMO INSTALOWAŁO CZY COŚ! JAK TO WKLEIĆ? ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-( ;-(


Angius - Wto 07 Cze, 2011 16:33

Nie pisz wielkimi literami i nie pisz posta pod postem, to najlepsza droga do warna.
I poczytaj http://www.ultimateam.pl/viewtopic.php?t=2833

Amelanduil - Wto 07 Cze, 2011 16:47

karajakatak napisa/a:
najlepiej by było, jakby to się samo instalowało, czy coś!


Boże, widzisz i nie grzmisz...
Samemu NIGDY się nic nie zrobi xP To sprzeczne z prawami fizyki, chemii, wrzechświata i wszelkimi innymi prawami ^^
karajakatak napisa/a:
Jak to wkleić?

F11, Ctrl + C , Ctrl + V... no nie rozumiem po co ludzie pchają się na forumy bez spróbowania nawet minimalnego ogarnięcia programu X.x

Ayene - Wto 07 Cze, 2011 17:11

karajakatak, jeśli nie potrafisz dodawać skryptów skorzystaj z tego samouczka :arrow: http://www.ultimateam.pl/viewtopic.php?t=1896
SzymonKorgol - Wto 17 Sty, 2012 22:06

Mi to w ogóle nie działa!
Dałem na początku dwie osoby w drużynie, wchodzę na grę i nic!
Nie działa!

Finwe - Sro 18 Sty, 2012 09:43

@UP
Hmmm... A wrzuciłeś wgl. ten skrypt?
A jak tak to powiedz jakie masz jeszcze
skrypty.

Mateusz SSJ8 - Sro 18 Sty, 2012 21:53

Można było to zrobić jak ja zrobiłem ABSa. Używasz klasy, a tam jest przełącznik odpowiedzialny za wyświetlanie gąsienicy. Wtedy ten skrypt byłby idealny do klona gry "Chrono Trigger" (bądź kontynuacji tejże gry), gdzie przewijają się sekwencje ABS. Wtedy właśnie gąsienica ustawia się na "OFF". Komendy operacji gąsienicą to mogą być "ON" (gąsienica włączona), "OFF" (gąsienica wyłączona), "Auto" (gąsienica włączona poza ABSem).
Aesen - Sob 04 Sie, 2012 17:09

Co zrobić by gąsienica działała z tym skryptem http://rmrk.net/index.php/topic,31076.0.html
Kyovu - Sob 03 Lis, 2012 11:21

4/5 super skrypt.

Powered by phpBB modified by Przemo © 2003 phpBB Group