# PRZEŁĄCZNIK NIWIDZIALNOŚCI
# Kiedy TRANSPARENT_SWITCH jest 'true', po aktywacji tego przełącznika
# bohaterowie w gąsienicy staną się niewidzialni.
TRANSPARENT_SWITCHES_INDEX = 20
# MAKSYMALNA ILOŚĆ BOHATERÓW W DRUŻYNIE
TRAIN_ACTOR_SIZE_MAX = 4
# STAŁE
DOWN_LEFT = 1
DOWN_RIGHT = 3
UP_LEFT = 7
UP_RIGHT = 9
JUMP = 5
end
module Spriteset_Map_Module
def setup_actor_character_sprites?
return @setup_actor_character_sprites_flag != nil
end
def setup_actor_character_sprites(characters)
if !setup_actor_character_sprites?
for character in characters.reverse
@character_sprites.unshift(
Sprite_Character.new(@viewport1, character)
)
end
@setup_actor_character_sprites_flag = true
end
end
end
end
class Spriteset_Map
include Train_Actor::Spriteset_Map_Module
end
module Train_Actor
module Scene_Map_Module
def setup_actor_character_sprites(characters)
@spriteset.setup_actor_character_sprites(characters)
end
end
end
class Scene_Map
include Train_Actor::Scene_Map_Module
end
module Train_Actor
module Game_Party_Module
attr_reader :characters
def actors_dead?
for actor in actors
if actor.dead?
return true
end
end
return false
end
def update_party_order
if not actors_dead?
return actors
end
alive_actors = []
dead_actors = []
for actor in actors
if actor.dead?
dead_actors.push actor
else
alive_actors.push actor
end
end
return alive_actors + dead_actors
end
def setup_actor_character_sprites
if @characters.nil?
@characters = []
for i in 1 ... TRAIN_ACTOR_SIZE_MAX
@characters.push(Game_Party_Actor.new)
end
end
setup_actors = update_party_order
for i in 1 ... TRAIN_ACTOR_SIZE_MAX
@characters[i - 1].setup(setup_actors[i])
end
if $scene.class.method_defined?('setup_actor_character_sprites')
$scene.setup_actor_character_sprites(@characters)
end
end
def update_party_actors
update_party_order
setup_actor_character_sprites
transparent = $game_player.transparent
if transparent == false
if TRANSPARENT_SWITCH
transparent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
end
end
for character in @characters
character.transparent = transparent
character.move_speed = $game_player.move_speed
character.step_anime = $game_player.step_anime
character.update
end
end
def moveto_party_actors( x, y )
setup_actor_character_sprites
for character in @characters
character.moveto( x, y )
end
if @move_list == nil
@move_list = []
end
move_list_setup
end
def move_party_actors
if @move_list == nil
@move_list = []
move_list_setup
end
@move_list.each_index do |i|
if @characters[i] != nil
case @move_list[i].type
when Input::DOWN
@characters[i].move_down(@move_list[i].args[0])
when Input::LEFT
@characters[i].move_left(@move_list[i].args[0])
when Input::RIGHT
@characters[i].move_right(@move_list[i].args[0])
when Input::UP
@characters[i].move_up(@move_list[i].args[0])
when DOWN_LEFT
@characters[i].move_lower_left
when DOWN_RIGHT
@characters[i].move_lower_right
when UP_LEFT
@characters[i].move_upper_left
when UP_RIGHT
@characters[i].move_upper_right
when JUMP
@characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
end
end
end
end
class Move_List_Element
def initialize(type,args)
@type = type
@args = args
end
def type() return @type end
def args() return @args end
end
def move_list_setup
for i in 0 .. TRAIN_ACTOR_SIZE_MAX
@move_list[i] = nil
end
end
def add_move_list(type,*args)
@move_list.unshift(Move_List_Element.new(type,args)).pop
end
def move_down_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::DOWN,turn_enabled)
end
def move_left_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::LEFT,turn_enabled)
end
def move_right_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::RIGHT,turn_enabled)
end
def move_up_party_actors(turn_enabled = true)
move_party_actors
add_move_list(Input::UP,turn_enabled)
end
def move_lower_left_party_actors
move_party_actors
add_move_list(DOWN_LEFT)
end
def move_lower_right_party_actors
move_party_actors
add_move_list(DOWN_RIGHT)
end
def move_upper_left_party_actors
move_party_actors
add_move_list(UP_LEFT)
end
def move_upper_right_party_actors
move_party_actors
add_move_list(UP_RIGHT)
end
def jump_party_actors(x_plus, y_plus)
move_party_actors
add_move_list(JUMP,x_plus, y_plus)
end
end
end
class Game_Party
include Train_Actor::Game_Party_Module
end
def update_party_actors
$game_party.update_party_actors
$game_party.actors.each do |actor|
if actor.dead?
next
end
@character_name = actor.character_name
@character_hue = actor.character_hue
break
end
end
def update
update_party_actors
super
end
def moveto( x, y )
$game_party.moveto_party_actors( x, y )
super( x, y )
end
def move_down(turn_enabled = true)
if passable?(@x, @y, Input::DOWN)
$game_party.move_down_party_actors(turn_enabled)
end
super(turn_enabled)
end
def move_left(turn_enabled = true)
if passable?(@x, @y, Input::LEFT)
$game_party.move_left_party_actors(turn_enabled)
end
super(turn_enabled)
end
def move_right(turn_enabled = true)
if passable?(@x, @y, Input::RIGHT)
$game_party.move_right_party_actors(turn_enabled)
end
super(turn_enabled)
end
def move_up(turn_enabled = true)
if passable?(@x, @y, Input::UP)
$game_party.move_up_party_actors(turn_enabled)
end
super(turn_enabled)
end
def move_lower_left
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
$game_party.move_lower_left_party_actors
end
super
end
def move_lower_right
if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
$game_party.move_lower_right_party_actors
end
super
end
def move_upper_left
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
(passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
$game_party.move_upper_left_party_actors
end
super
end
def move_upper_right
if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
(passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
$game_party.move_upper_right_party_actors
end
super
end
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, 0)
$game_party.jump_party_actors(x_plus, y_plus)
end
super(x_plus, y_plus)
end
end
end
class Game_Player
include Train_Actor::Game_Player_Module
end
module Train_Actor
module Game_Event_Module
def passable?(x, y, d)
result = super(x, y, d)
if result
new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
for actor in $game_party.characters
if not actor.character_name.empty?
if actor.x == new_x and actor.y == new_y
if self != $game_player
return false
end
end
end
end
end
return result
end
end
end
class Game_Event
include Train_Actor::Game_Event_Module
end
To działa i jest dobre ale
np. mam gąsienice i ABS ale jak atakuje stworka to ta druga osoba sobie stoi i czeka dopiero można nią zaatakować kiedy tamta zginie.
Help może jest jakiś skrypt na to?
________________________ http://www.poomoc.pl/
Kilka kliknięć a pomożesz innym!
Czy naprawdę to jest duża strata czasu?
W ten sposób pomożesz innym!
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Nie 25 Kwi, 2010 17:54
Nie ma, to już błąd kompatybilności. ABS, z którego korzystasz zapewne ma już wbudowaną gąsienice (coś podobnego), w której bohaterowie poruszają się w różny sposób - zależny od sytuacji, bo albo idą przy Tobie, albo atakują stwory, albo wracają do Ciebie. Dlatego ten skrypt nie jest wskazany przy ABS'ie.
W Mr.Mo ABS nie ma gąsienicy. Sam kiedyś go używałem.
Co do skryptu to świetny. Na pewno go użyję.
Pzdr.
________________________ ...Amelanduil & FireBlade words will be remembered... ...Amelanduil & FireBlade acts will be remembered... ...Amelanduil & FireBlade never gonna die...
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Wto 27 Kwi, 2010 09:52
HESEE, to w takim razie nic nie poradzę. To taka specyfika skryptu. Osoby do pomocy deklaruje się za pomocą komentarzy...
Faktycznie można zrobić skrypt, który będzie zmieniał kolejność bohaterów w menu, ale to już jest zamówienie. Jeśli chcesz to możesz założyć nowy temat w odpowiednim dziale, a wtedy na pewno ktoś taki skrypt napisze albo poda linka do gotowca.
Da rade jakoś skonfigurować tą gąsienice ponieważ mam ring menu i jak kliknę esc to postacie znikają tylko pozostaje główna.
Może to jest wina ring menu.
________________________ http://www.poomoc.pl/
Kilka kliknięć a pomożesz innym!
Czy naprawdę to jest duża strata czasu?
W ten sposób pomożesz innym!
Pomógł: 13 razy Dołączył: 02 Lip 2010 Posty: 131 Skąd: z Polski
Wysłany: Wto 10 Sie, 2010 14:28
sorry że odświeżam, ale jak zrobić, żeby oni byli widzialni. Tzn, że jak ich dotknę to nie mogę przez nich przejść. Jak ustawiam TRANSPARENT_SWITCH na false to nie działa :/
I jeszcze jedno. Jaka jest w tym skrypcie komenda na warunek czy dotkniemy tą gąsienicę. Chodzi mi oto:
if dotykamy gąsienicę?
Show text: coś tam
end
Jest mi to bardzo potrzebne ;) Proszę o pomoc jak najszybszą.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum