Jump to content
Rpg²S Forum
  • 0

charset con 8 direzioni


mAsTeR
 Share

Question

allora GO DUE DOMANDE:

 

1) Non trovo piu' lo script che permette di inserire charset con 8 direzioni invece delle normali 4

 

2) Avevo la versione con 7 sprites per direzione ( 7 x 8 )... sono per caso uscite nuove versioni dello script per esempio 9 x 8 ???

 

grazias

http://rpg2s.net/gif/SCContest1Oct.gif

http://alpha85.altervista.org/_altervista_ht/banner_eViL.png

 

Project: eViL CHAPTER I: IL SUPREMO | Powered by: PhoenixSoft |Home site

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

Eccolo, è 8x9 frames. RImpiazza la classe game_player con:

#==============================================================================

# ■ Game_Player

#------------------------------------------------------------------------------

#  プレイヤーを扱うクラスです。イベントの起動判定や、マップのスクロールなどの

# 機能を持っています。このクラスのインスタンスは $game_player で参照されます。

#==============================================================================

 

class Game_Player < Game_Character

#--------------------------------------------------------------------------

# ● 定数

#--------------------------------------------------------------------------

CENTER_X = (320 - 16) * 4 # 画面中央の X 座標 * 4

CENTER_Y = (240 - 16) * 4 # 画面中央の Y 座標 * 4

#--------------------------------------------------------------------------

# ● 通行可能判定

# x : X 座標

# y : Y 座標

# d : 方向 (0,2,4,6,8) ※ 0 = 全方向通行不可の場合を判定 (ジャンプ用)

#--------------------------------------------------------------------------

def passable?(x, y, d)

# 新しい座標を求める

new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)

new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)

# 座標がマップ外の場合

 

unless $game_map.valid?(new_x, new_y)

 

# 通行不可

return false

end

# デバッグモードが ON かつ CTRL キーが押されている場合

if $DEBUG and Input.press?(Input::CTRL)

# 通行可

return true

end

super

end

#--------------------------------------------------------------------------

# ● 画面中央に来るようにマップの表示位置を設定

#--------------------------------------------------------------------------

def center(x, y)

max_x = ($game_map.width - 20) * 128

max_y = ($game_map.height - 15) * 128

$game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max

$game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max

end

#--------------------------------------------------------------------------

# ● 指定位置に移動

# x : X 座標

# y : Y 座標

#--------------------------------------------------------------------------

def moveto(x, y)

super

# センタリング

center(x, y)

# エンカウント カウントを作成

make_encounter_count

end

#--------------------------------------------------------------------------

# ● 歩数増加

#--------------------------------------------------------------------------

def increase_steps

super

# 移動ルート強制中ではない場合

unless @move_route_forcing

# 歩数増加

$game_party.increase_steps

 

# 歩数が偶数の場合

if $game_party.steps % 2 == 0

# スリップダメージチェック

$game_party.check_map_slip_damage

end

end

end

#--------------------------------------------------------------------------

# ● エンカウント カウント取得

#--------------------------------------------------------------------------

def encounter_count

return @encounter_count

end

#--------------------------------------------------------------------------

# ● エンカウント カウント作成

#--------------------------------------------------------------------------

def make_encounter_count

# サイコロを 2 個振るイメージ

if $game_map.map_id != 0

n = $game_map.encounter_step

@encounter_count = rand(n) + rand(n) + 1

end

end

#--------------------------------------------------------------------------

# ● リフレッシュ

#--------------------------------------------------------------------------

def refresh

# パーティ人数が 0 人の場合

if $game_party.actors.size == 0

# キャラクターのファイル名と色相をクリア

@character_name = ""

@character_hue = 0

# メソッド終了

return

end

# 先頭のアクターを取得

actor = $game_party.actors[0]

# キャラクターのファイル名と色相を設定

@character_name = actor.character_name

@character_hue = actor.character_hue

# 不透明度と合成方法を初期化

@opacity = 255

@blend_type = 0

end

#--------------------------------------------------------------------------

# ● 同位置のイベント起動判定

#--------------------------------------------------------------------------

def check_event_trigger_here(triggers)

result = false

# イベント実行中の場合

if $game_system.map_interpreter.running?

return result

end

# 全イベントのループ

for event in $game_map.events.values

# イベントの座標とトリガーが一致した場合

if event.x == @x and event.y == @y and triggers.include?(event.trigger)

# ジャンプ中以外で、起動判定が同位置のイベントなら

if not event.jumping? and event.over_trigger?

event.start

result = true

end

end

end

return result

end

#--------------------------------------------------------------------------

# ● 正面のイベント起動判定

#--------------------------------------------------------------------------

def check_event_trigger_there(triggers)

result = false

# イベント実行中の場合

if $game_system.map_interpreter.running?

return result

end

# 正面の座標を計算

new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)

new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)

# 全イベントのループ

for event in $game_map.events.values

# イベントの座標とトリガーが一致した場合

if event.x == new_x and event.y == new_y and

triggers.include?(event.trigger)

# ジャンプ中以外で、起動判定が正面のイベントなら

if not event.jumping? and not event.over_trigger?

event.start

result = true

end

end

end

# 該当するイベントが見つからなかった場合

if result == false

# 正面のタイルがカウンターなら

if $game_map.counter?(new_x, new_y)

# 1 タイル奥の座標を計算

new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0)

new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0)

# 全イベントのループ

for event in $game_map.events.values

# イベントの座標とトリガーが一致した場合

if event.x == new_x and event.y == new_y and

triggers.include?(event.trigger)

# ジャンプ中以外で、起動判定が正面のイベントなら

if not event.jumping? and not event.over_trigger?

event.start

result = true

end

end

end

end

end

return result

end

#--------------------------------------------------------------------------

# ● 接触イベントの起動判定

#--------------------------------------------------------------------------

def check_event_trigger_touch(x, y)

result = false

# イベント実行中の場合

if $game_system.map_interpreter.running?

return result

end

# 全イベントのループ

for event in $game_map.events.values

# イベントの座標とトリガーが一致した場合

if event.x == x and event.y == y and [1,2].include?(event.trigger)

# ジャンプ中以外で、起動判定が正面のイベントなら

if not event.jumping? and not event.over_trigger?

event.start

result = true

end

end

end

return result

end

#--------------------------------------------------------------------------

# ● フレーム更新

#--------------------------------------------------------------------------

def update

if

$game_variables[001]==1

# ローカル変数に移動中かどうかを記憶

last_moving = moving?

# 移動中、イベント実行中、移動ルート強制中、

# メッセージウィンドウ表示中のいずれでもない場合

unless moving? or $game_system.map_interpreter.running? or

@move_route_forcing or $game_temp.message_window_showing

# 方向ボタンが押されていれば、その方向へプレイヤーを移動

case Input.dir8

 

when 0

 

$game_variables[004]=0

 

 

 

when 1

 

move_lower_left

$game_variables[004]=1

$game_variables[005]=1

 

 

 

 

when 2

 

move_down

$game_variables[004]=2

$game_variables[005]=2

 

 

 

when 3

 

move_lower_right

$game_variables[004]=3

$game_variables[005]=3

 

 

 

 

when 4

 

move_left

$game_variables[004]=4

$game_variables[005]=4

 

 

 

 

when 6

 

move_right

$game_variables[004]=6

$game_variables[005]=6

 

 

 

 

when 7

 

move_upper_left

$game_variables[004]=7

$game_variables[005]=7

 

 

 

 

when 8

 

move_up

$game_variables[004]=8

$game_variables[005]=8

 

 

 

 

when 9

 

move_upper_right

$game_variables[004]=9

$game_variables[005]=9

 

 

 

 

end

end

end

# ローカル変数に座標を記憶

last_real_x = @real_x

last_real_y = @real_y

super

# キャラクターが下に移動し、かつ画面上の位置が中央より下の場合

if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y

# マップを下にスクロール

$game_map.scroll_down(@real_y - last_real_y)

end

# キャラクターが左に移動し、かつ画面上の位置が中央より左の場合

if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X

# マップを左にスクロール

$game_map.scroll_left(last_real_x - @real_x)

end

# キャラクターが右に移動し、かつ画面上の位置が中央より右の場合

if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X

# マップを右にスクロール

$game_map.scroll_right(@real_x - last_real_x)

end

# キャラクターが上に移動し、かつ画面上の位置が中央より上の場合

if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y

# マップを上にスクロール

$game_map.scroll_up(last_real_y - @real_y)

end

# 移動中ではない場合

unless moving?

# 前回プレイヤーが移動中だった場合

if last_moving

# 同位置のイベントとの接触によるイベント起動判定

result = check_event_trigger_here([1,2])

# 起動したイベントがない場合

if result == false

# デバッグモードが ON かつ CTRL キーが押されている場合を除き

unless $DEBUG and Input.press?(Input::CTRL)

# エンカウント カウントダウン

if @encounter_count > 0

@encounter_count -= 1

end

end

end

end

# C ボタンが押された場合

if Input.trigger?(Input::C)

# 同位置および正面のイベント起動判定

check_event_trigger_here([0])

check_event_trigger_there([0,1,2])

end

end

end

end

E sprite_character con:

#==============================================================================

# ■ Sprite_Character

#------------------------------------------------------------------------------

#  キャラクター表示用のスプライトです。Game_Character クラスのインスタンスを

# 監視し、スプライトの状態を自動的に変化させます。

#==============================================================================

 

class Sprite_Character < RPG::Sprite

#--------------------------------------------------------------------------

# ● 公開インスタンス変数

#--------------------------------------------------------------------------

attr_accessor :character # キャラクター

#--------------------------------------------------------------------------

# ● オブジェクト初期化

# viewport : ビューポート

# character : キャラクター (Game_Character)

#--------------------------------------------------------------------------

def initialize(viewport, character = nil)

super(viewport)

@character = character

update

end

#--------------------------------------------------------------------------

# ● フレーム更新

#--------------------------------------------------------------------------

def update

 

super

 

if @tile_id != @character.tile_id or

 

@character_name != @character.character_name or

 

@character_hue != @character.character_hue

 

@tile_id = @character.tile_id

 

@character_name = @character.character_name

 

@character_hue = @character.character_hue

 

if @tile_id >= 384

 

self.bitmap = RPG::Cache.tile($game_map.tileset_name,

 

@tile_id, @character.character_hue)

 

self.src_rect.set(0, 0, 32, 32)

 

self.ox = 16

 

self.oy = 32

 

else

 

self.bitmap = RPG::Cache.character(@character.character_name,

 

@character.character_hue)

 

@cw = bitmap.width / 9

 

@ch = bitmap.height / 8

 

self.ox = @cw / 2

 

self.oy = @ch

 

end

 

end

 

self.visible = (not @character.transparent)

 

if @tile_id == 0

 

sx = @character.pattern * @cw

 

dir = @character.direction

 

dec = (dir == 7 or dir== 9) ? 3 : 1

 

sy = (dir - dec) * @ch

 

self.src_rect.set(sx, sy, @cw, @ch)

 

end

 

self.x = @character.screen_x

 

self.y = @character.screen_y

 

self.z = @character.screen_z(@ch)

 

self.opacity = @character.opacity

 

self.blend_type = @character.blend_type

 

self.bush_depth = @character.bush_depth

 

if @character.animation_id != 0

 

animation = $data_animations[@character.animation_id]

 

animation(animation, true)

 

@character.animation_id = 0

 

end

 

end

 

end

http://img214.imageshack.us/img214/6732/r2scopytk5.png

 

Raxen - Scission of God

 

Cerchiamo collaboratori (Musicisti, Grafici e Scripter) per un nuovo progetto fantasy!

 

Rhaxen Scission of God

 

 

BASTA AL MAKING ITALIANO CHE VA A ROTOLI! DIAMOCI UNA SVEGLIATA!!

BASTA ALLE SOLITE BANALI DISCUSSIONI SULLA DECADENZA DEI GIOCHI!! FACCIAMOLI STI GIOCHI!!!

APRITE LO SPOILER E LEGGETE IL MANIFESTO DEL MAKING ITALIANO, SE DAVVERO VE NE IMPORTA QUALCOSA!!

 

Il Manifesto del Making Italiano

 

SALVIAMO IL MAKING ITALIANO!!

Dopo un test dei nostri esperti (Alato, Blake e havana24) abbiamo scoperto che ad interesse risponde interesse: cioè se voi dimostrate di essere interessati a ciò che creano gli altri, questi saranno stimolati a continuare a creare! E' un concetto semplice ma estremamente sottovalutato, basta vedere quanti topic di bei giochi sono caduti nel dimenticatoio e sono stati cagati solo da poche persone (prendiamo per esempio il fantastico gioco di Vech che vi invito a vedere nella sezione RM2k).

Perciò quello che dobbiamo fare è: leggere, leggere, leggere, postare, postare, postare! E questo non significa postare a caso, ma leggere per bene il progetto di qualcuno, le domande poste, le creazioni grafiche e musicali, e fare dei post in cui si propongano miglioramenti, si critichino le brutture, si esaltino le bellezze, si aiutino gli oppressi etc etc

BASTA AL MAKING ITALIANO CHE VA A ROTOLI! DIAMOCI UNA SVEGLIATA!!

Per dimostrarvi ciò che sto esponendo vi riporto che la volta in cui abbiamo provato (Alato, Blake e havana24) a fare una cosa di questo genere, c'è costata un pomeriggio ma il giorno dopo abbiamo ottenuto il numero massimo di utenti online mai raggiunto!!! Ma soprattutto ciò significa che l'interesse riguardo al making era stato, almeno momentaneamente, risvegliato!!

Voi pensate che eravamo solo in 3 a cercare tutti i topic e ravvivarli (con sincerità e senza i soliti falsi "Oh che bello.", ma anche con critiche per lavori incompleti o assurdi) e abbiamo ottenuto quel grande risultato: se lo facessimo tutti non sarebbe una cosa potentissima?!?

BASTA ALLE SOLITE BANALI DISCUSSIONI SULLA DECADENZA DEI GIOCHI!! FACCIAMOLI STI GIOCHI!!!

Chi è contrario a questa cosa, può pure continuare così ma è una persona che col making non ha nulla a che fare, ma chi crede nel making inizi ora, immediatamente a seguire questa linea di pensiero!

 

Ma chi è d'accordo, chi davvero ci tiene al making, incolli questo Manifesto nella propria firma!! Mettete anche voi questa firma!!

 

 

Link to comment
Share on other sites

  • 0

Recentemente io ho creato questo ma è per un movimento n*4 (i frame sono quanti te ne pare).
Devo precisarti che gli eroi e gli eventi possono avere un numero di frame differenti.
Le impostazioni di default sono EROI a 8*4 con 1 frame per la posa da fermo (quindi 9*4)
mentre gli eventi hanno una grafica 4*4.
Per la camminata diagonale viene usata la grafica del PG in alto quando cammini nelle direzioni su/destra su/sinistra mentre la grafica del PG in basso quando cammini in giu/destra giu/sinistra

Se ti può essere utile ecco lo script:

 

 




#==============================================================================
# ** Hero and Event Frame Script 1.1 (25-03-2007)
# by The Sleeping Leonhart
#------------------------------------------------------------------------------
# This script allow the user to choice the frame of the hero, the frame of
# the event, add a standing pose and the 8 direction movement.
# This Script include the patch for the menu.
#==============================================================================

#=========================== CONFIGURATION =====================================
HERO_FRAME = 8 #frame for the hero
EVENT_FRAME = 4 #frame for the event
HERO_STAND = true #enable/disable the hero standing pose
EVENT_STAND = false #enable/disable the event standing pose
EIGHT_DIRECTION = true #enabledisable the 8 direction mode
#===============================================================================

class Sprite_Character < RPG::Sprite
alias tsl_spritecharcter_update update
def update
super
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 16
self.oy = 32
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
if @character.is_a?(Game_Event)
if EVENT_STAND
@cw = bitmap.width / (EVENT_FRAME + 1)
@ch = bitmap.height / 4
else
@cw = bitmap.width / EVENT_FRAME
@ch = bitmap.height / 4
end
elsif @character.is_a?(Game_Player)
if HERO_STAND
@cw = bitmap.width / (HERO_FRAME + 1)
@ch = bitmap.height / 4
else
@cw = bitmap.width / HERO_FRAME
@ch = bitmap.height / 4
end
end
self.ox = @cw / 2
self.oy = @ch
end
end
tsl_spritecharcter_update
end
end

class Game_Character
attr_reader :step_anime
attr_reader :walk_anime
attr_reader :stop_count
def update
if jumping?
update_jump
elsif moving?
update_move
else
update_stop
end
if not self.is_a?(Game_Player)
if @anime_count > 16 - @move_speed * 2
if not @step_anime and @stop_count > 0
@pattern = @original_pattern
else
if EVENT_STAND == true
@pattern = @pattern - 1
@pattern = (@pattern + 1) % EVENT_FRAME + 1
else
@pattern = (@pattern + 1) % EVENT_FRAME
end
end
@anime_count = 0
end
else
if @anime_count > 16 - @move_speed * 2
if not @step_anime and @stop_count > 0
@pattern = @original_pattern
else
if HERO_STAND == true
@pattern = @pattern - 1
@pattern = (@pattern + 1) % HERO_FRAME + 1
else
@pattern = (@pattern + 1) % HERO_FRAME
end
end
@anime_count = 0
end
end
if @wait_count > 0
@wait_count -= 1
return
end
if @move_route_forcing
move_type_custom
return
end
if @starting or lock?
return
end
if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
case @move_type
when 1
move_type_random
when 2
move_type_toward_player
when 3
move_type_custom
end
end
end
def move_lower_left
unless @direction_fix
if EIGHT_DIRECTION == true
@direction = 3
else
@direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
end
end
if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or
(passable?(@x, @y, 4) and passable?(@x - 1, @y, 2))
if EIGHT_DIRECTION == true
turn_downleft
end
@x -= 1
@y += 1
increase_steps
end
end
def move_lower_right
unless @direction_fix
if EIGHT_DIRECTION == true
@direction = 3
else
@direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
end
end
if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
(passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
if EIGHT_DIRECTION == true
turn_downright
end
@x += 1
@y += 1
increase_steps
end
end
def move_upper_left
unless @direction_fix
if EIGHT_DIRECTION == true
@direction = 9
else
@direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
end
end
if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or
(passable?(@x, @y, 4) and passable?(@x - 1, @y, 8))
if EIGHT_DIRECTION == true
turn_upleft
end
@x -= 1
@y -= 1
increase_steps
end
end
def move_upper_right
unless @direction_fix
if EIGHT_DIRECTION == true
@direction = 9
else
@direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
end
end
if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or
(passable?(@x, @y, 6) and passable?(@x + 1, @y, 8))
if EIGHT_DIRECTION == true
turn_upright
end
@x += 1
@y -= 1
increase_steps
end
end
def move_random
if EIGHT_DIRECTION == true
caserand=8
else
caserand=4
end
case rand(caserand)
when 0
move_down(false)
when 1
move_left(false)
when 2
move_right(false)
when 3
move_up(false)
when 4
move_lower_left
when 5
move_lower_right
when 6
move_upper_left
when 7
move_upper_right
end
end
def move_toward_player
sx = @x - $game_player.x
sy = @y - $game_player.y
if sx == 0 and sy == 0
return
end
abs_sx = sx.abs
abs_sy = sy.abs
if EIGHT_DIRECTION == true
if sx > 0
if sy > 0
move_upper_left
elsif sy <0
move_lower_left
else
move_left
end
elsif sx <0
if sy > 0
move_upper_right
elsif sy <0
move_lower_right
else
move_right
end
else
if sy > 0
move_up
elsif sy <0
move_down
else

end
end
else
if abs_sx == abs_sy
rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
end
if abs_sx > abs_sy
sx > 0 ? move_left : move_right
if not moving? and sy != 0
sy > 0 ? move_up : move_down
end
else
sy > 0 ? move_up : move_down
if not moving? and sx != 0
sx > 0 ? move_left : move_right
end
end
end
end
def move_away_from_player
sx = @x - $game_player.x
sy = @y - $game_player.y
if sx == 0 and sy == 0
return
end
abs_sx = sx.abs
abs_sy = sy.abs
if EIGHT_DIRECTION == true
if sx > 0
if sy > 0
move_lower_right
elsif sy <0
move_upper_right
else
move_right
end
elsif sx <0
if sy > 0
move_lower_left
elsif sy <0
move_upper_left
else
move_left
end
else
if sy > 0
move_down
elsif sy <0
move_up
else

end
end
else
if abs_sx == abs_sy
rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
end
if abs_sx > abs_sy
sx > 0 ? move_right : move_left
if not moving? and sy != 0
sy > 0 ? move_down : move_up
end
else
sy > 0 ? move_down : move_up
if not moving? and sx != 0
sx > 0 ? move_right : move_left
end
end
end
end
def move_forward
if EIGHT_DIRECTION == true
case @direction
when 2
move_down(false)
when 4
move_left(false)
when 6
move_right(false)
when 8
move_up(false)
end
else
case @direction
when 1
move_lower_left
when 2
move_down(false)
when 3
move_lower_right
when 4
move_left(false)
when 6
move_right(false)
when 7
move_upper_left
when 8
move_up(false)
when 9
move_upper_right
end
end
end
def move_backward
last_direction_fix = @direction_fix
@direction_fix = true
if EIGHT_DIRECTION == true
case @direction
when 1
move_upper_right
when 2
move_up(false)
when 3
move_upper_left
when 4
move_right(false)
when 6
move_left(false)
when 7
move_lower_right
when 8
move_down(false)
when 9
move_lower_left
end
else
case @direction
when 2
move_up(false)
when 4
move_right(false)
when 6
move_left(false)
when 8
move_down(false)
end
end
@direction_fix = last_direction_fix
end
def turn_upleft
unless @direction_fix
@direction = 9
@stop_count = 0
end
end
def turn_upright
unless @direction_fix
@direction = 9
@stop_count = 0
end
end
def turn_downleft
unless @direction_fix
@direction = 3
@stop_count = 0
end
end
def turn_downright
unless @direction_fix
@direction = 3
@stop_count = 0
end
end
def turn_right_90
case @direction
when 1
turn_downright
when 2
turn_left
when 3
turn_upright
when 4
turn_up
when 6
turn_down
when 7
turn_downleft
when 8
turn_right
when 9
turn_upleft
end
end
def turn_left_90
case @direction
when 1
turn_upleft
when 2
turn_right
when 3
turn_downleft
when 4
turn_down
when 6
turn_up
when 7
turn_upright
when 8
turn_left
when 9
turn_downright
end
end
def turn_180
case @direction
when 1
turn_upright
when 2
turn_up
when 3
turn_upleft
when 4
turn_right
when 6
turn_left
when 7
turn_downright
when 8
turn_down
when 9
turn_downleft
end
end
def turn_random
if EIGHT_DIRECTION == true
caserand = 8
else
caserand = 4
end
case rand(caserand)
when 0
turn_down
when 1
turn_left
when 2
turn_right
when 3
turn_up
when 4
turn_downleft
when 5
turn_downright
when 6
turn_upleft
when 7
turn_upright
end
end
def turn_toward_player
sx = @x - $game_player.x
sy = @y - $game_player.y
if EIGHT_DIRECTION == true
if sx > 0
if sy > 0
turn_upleft
elsif sy <0
turn_downleft
else
turn_left
end
elsif sx <0
if sy > 0
turn_upright
elsif sy <0
turn_downright
else
turn_right
end
else
if sy > 0
turn_up
elsif sy <0
turn_down
else

end
end
else
if sx == 0 and sy == 0
return
end
if sx.abs > sy.abs
sx > 0 ? turn_left : turn_right
else
sy > 0 ? turn_up : turn_down
end
end
end
def turn_away_from_player
sx = @x - $game_player.x
sy = @y - $game_player.y
if EIGHT_DIRECTION == true
if sx > 0
if sy > 0
turn_downright
elsif sy <0
turn_upright
else
turn_right
end
elsif sx <0
if sy > 0
turn_downleft
elsif sy <0
turn_upleft
else
turn_left
end
else
if sy > 0
turn_down
elsif sy <0
turn_up
else
end
end
else
if sx == 0 and sy == 0
return
endr
if sx.abs > sy.abs
sx > 0 ? turn_right : turn_left
else
sy > 0 ? turn_down : turn_up
end
end
end
end
end

class Game_Player < Game_Character
alias tsl_gameplayer_update update
def update
last_moving = moving?
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
if EIGHT_DIRECTION == true
case Input.dir8
when 1
move_lower_left
when 2
move_down
when 3
move_lower_right
when 4
move_left
when 6
move_right
when 7
move_upper_left
when 8
move_up
when 9
move_upper_right
end
else
case Input.dir4
when 2
move_down
when 4
move_left
when 6
move_right
when 8
move_up
end
end
end
tsl_gameplayer_update
end
end

class Window_Base < Window
def draw_actor_graphic(actor, x, y)
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
if HERO_STAND
cw = bitmap.width / (HERO_FRAME + 1)
else
cw = bitmap.width / HERO_FRAME
end
ch = bitmap.height / 4
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
end

 

Edited by Apo
Spoiler buggato
Link to comment
Share on other sites

  • 0
se ho capito bene quindi qst script serve a far venire gli eventi 4x4 e l'eroe 9x4? a me veramente serviva uno script x fare il movimento ad 8 direzioni usando un chara 9x8. Per capire su,giu,dx,sx, sudx, giudx, susx, giusx
Link to comment
Share on other sites

  • 0

Quello script e quello mio modificano solamente i characters non i battlers.

Per quello ci vuole uno script a parte o devi configurare bene il tuo.

Se posti lo script e un battler vedo che posso fare.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...