Jump to content
Rpg²S Forum
  • 0

SCRIPT Interactive Fogs & Tilesets


Chris Darril
 Share

Question

Ebbene si carissimi, ho bisogno del vostro aiuto/consiglio/appoggio/parere tecnico :D

credo che in media sappiate che sto sviluppando un videogioco dall'estate 2009 che porta il nome di REMOTHERED e che a conti fatti è il remake in chiave più simil-realistica e attuale del capolavoro datato 1995 Clock Tower (di origine nipponica).

 

Ebbene vi linko un video che vi farà meglio comprendere le basi del perchè di questo topic su questa sezione :sisi:

REMOTHERED - Vagando per la foresta (Gameplay)

 

Qualora aveste visto il video vi sarete accorti che lo scenario proposto in questione è una "ricca" foresta notturna, ebbene composta conseguenzialmente da:

1) Panorama di sfondo con alberi più lontani e resa video vagamente annebbiata

2) Tileset composto con molteplici varianti

3) Fog adoperato come layer superiore e non come per effetti atmosferici del tipo nebbia o oscurità incombenti.

 

Ebbene impostate le dovute trasparenze non disdegnerei poter contare sulla possibilità di una movenza a se dei tre differenti piani mostrati. Il panorama fà già il suo dovuto compito distintamente dal tileset e si muove con più lentezza, soggetto alla maggior distanza rispetto alla visuale, ma la fog rimane LETTERALMENTE appiccicata al tileset, muovendosi con esso.

 

Il punto della questione sarebbe trovar il modo o comunque un script editato a dovere che possa consentire, laddove richiesto, il movimento a se della fog impostata (ferma) una volta in movimento o magari di alcuni settori del tileset impiegato. In questo caso più velocemente che gli altri due layers mostrati più a distanza...

 

Tenendo comunque in considerazione che per il gioco sfrutto già i seguenti script e settings:

- Script rimpicciolimento prospettico

- Script animazioni a 9 frames

- Script in-fra-frames (frames aggiuntivi per la rotazione, realizzato da Progm - Team Rhaxen)

- I tilesets hanno impostazioni numerate a seconda del tipo di superficie calpestata (con annesso suono)

 

Vi ringrazierei all'infinito qualora sapreste aiutarmi o quanto meno consigliarmi. Ma ho già un mega-grazie per quelli che sono arrivati fin qui. :sisi:

 

CHRIS

Edited by Chris Darril
Link to comment
Share on other sites

Recommended Posts

  • 0
Posso provarci. Gli script sono tutti reperibili sul forum?

Ecco stavo appunto scrivendo del problema, gli scrip non sono tutti reperibili (e comunque è sempre bene mettere i link là dove lo sono), conoscerne nome e funzione non aiuta troppo senza vedere il codice... e sembrano script abbastanza radicali :D

O si fa un tentativo e si vede se può andare ed in caso con quali va in conflitto o si specifica :sisi:

^ ^

(\_/)
(^ ^) <----coniglietto rosso, me!
(> <)


Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^

http://i.imgur.com/KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^

http://i.imgur.com/FwnGMI3.png completo! Giocabile online, qui i dettagli! ^ ^

REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^

 

SUWOnzB.jpg 🖤
http://www.rpg2s.net/dax_games/r2s_regali2s.png E:3 http://www.rpg2s.net/dax_games/xmas/gifnatale123.gif
http://i.imgur.com/FfvHCGG.png by Testament (notare dettaglio in basso a destra)! E:3
http://i.imgur.com/MpaUphY.jpg by Idriu E:3

Membro Onorario, Ambasciatore dei Coniglietti (Membro n.44)

http://i.imgur.com/PgUqHPm.png
Ufficiale
"Ad opera della sua onestà e del suo completo appoggio alla causa dei Panda, Guardian Of Irael viene ufficialmente considerato un Membro portante del Partito, e Ambasciatore del suo Popolo presso di noi"


http://i.imgur.com/TbRr4iS.png<- Grazie Testament E:3
Ricorda...se rivolgi il tuo sguardo ^ ^ a Guardian anche Guardian volge il suo sguardo ^ ^ a te ^ ^
http://i.imgur.com/u8UJ4Vm.gifby Flame ^ ^
http://i.imgur.com/VbggEKS.gifhttp://i.imgur.com/2tJmjFJ.gifhttp://projectste.altervista.org/Our_Hero_adotta/ado2.png
Grazie Testament XD Fan n°1 ufficiale di PQ! :D

Viva
il Rhaxen! <- Folletto te lo avevo detto (fa pure rima) che non
avevo programmi di grafica per fare un banner su questo pc XD (ora ho di
nuovo il mio PC veramente :D)

Rosso Guardiano della
http://i.imgur.com/Os5rvhx.png

Rpg2s RPG BY FORUM:

Nome: Darth Reveal

 

PV totali 2
PA totali 16

Descrizione: ragazzo dai lunghi capelli rossi ed occhi dello stesso colore. Indossa una elegante giacca rossa sopra ad una maglietta nera. Porta pantaloni rossi larghi, una cintura nera e degli stivali dello stesso colore. E' solito trasportare lo spadone dietro la schiena in un fodero apposito. Ha un pendente al collo e tiene ben legato un pezzo di stoffa (che gli sta particolarmente a cuore) intorno al braccio sinistro sotto la giacca, copre una cicatrice.
Bozze vesti non definitive qui.

Equipaggiamento:
Indossa:
60$ e 59$ divisi in due tasche interne
Levaitan

Spada a due mani elsa lunga

Guanti del Defender (2PA)
Anello del linguaggio animale (diventato del Richiamo)

Scrinieri da lanciere (2 PA)

Elmo del Leone (5 PA)

Corazza del Leone in Ferro Corrazzato (7 PA)

ZAINO (20) contenente:
Portamonete in pelle di cinghiale contenente: 100$
Scatola Sanitaria Sigillata (può contenere e tenere al sicuro fino a 4 oggetti curativi) (contiene Benda di pronto soccorso x3, Pozione di cura)
Corda
Bottiglia di idromele
Forma di formaggio
Torcia (serve ad illuminare, dura tre settori)

Fiasca di ceramica con Giglio Amaro (Dona +1PN e Velocità all'utilizzatore)
Ampolla Bianca

Semi di Balissa

 

CAVALLO NORMALE + SELLA (30 +2 armi) contentente:
66$
Benda di pronto soccorso x3
Spada a due mani

Fagotto per Adara (fazzoletto ricamato)


 

Link to comment
Share on other sites

  • 0
Guest gino
Ecco stavo appunto scrivendo del problema, gli scrip non sono tutti reperibili (e comunque è sempre bene mettere i link là dove lo sono), conoscerne nome e funzione non aiuta troppo senza vedere il codice... e sembrano script abbastanza radicali :D

O si fa un tentativo e si vede se può andare ed in caso con quali va in conflitto o si specifica :sisi:

^ ^

A me serve assolutamente vedere le classi del fog usato come tileset. Già non sono sicuro di cosa voglia ESATTAMENTE ottenere, e tentativi alla cieca non porterebbero a niente. Ho spulciato gli script uno per uno e ho trovato solo "- Script animazioni a 9 frames", se intende Camminata con 9 frame. :P La cosa migliore sarebbe avere un progetto con la scena interessata. Ma mi accontento degli script.

Link to comment
Share on other sites

  • 0

Forse le seguenti possono bastare, almeno che non ricordi male :sisi: :

 

Game Character 1

 

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

# ■ Game_Character (分割定義 1)

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

#  キャラクターを扱うクラスです。このクラスは Game_Player クラスと Game_Event

# クラスのスーパークラスとして使用されます。

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

 

class Game_Character

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

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

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

attr_reader :id # ID

attr_reader :x # マップ X 座標 (論理座標)

attr_reader :y # マップ Y 座標 (論理座標)

attr_reader :real_x # マップ X 座標 (実座標 * 128)

attr_reader :real_y # マップ Y 座標 (実座標 * 128)

attr_reader :tile_id # タイル ID (0 なら無効)

attr_reader :character_name # キャラクター ファイル名

attr_reader :character_hue # キャラクター 色相

attr_reader :opacity # 不透明度

attr_reader :blend_type # 合成方法

attr_reader :direction # 向き

attr_reader :pattern # パターン

attr_reader :move_route_forcing # 移動ルート強制フラグ

attr_reader :through # すり抜け

attr_accessor :animation_id # アニメーション ID

attr_accessor :transparent # 透明状態

attr_accessor :turning # 透明状態

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

# ● オブジェクト初期化

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

def initialize

@turning = ""

@id = 0

@x = 0

@y = 0

@real_x = 0

@real_y = 0

@tile_id = 0

@character_name = ""

@character_hue = 0

@opacity = 255

@blend_type = 0

@direction = 2

@pattern = 0

@move_route_forcing = false

@through = false

@animation_id = 0

@transparent = false

@original_direction = 2

@original_pattern = 0

@move_type = 0

@move_speed = 3

@move_frequency = 4

@move_route = nil

@move_route_index = 0

@original_move_route = nil

@original_move_route_index = 0

@walk_anime = true

@step_anime = false

@direction_fix = false

@always_on_top = false

@anime_count = 0

@stop_count = 0

@jump_count = 0

@jump_peak = 0

@wait_count = 0

@locked = false

@prelock_direction = 0

@old_dir = 2

end

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

# ● 移動中判定

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

def moving?

# 論理座標と実座標が違っていれば移動中

return (@real_x != @x * 128 or @real_y != @y * 128)

end

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

# ● ジャンプ中判定

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

def jumping?

# ジャンプカウントが 0 より大きければジャンプ中

return @jump_count > 0

end

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

# ● 姿勢の矯正

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

def straighten

# 移動時アニメまたは停止時アニメが ON の場合

if @walk_anime or @step_anime

# パターンを 0 に設定

@pattern = 0

end

# アニメカウントをクリア

@anime_count = 0

# ロック前の向きをクリア

@prelock_direction = 0

end

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

# ● 移動ルートの強制

# move_route : 新しい移動ルート

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

def force_move_route(move_route)

# オリジナルの移動ルートを保存

if @original_move_route == nil

@original_move_route = @move_route

@original_move_route_index = @move_route_index

end

# 移動ルートを変更

@move_route = move_route

@move_route_index = 0

# 移動ルート強制フラグをセット

@move_route_forcing = true

# ロック前の向きをクリア

@prelock_direction = 0

# ウェイトカウントをクリア

@wait_count = 0

# カスタム移動

move_type_custom

end

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

# ● 通行可能判定

# 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 の場合

if @through

# 通行可

return true

end

# 移動元のタイルから指定方向に出られない場合

unless $game_map.passable?(x, y, d, self)

# 通行不可

return false

end

# 移動先のタイルに指定方向から入れない場合

unless $game_map.passable?(new_x, new_y, 10 - d)

# 通行不可

return false

end

# 全イベントのループ

for event in $game_map.events.values

# イベントの座標が移動先と一致した場合

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

# すり抜け OFF なら

unless event.through

# 自分がイベントの場合

if self != $game_player

# 通行不可

return false

end

# 自分がプレイヤーで、相手のグラフィックがキャラクターの場合

if event.character_name != ""

# 通行不可

return false

end

end

end

end

# プレイヤーの座標が移動先と一致した場合

if $game_player.x == new_x and $game_player.y == new_y

# すり抜け OFF なら

unless $game_player.through

# 自分のグラフィックがキャラクターの場合

if @character_name != ""

# 通行不可

return false

end

end

end

# 通行可

return true

end

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

# ● ロック

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

def lock

# すでにロックされている場合

if @locked

# メソッド終了

return

end

# ロック前の向きを保存

@prelock_direction = @direction

# プレイヤーの方を向く

turn_toward_player

# ロック中フラグをセット

@locked = true

end

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

# ● ロック中判定

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

def lock?

return @locked

end

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

# ● ロック解除

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

def unlock

# ロックされていない場合

unless @locked

# メソッド終了

return

end

# ロック中フラグをクリア

@locked = false

# 向き固定でない場合

unless @direction_fix

# ロック前の向きが保存されていれば

if @prelock_direction != 0

# ロック前の向きを復帰

@direction = @prelock_direction

end

end

end

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

# ● 指定位置に移動

# x : X 座標

# y : Y 座標

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

def moveto(x, y)

@x = x % $game_map.width

@y = y % $game_map.height

@real_x = @x * 128

@real_y = @y * 128

@prelock_direction = 0

end

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

# ● 画面 X 座標の取得

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

def screen_x

# 実座標とマップの表示位置から画面座標を求める

return (@real_x - $game_map.display_x + 3) / 4 + 16

end

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

# ● 画面 Y 座標の取得

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

def screen_y

# 実座標とマップの表示位置から画面座標を求める

y = (@real_y - $game_map.display_y + 3) / 4 + 32

# ジャンプカウントに応じて Y 座標を小さくする

if @jump_count >= @jump_peak

n = @jump_count - @jump_peak

else

n = @jump_peak - @jump_count

end

return y - (@jump_peak * @jump_peak - n * n) / 2

end

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

# ● 画面 Z 座標の取得

# height : キャラクターの高さ

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

def screen_z(height = 0)

# 最前面に表示フラグが ON の場合

if @always_on_top

# 無条件に 999

return 999

end

# 実座標とマップの表示位置から画面座標を求める

z = (@real_y - $game_map.display_y + 3) / 4 + 32

# タイルの場合

if @tile_id > 0

# タイルのプライオリティ * 32 を足す

return z + $game_map.priorities[@tile_id] * 32

# キャラクターの場合

else

# 高さが 32 を超えていれば 31 を足す

return z + ((height > 32) ? 31 : 0)

end

end

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

# ● 茂み深さの取得

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

def bush_depth

# タイルの場合、または最前面に表示フラグが ON の場合

if @tile_id > 0 or @always_on_top

return 0

end

# ジャンプ中以外で茂み属性のタイルなら 12、それ以外なら 0

if @jump_count == 0 and $game_map.bush?(@x, @y)

return 12

else

return 0

end

end

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

# ● 地形タグの取得

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

def terrain_tag

return $game_map.terrain_tag(@x, @y)

end

end

 

 

 

Game Character 2

 

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

# ** Game_Character (part 2)

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

# This class deals with characters. It's used as a superclass for the

# Game_Player and Game_Event classes.

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

 

class Game_Character

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

# * Frame Update

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

def update

# Branch with jumping, moving, and stopping

if turning?

update_turn

return

elsif jumping?

update_jump

elsif moving?

update_move

else

update_stop

end

# If animation count exceeds maximum value

# * Maximum value is move speed * 1 taken from basic value 18

if @anime_count > 14 - @move_speed * 2

# If stop animation is OFF when stopping

if not @step_anime and @stop_count > 0

# Return to original pattern

@pattern = @original_pattern

# If stop animation is ON when moving

else

# Update pattern

@pattern = (@pattern % 8) + 1

end

# Clear animation count

@anime_count = 0

end

# If waiting

if @wait_count > 0

# Reduce wait count

@wait_count -= 1

return

end

# If move route is forced

if @move_route_forcing

# Custom move

move_type_custom

return

end

# When waiting for event execution or locked

if @starting or lock?

# Not moving by self

return

end

# If stop count exceeds a certain value (computed from move frequency)

if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)

# Branch by move type

case @move_type

when 1 # Random

move_type_random

when 2 # Approach

move_type_toward_player

when 3 # Custom

move_type_custom

end

end

end

def update_turn

@anime_count += 1

if @anime_count > 12 - ($game_switches[3] ? 5 : 4 ) * 2

if (@pattern == 2 and !@reverse) or (@pattern == 0 and @reverse)

if @t180

start_turning

return

end

if @old_name

@character_name = @old_name.clone

@old_name = nil

end

@direction = @real_dir

@real_dir = nil

@old_dir = @direction

@reverse = false

@direction_fix = false

return

end

if !@reverse

@pattern = (@pattern +1) % 3

else

@pattern = (@pattern -1) % 3

end

@anime_count = 0

end

end

def turning?

return (!@real_dir ? false : true)

end

def start_turning

@anime_count = 0

if @t180

if @direction == 8

@direction = 4

@pattern = 0

@reverse = false

@direction_fix = true

elsif @direction == 2

@direction = 6

@pattern = 0

@reverse = false

@direction_fix = true

elsif @direction == 6

@direction = 8

@pattern = 0

@reverse = false

@direction_fix = true

elsif @direction == 4

@direction = 2

@pattern = 0

@reverse = false

@direction_fix = true

end

@t180 = false

return

end

return if @real_dir

@real_dir = @direction

if @old_name.nil?

@old_name = @character_name.clone

@character_name = @turning

end

if (@real_dir == 2 and @old_dir == 8) or (@real_dir == 8 and @old_dir == 2)

if 2 == @real_dir and 8 == @old_dir

@direction = 8

@pattern = 0

@reverse = false

@direction_fix = true

elsif 8 == @real_dir and 2 == @old_dir

@direction = 2

@pattern = 0

@reverse = false

@direction_fix = true

end

@t180 = true

elsif (@real_dir == 6 and @old_dir == 4) or (@real_dir == 4 and @old_dir == 6)

if 4 == @real_dir and 6 == @old_dir

@direction = 6

@pattern = 0

@reverse = false

@direction_fix = true

elsif 6 == @real_dir and 4 == @old_dir

@direction = 4

@pattern = 0

@reverse = false

@direction_fix = true

end

@t180 = true

else

rd = [2, 4, 6, 8]

od = [6, 2, 8, 4]

for i in 0..3

if rd != od

if rd == @real_dir and od == @old_dir

@direction = (i+1)*2

@pattern = 2

@reverse = true

elsif od == @real_dir and rd == @old_dir

@direction = (i+1)*2

@pattern = 0

@reverse = false

@direction_fix = true

end

end

end

end

end

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

# * Frame Update (jump)

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

def update_jump

# Reduce jump count by 1

@jump_count -= 1

# Calculate new coordinates

@real_x = (@real_x * @jump_count + @x * 128) / (@jump_count + 1)

@real_y = (@real_y * @jump_count + @y * 128) / (@jump_count + 1)

end

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

# * Update frame (move)

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

def update_move

# Convert map coordinates from map move speed into move distance

distance = 2 ** @move_speed

# If logical coordinates are further down than real coordinates

if @y * 128 > @real_y

# Move down

@real_y = [@real_y + distance, @y * 128].min

end

# If logical coordinates are more to the left than real coordinates

if @x * 128 < @real_x

# Move left

@real_x = [@real_x - distance, @x * 128].max

end

# If logical coordinates are more to the right than real coordinates

if @x * 128 > @real_x

# Move right

@real_x = [@real_x + distance, @x * 128].min

end

# If logical coordinates are further up than real coordinates

if @y * 128 < @real_y

# Move up

@real_y = [@real_y - distance, @y * 128].max

end

# If move animation is ON

if @walk_anime

# Increase animation count by 1.5

@anime_count += 1.5

# If move animation is OFF, and stop animation is ON

elsif @step_anime

# Increase animation count by 1

@anime_count += 1

end

end

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

# * Frame Update (stop)

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

def update_stop

# If stop animation is ON

if @step_anime

# Increase animation count by 1

@anime_count += 1

# If stop animation is OFF, but current pattern is different from original

elsif @pattern != @original_pattern

# Increase animation count by 1.5

@anime_count += 1.5

end

# When waiting for event execution, or not locked

# * If lock deals with event execution coming to a halt

unless @starting or lock?

# Increase stop count by 1

@stop_count += 1

end

end

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

# * Move Type : Random

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

def move_type_random

# Branch by random numbers 0-5

case rand(6)

when 0..3 # Random

move_random

when 4 # 1 step forward

move_forward

when 5 # Temporary stop

@stop_count = 0

end

end

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

# * Move Type : Approach

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

def move_type_toward_player

# Get difference in player coordinates

sx = @x - $game_player.x

sy = @y - $game_player.y

# Get absolute value of difference

abs_sx = sx > 0 ? sx : -sx

abs_sy = sy > 0 ? sy : -sy

# If separated by 20 or more tiles matching up horizontally and vertically

if sx + sy >= 20

# Random

move_random

return

end

# Branch by random numbers 0-5

case rand(6)

when 0..3 # Approach player

move_toward_player

when 4 # random

move_random

when 5 # 1 step forward

move_forward

end

end

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

# * Move Type : Custom

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

def move_type_custom

# Interrupt if not stopping

if jumping? or moving?

return

end

# Loop until finally arriving at move command list

while @move_route_index < @move_route.list.size

# Acquiring move command

command = @move_route.list[@move_route_index]

# If command code is 0 (last part of list)

if command.code == 0

# If [repeat action] option is ON

if @move_route.repeat

# First return to the move route index

@move_route_index = 0

end

# If [repeat action] option is OFF

unless @move_route.repeat

# If move route is forcing

if @move_route_forcing and not @move_route.repeat

# Release forced move route

@move_route_forcing = false

# Restore original move route

@move_route = @original_move_route

@move_route_index = @original_move_route_index

@original_move_route = nil

end

# Clear stop count

@stop_count = 0

end

return

end

# During move command (from move down to jump)

if command.code <= 14

# Branch by command code

case command.code

when 1 # Move down

move_down

when 2 # Move left

move_left

when 3 # Move right

move_right

when 4 # Move up

move_up

when 5 # Move lower left

move_lower_left

when 6 # Move lower right

move_lower_right

when 7 # Move upper left

move_upper_left

when 8 # Move upper right

move_upper_right

when 9 # Move at random

move_random

when 10 # Move toward player

move_toward_player

when 11 # Move away from player

move_away_from_player

when 12 # 1 step forward

move_forward

when 13 # 1 step backward

move_backward

when 14 # Jump

jump(command.parameters[0], command.parameters[1])

end

# If movement failure occurs when [ignore if can't move] option is OFF

if not @move_route.skippable and not moving? and not jumping?

return

end

@move_route_index += 1

return

end

# If waiting

if command.code == 15

# Set wait count

@wait_count = command.parameters[0] * 2 - 1

@move_route_index += 1

return

end

# If direction change command

if command.code >= 16 and command.code <= 26

# Branch by command code

case command.code

when 16 # Turn down

turn_down

when 17 # Turn left

turn_left

when 18 # Turn right

turn_right

when 19 # Turn up

turn_up

when 20 # Turn 90° right

turn_right_90

when 21 # Turn 90° left

turn_left_90

when 22 # Turn 180°

turn_180

when 23 # Turn 90° right or left

turn_right_or_left_90

when 24 # Turn at Random

turn_random

when 25 # Turn toward player

turn_toward_player

when 26 # Turn away from player

turn_away_from_player

end

@move_route_index += 1

return

end

# If other command

if command.code >= 27

# Branch by command code

case command.code

when 27 # Switch ON

$game_switches[command.parameters[0]] = true

$game_map.need_refresh = true

when 28 # Switch OFF

$game_switches[command.parameters[0]] = false

$game_map.need_refresh = true

when 29 # Change speed

@move_speed = command.parameters[0]

when 30 # Change freq

@move_frequency = command.parameters[0]

when 31 # Move animation ON

@walk_anime = true

when 32 # Move animation OFF

@walk_anime = false

when 33 # Stop animation ON

@step_anime = true

when 34 # Stop animation OFF

@step_anime = false

when 35 # Direction fix ON

@direction_fix = true

when 36 # Direction fix OFF

@direction_fix = false

when 37 # Through ON

@through = true

when 38 # Through OFF

@through = false

when 39 # Always on top ON

@always_on_top = true

when 40 # Always on top OFF

@always_on_top = false

when 41 # Change Graphic

@tile_id = 0

@character_name = command.parameters[0]

@character_hue = command.parameters[1]

if @original_direction != command.parameters[2]

@direction = command.parameters[2]

@original_direction = @direction

@prelock_direction = 0

end

if @original_pattern != command.parameters[3]

@pattern = command.parameters[3]

@original_pattern = @pattern

end

when 42 # Change Opacity

@opacity = command.parameters[0]

when 43 # Change Blending

@blend_type = command.parameters[0]

when 44 # Play SE

$game_system.se_play(command.parameters[0])

when 45 # Script

result = eval(command.parameters[0])

end

@move_route_index += 1

end

end

end

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

# * Increase Steps

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

def increase_steps

# Clear stop count

@stop_count = 0

end

end

 

 

 

Game Character 3

 

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

# ** Game_Character (part 3)

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

# This class deals with characters. It's used as a superclass for the

# Game_Player and Game_Event classes.

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

 

class Game_Character

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

# * Move Down

# turn_enabled : a flag permits direction change on that spot

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

def move_down(turn_enabled = true)

# Turn down

if turn_enabled

turn_down

end

# If passable

if passable?(@x, @y, 2)

# Turn down

turn_down

# Update coordinates

@y += 1

# Increase steps

increase_steps

# If impassable

else

# Determine if touch event is triggered

check_event_trigger_touch(@x, @y+1)

end

end

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

# * Move Left

# turn_enabled : a flag permits direction change on that spot

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

def move_left(turn_enabled = true)

# Turn left

if turn_enabled

turn_left

end

# If passable

if passable?(@x, @y, 4)

# Turn left

turn_left

# Update coordinates

@x -= 1

# Increase steps

increase_steps

# If impassable

else

# Determine if touch event is triggered

check_event_trigger_touch(@x-1, @y)

end

end

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

# * Move Right

# turn_enabled : a flag permits direction change on that spot

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

def move_right(turn_enabled = true)

# Turn right

if turn_enabled

turn_right

end

# If passable

if passable?(@x, @y, 6)

# Turn right

turn_right

# Update coordinates

@x += 1

# Increase steps

increase_steps

# If impassable

else

# Determine if touch event is triggered

check_event_trigger_touch(@x+1, @y)

end

end

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

# * Move up

# turn_enabled : a flag permits direction change on that spot

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

def move_up(turn_enabled = true)

# Turn up

if turn_enabled

turn_up

end

# If passable

if passable?(@x, @y, 8)

# Turn up

turn_up

# Update coordinates

@y -= 1

# Increase steps

increase_steps

# If impassable

else

# Determine if touch event is triggered

check_event_trigger_touch(@x, @y-1)

end

end

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

# * Move Lower Left

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

def move_lower_left

# If no direction fix

unless @direction_fix

# Face down is facing right or up

@direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)

end

# When a down to left or a left to down course is passable

if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or

(passable?(@x, @y, 4) and passable?(@x - 1, @y, 2))

# Update coordinates

@x -= 1

@y += 1

# Increase steps

increase_steps

end

end

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

# * Move Lower Right

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

def move_lower_right

# If no direction fix

unless @direction_fix

# Face right if facing left, and face down if facing up

@direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)

end

# When a down to right or a right to down course is passable

if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or

(passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))

# Update coordinates

@x += 1

@y += 1

# Increase steps

increase_steps

end

end

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

# * Move Upper Left

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

def move_upper_left

# If no direction fix

unless @direction_fix

# Face left if facing right, and face up if facing down

@direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)

end

# When an up to left or a left to up course is passable

if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or

(passable?(@x, @y, 4) and passable?(@x - 1, @y, 8))

# Update coordinates

@x -= 1

@y -= 1

# Increase steps

increase_steps

end

end

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

# * Move Upper Right

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

def move_upper_right

# If no direction fix

unless @direction_fix

# Face right if facing left, and face up if facing down

@direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)

end

# When an up to right or a right to up course is passable

if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or

(passable?(@x, @y, 6) and passable?(@x + 1, @y, 8))

# Update coordinates

@x += 1

@y -= 1

# Increase steps

increase_steps

end

end

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

# * Move at Random

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

def move_random

case rand(4)

when 0 # Move down

move_down(false)

when 1 # Move left

move_left(false)

when 2 # Move right

move_right(false)

when 3 # Move up

move_up(false)

end

end

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

# * Move toward Player

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

def move_toward_player

# Get difference in player coordinates

sx = @x - $game_player.x

sy = @y - $game_player.y

# If coordinates are equal

if sx == 0 and sy == 0

return

end

# Get absolute value of difference

abs_sx = sx.abs

abs_sy = sy.abs

# If horizontal and vertical distances are equal

if abs_sx == abs_sy

# Increase one of them randomly by 1

rand(2) == 0 ? abs_sx += 1 : abs_sy += 1

end

# If horizontal distance is longer

if abs_sx > abs_sy

# Move towards player, prioritize left and right directions

sx > 0 ? move_left : move_right

if not moving? and sy != 0

sy > 0 ? move_up : move_down

end

# If vertical distance is longer

else

# Move towards player, prioritize up and down directions

sy > 0 ? move_up : move_down

if not moving? and sx != 0

sx > 0 ? move_left : move_right

end

end

end

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

# * Move away from Player

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

def move_away_from_player

# Get difference in player coordinates

sx = @x - $game_player.x

sy = @y - $game_player.y

# If coordinates are equal

if sx == 0 and sy == 0

return

end

# Get absolute value of difference

abs_sx = sx.abs

abs_sy = sy.abs

# If horizontal and vertical distances are equal

if abs_sx == abs_sy

# Increase one of them randomly by 1

rand(2) == 0 ? abs_sx += 1 : abs_sy += 1

end

# If horizontal distance is longer

if abs_sx > abs_sy

# Move away from player, prioritize left and right directions

sx > 0 ? move_right : move_left

if not moving? and sy != 0

sy > 0 ? move_down : move_up

end

# If vertical distance is longer

else

# Move away from player, prioritize up and down directions

sy > 0 ? move_down : move_up

if not moving? and sx != 0

sx > 0 ? move_right : move_left

end

end

end

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

# * 1 Step Forward

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

def move_forward

case @direction

when 2

move_down(false)

when 4

move_left(false)

when 6

move_right(false)

when 8

move_up(false)

end

end

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

# * 1 Step Backward

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

def move_backward

# Remember direction fix situation

last_direction_fix = @direction_fix

# Force directino fix

@direction_fix = true

# Branch by direction

case @direction

when 2 # Down

move_up(false)

when 4 # Left

move_right(false)

when 6 # Right

move_left(false)

when 8 # Up

move_down(false)

end

# Return direction fix situation back to normal

@direction_fix = last_direction_fix

end

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

# * Jump

# x_plus : x-coordinate plus value

# y_plus : y-coordinate plus value

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

def jump(x_plus, y_plus)

# If plus value is not (0,0)

if x_plus != 0 or y_plus != 0

# If horizontal distnace is longer

if x_plus.abs > y_plus.abs

# Change direction to left or right

x_plus < 0 ? turn_left : turn_right

# If vertical distance is longer, or equal

else

# Change direction to up or down

y_plus < 0 ? turn_up : turn_down

end

end

# Calculate new coordinates

new_x = @x + x_plus

new_y = @y + y_plus

# If plus value is (0,0) or jump destination is passable

if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)

# Straighten position

straighten

# Update coordinates

@x = new_x

@y = new_y

# Calculate distance

distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round

# Set jump count

@jump_peak = 10 + distance - @move_speed

@jump_count = @jump_peak * 2

# Clear stop count

@stop_count = 0

end

end

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

# * Turn Down

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

def turn_down

unless @direction_fix or turning?

if @direction != 2

@direction = 2

start_turning if @turning != ""

end

@stop_count = 0

end

end

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

# * Turn Left

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

def turn_left

unless @direction_fix or turning?

if @direction != 4

@direction = 4

start_turning if @turning != ""

end

@stop_count = 0

end

end

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

# * Turn Right

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

def turn_right

unless @direction_fix or turning?

if @direction != 6

@direction = 6

start_turning if @turning != ""

end

@stop_count = 0

end

end

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

# * Turn Up

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

def turn_up

unless @direction_fix or turning?

if @direction != 8

@direction = 8

start_turning if @turning != ""

end

@stop_count = 0

end

end

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

# * Turn 90° Right

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

def turn_right_90

case @direction

when 2

turn_left

when 4

turn_up

when 6

turn_down

when 8

turn_right

end

end

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

# * Turn 90° Left

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

def turn_left_90

case @direction

when 2

turn_right

when 4

turn_down

when 6

turn_up

when 8

turn_left

end

end

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

# * Turn 180°

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

def turn_180

case @direction

when 2

turn_up

when 4

turn_right

when 6

turn_left

when 8

turn_down

end

end

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

# * Turn 90° Right or Left

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

def turn_right_or_left_90

if rand(2) == 0

turn_right_90

else

turn_left_90

end

end

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

# * Turn at Random

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

def turn_random

case rand(4)

when 0

turn_up

when 1

turn_right

when 2

turn_left

when 3

turn_down

end

end

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

# * Turn Towards Player

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

def turn_toward_player

# Get difference in player coordinates

sx = @x - $game_player.x

sy = @y - $game_player.y

# If coordinates are equal

if sx == 0 and sy == 0

return

end

# If horizontal distance is longer

if sx.abs > sy.abs

# Turn to the right or left towards player

sx > 0 ? turn_left : turn_right

# If vertical distance is longer

else

# Turn up or down towards player

sy > 0 ? turn_up : turn_down

end

end

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

# * Turn Away from Player

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

def turn_away_from_player

# Get difference in player coordinates

sx = @x - $game_player.x

sy = @y - $game_player.y

# If coordinates are equal

if sx == 0 and sy == 0

return

end

# If horizontal distance is longer

if sx.abs > sy.abs

# Turn to the right or left away from player

sx > 0 ? turn_right : turn_left

# If vertical distance is longer

else

# Turn up or down away from player

sy > 0 ? turn_down : turn_up

end

end

end

 

 

 

Sprite Character

 

class Game_Temp

$min = 0.0

$max = 1.0

end

class Sprite_Character < RPG::Sprite

attr_accessor :character # character

def initialize(viewport, character = nil)

super(viewport)

@character = character

update

end

def update

super

# If tile ID, file name, or hue are different from current ones

if @tile_id != @character.tile_id or

@character_name != @character.character_name or

@character_hue != @character.character_hue

# Remember tile ID, file name, and hue

@tile_id = @character.tile_id

@character_name = @character.character_name

@character_hue = @character.character_hue

# If tile ID value is valid

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

# If tile ID value is invalid

else

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

@character.character_hue)

@cw = bitmap.width / 9

@ch = bitmap.height / 4

self.ox = @cw / 4

self.oy = @ch

end

end

# Set visible situation

self.visible = (not @character.transparent)

# If graphic is character

if @tile_id == 0

# Set rectangular transfer

sx = @character.pattern * @cw

sy = (@character.direction - 2) / 2 * @ch

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

end

# Set sprite coordinates

self.x = @character.screen_x

self.y = @character.screen_y

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

var = @character.screen_y + 2.0

min = $min

max = $max

calc = max * (var / 480) + min

if @character.opacity != 254

self.zoom_x = calc

self.zoom_y = calc

end

self.opacity = @character.opacity

self.blend_type = @character.blend_type

self.bush_depth = @character.bush_depth

# Animation

if @character.animation_id != 5

animation = $data_animations[@character.animation_id]

animation(animation, true)

@character.animation_id = 0

end

end

end

 

Link to comment
Share on other sites

  • 0
Guest gino
Forse le seguenti possono bastare, almeno che non ricordi male :sisi: :

Magari mi sbaglio. Ma a prima vista questi mi sembrano script per la gestione del chara. Sì sì- Ma io voglio quello che gestisce il fog. Se non ho capito male tu hai uno script che aggiunge un ulteriore livello in primo piano. E vuoi che abbia un effetto parallasse.

Link to comment
Share on other sites

  • 0
Magari mi sbaglio. Ma a prima vista questi mi sembrano script per la gestione del chara. Sì sì- Ma io voglio quello che gestisce il fog. Se non ho capito male tu hai uno script che aggiunge un ulteriore livello in primo piano. E vuoi che abbia un effetto parallasse.

No no pardon...allora mi sarò spiegato male. Lo script dei fog è quello di default, dico solo che sfrutto le fog diversamente ovvero come superfici in primo piano come per luci, ombreggiature e magari oggetti in primissimo piano e non magari per rappresentare nebbioline e via dicendo.

 

Nel caso del bosco mostrato in video per l'appunto gli alberi in primissimo piano fanno parte di una fog con trasparenza impostata in png solo che nel momento in cui la protagonista si muove per l'ambiente, lo spostamento della fog è lo stesso identico di quello del tileset impiegato, per cui le due superfici pur essendo tecnicamente separate appaiono come appiccicate e non viene dato quel senso di realismo e tridimensionalità sufficienti che magari gioverebbero al mio progetto :sisi:

Link to comment
Share on other sites

  • 0
Guest gino

Ignoranza mia che non ricordavo che XP ha già delle opzioni preimpostate per le fog :P Comunque ora ho controllato, e se vai in

Script Editor --> Spriteset_Map

alle righe 128 e 129, che dovrebbero essere queste:

	@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox	@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy

Basta sostituire il 4 con il 2 nella riga 128 (quella dell'asse x)

	@fog.ox = $game_map.display_x / 2 + $game_map.fog_ox	@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy

per ottenere quello che volevi tu. Se mi sbaglio fammelo sapere!

Edited by gino
Link to comment
Share on other sites

  • 0
Ignoranza mia che non ricordavo che XP ha già delle opzioni preimpostate per le fog :P Comunque ora ho controllato, e se vai in

Script Editor --> Spriteset_Map

alle righe 128 e 129, che dovrebbero essere queste:

	@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox	@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy

Basta sostituire il 4 con il 2 nella riga 128 (quella dell'asse x)

	@fog.ox = $game_map.display_x / 2 + $game_map.fog_ox	@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy

per ottenere quello che volevi tu. Se mi sbaglio fammelo sapere!

 

Mmm nessuno cambiamento, ho anche provato a diminuire e o aumentare il valore dell'asse Y ma non succede.

 

Ad ogni modo vorrei che fosse anche possibile applicare il dovuto script in alcuni scenari (come il bosco) mentre disattivarlo in altri, ad esempio gli interni, in cui le fog vorrei fossero proprio fisse sullo schermo.

Link to comment
Share on other sites

  • 0
Guest gino
Mmm nessuno cambiamento, ho anche provato a diminuire e o aumentare il valore dell'asse Y ma non succede.

 

Ad ogni modo vorrei che fosse anche possibile applicare il dovuto script in alcuni scenari (come il bosco) mentre disattivarlo in altri, ad esempio gli interni, in cui le fog vorrei fossero proprio fisse sullo schermo.

Quello poi non sarebbe un grosso problema. Per caso hai uno script che sovrascrive Spriteset_Map?

Link to comment
Share on other sites

  • 0
Quello poi non sarebbe un grosso problema. Per caso hai uno script che sovrascrive Spriteset_Map?

Se non ricordo male è quello di default

 

 

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

# ** Spriteset_Map

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

# This class brings together map screen sprites, tilemaps, etc.

# It's used within the Scene_Map class.

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

 

class Spriteset_Map

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

# * Object Initialization

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

def initialize

# Make viewports

@viewport1 = Viewport.new(0, 0, 640, 480)

@viewport2 = Viewport.new(0, 0, 640, 480)

@viewport3 = Viewport.new(0, 0, 640, 480)

@viewport2.z = 200

@viewport3.z = 5000

# Make tilemap

@tilemap = Tilemap.new(@viewport1)

@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)

for i in 0..6

autotile_name = $game_map.autotile_names

@tilemap.autotiles = RPG::Cache.autotile(autotile_name)

end

@tilemap.map_data = $game_map.data

@tilemap.priorities = $game_map.priorities

# Make panorama plane

@panorama = Plane.new(@viewport1)

@panorama.z = -1000

# Make fog plane

@fog = Plane.new(@viewport1)

@fog.z = 3000

# Make character sprites

@character_sprites = []

for i in $game_map.events.keys.sort

sprite = Sprite_Character.new(@viewport1, $game_map.events)

@character_sprites.push(sprite)

end

@character_sprites.push(Sprite_Character.new(@viewport1, $game_player))

# Make weather

@weather = RPG::Weather.new(@viewport1)

# Make picture sprites

@picture_sprites = []

for i in 1..50

@picture_sprites.push(Sprite_Picture.new(@viewport2,

$game_screen.pictures))

end

# Make timer sprite

@timer_sprite = Sprite_Timer.new

# Frame update

update

end

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

# * Dispose

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

def dispose

# Dispose of tilemap

@tilemap.tileset.dispose

for i in 0..6

@tilemap.autotiles.dispose

end

@tilemap.dispose

# Dispose of panorama plane

@panorama.dispose

# Dispose of fog plane

@fog.dispose

# Dispose of character sprites

for sprite in @character_sprites

sprite.dispose

end

# Dispose of weather

@weather.dispose

# Dispose of picture sprites

for sprite in @picture_sprites

sprite.dispose

end

# Dispose of timer sprite

@timer_sprite.dispose

# Dispose of viewports

@viewport1.dispose

@viewport2.dispose

@viewport3.dispose

end

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

# * Frame Update

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

def update

# If panorama is different from current one

if @panorama_name != $game_map.panorama_name or

@panorama_hue != $game_map.panorama_hue

@panorama_name = $game_map.panorama_name

@panorama_hue = $game_map.panorama_hue

if @panorama.bitmap != nil

@panorama.bitmap.dispose

@panorama.bitmap = nil

end

if @panorama_name != ""

@panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)

end

Graphics.frame_reset

end

# If fog is different than current fog

if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue

@fog_name = $game_map.fog_name

@fog_hue = $game_map.fog_hue

if @fog.bitmap != nil

@fog.bitmap.dispose

@fog.bitmap = nil

end

if @fog_name != ""

@fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)

end

Graphics.frame_reset

end

# Update tilemap

@tilemap.ox = $game_map.display_x / 4

@tilemap.oy = $game_map.display_y / 4

@tilemap.update

# Update panorama plane

@panorama.ox = $game_map.display_x / 8

@panorama.oy = $game_map.display_y / 8

# Update fog plane

@fog.zoom_x = $game_map.fog_zoom / 100.0

@fog.zoom_y = $game_map.fog_zoom / 100.0

@fog.opacity = $game_map.fog_opacity

@fog.blend_type = $game_map.fog_blend_type

@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox

@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy

@fog.tone = $game_map.fog_tone

# Update character sprites

for sprite in @character_sprites

sprite.update

end

# Update weather graphic

@weather.type = $game_screen.weather_type

@weather.max = $game_screen.weather_max

@weather.ox = $game_map.display_x / 4

@weather.oy = $game_map.display_y / 4

@weather.update

# Update picture sprites

for sprite in @picture_sprites

sprite.update

end

# Update timer sprite

@timer_sprite.update

# Set screen color tone and shake position

@viewport1.tone = $game_screen.tone

@viewport1.ox = $game_screen.shake

# Set screen flash color

@viewport3.color = $game_screen.flash_color

# Update viewports

@viewport1.update

@viewport3.update

end

end

 

Link to comment
Share on other sites

  • 0

Sono andato un pò d'intuito e a quanto pare l'impostazione funziona solo se bilanciata sia in asse X che Y, ispirato dal settaggio del panorama che invece essendo più lento è 8 x 8.

 

Funziona e durante lo scenario nella foresta fa la sua porca figura ma, come immaginavo, negli altri scenari si muove da se come layer superiore, per cui ho re-impostato 4 x 4 e con call script mi sono richiamato il rigo della pagine script editata come evento parallelo nella mappa in questione, ma ahimè mi dà errore.

 

Beh, è sempre qualcosa :sisi:

Link to comment
Share on other sites

  • 0
Guest gino
Mmm...no news?

È un po' che ci provo... praticamente sto cercando di isolare il comportamento della fog dagli script Spriteset_Map e Game_Map, per poterlo poi cambiare come pare a noi, ma non so perché non vuole proprio funzionare.

 

EDIT:

AGGIUNGI IL SEGUENTE FILE IMMAGINE NELLA CARTELLA FOGS: (È TRASPARENTE! :P )

 

 

-->http://img94.imageshack.us/img94/6238/voidr.png<--

 

 

Ecco lo script. Prova e fammi sapere!

 

=begin [ISTRUZIONI] RICHIEDE LA PRESENZA DI UN FILE CHIAMATO void NELLA CARTELLA FOGS! VA BENE UNFILE QUALSIASI BASTA CHE SIA UN FILE .PNG VUOTO E TRASPARENTE. Inserisci i seguenti comandi in un evento: $super_fog.create([nomefile], [opacità] )   crea una fog caricando il file [nomefile] dalla cartella fogs,   applicando un'opacità pari a [opacità]   (ricorda che i valori vanno da 0 (INVISIBILE) a 255 (TRASPARENZA 0))  $super_fog.set_xvar(2)  determina quanto velocemente si sposta la fog in senso orizzontale. $super_fog.set_yvar(0)  determina quanto velocemente si sposta la fog in senso verticale. $super_fog.dispose  elimina la fog.  Il comportamento della fog è determinato anche dalle sue dimensioni.Prova combinazioni diverse per trovare il risultato migliore. =end class Scene_Title   alias gino_fog_command_new_game command_new_game  def command_new_game	$super_fog = Super_Fog.new()	gino_fog_command_new_game  endend class Scene_Load   alias gino_fog_read_save_data read_save_data  def read_save_data(file)	$super_fog = Super_Fog.new()	gino_fog_read_save_data(file)  end end class Spriteset_Map   alias gino_fog_update update  def update	gino_fog_update	$super_fog.update_fog unless $super_fog == nil  end   alias gino_fog_dispose dispose  def dispose	gino_fog_dispose	$super_fog.dispose unless $superfog == nil  end end class Super_Fog  attr_accessor :plane  attr_accessor :x  attr_accessor :y   def initialize	@xvar = 4	@yvar = 4	viewport = Viewport.new(0, 0, 640, 480)	viewport.z =4000	@plane = Plane.new(viewport)	bitmap = RPG::Cache.fog("void", 0)	@plane.bitmap = bitmap	@plane.opacity = 100	update_fog  end   def create(fog_name = "void", opacity = 100)	@plane.bitmap.dispose	bitmap = RPG::Cache.fog(fog_name, 0)	@plane.bitmap = bitmap	@plane.opacity = opacity  end   def set_xvar(value = 4)	@xvar = value #unless value == 0  end   def set_yvar(value = 4)	@yvar = value #unless value == 0  end   def update_fog	if @xvar != 0	  @plane.ox = $game_map.display_x / @xvar  unless $game_map == nil	else	  @plane.ox = 0	end	if @yvar != 0	  @plane.oy = $game_map.display_x / @yvar  unless $game_map == nil	else	  @plane.oy = 0	end  end   def dispose	self.plane.dispose unless self.plane.disposed?  end end

 

 

Inserisci prima di main e sotto tutti gli altri script.

Edited by gino
Link to comment
Share on other sites

  • 0

Fatto (anche rinominato il file void.png, che forse per errore avevi salvato come voidR.png)

purtroppo però una volta entrati nella mappa in cui avrebbe dovuto esservi l'evento col call script ecco che accade :(

http://imageshack.us/m/829/7851/erroree.jpg

Link to comment
Share on other sites

  • 0

Mmm...risolto.

Nel call script dovevo includere il nome della fog fra ""

solo che questo è l'effetto:

http://imageshack.us/m/864/7985/errorrx.jpg

La fog si rivela perfino superiore alle pictures impiegate (gli hud di gioco) e non è soggetta alla "tonalità schermo" impostata...

Link to comment
Share on other sites

  • 0
scusate se mi intrometto xd... premesso che di ruby nn ci capisco una mazza... non sarebbe possibile creare delle nebbie diverse per ogni tonalita' schermo?
I'm working for a new project
Link to comment
Share on other sites

  • 0
scusate se mi intrometto xd... premesso che di ruby nn ci capisco una mazza... non sarebbe possibile creare delle nebbie diverse per ogni tonalita' schermo?

Ma sarebbe un caos...oltre che porterebbe il gioco a pesare il doppio (una fog simile considera che pesa tipo 2mb), ne utilizzo sempre una sola e con la dovuta tecnica, talvolta con l'utilizzo di pictures e il cambio tonalità riesco ad impostare stessa visuale a differente ore del giorno.

Edited by Chris Darril
Link to comment
Share on other sites

  • 0
@Chris: ti ri-ricordo del divieto dei doppipost e di avere un po' di pazienza in generale! ^ ^"

(\_/)
(^ ^) <----coniglietto rosso, me!
(> <)


Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^

http://i.imgur.com/KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^

http://i.imgur.com/FwnGMI3.png completo! Giocabile online, qui i dettagli! ^ ^

REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^

 

SUWOnzB.jpg 🖤
http://www.rpg2s.net/dax_games/r2s_regali2s.png E:3 http://www.rpg2s.net/dax_games/xmas/gifnatale123.gif
http://i.imgur.com/FfvHCGG.png by Testament (notare dettaglio in basso a destra)! E:3
http://i.imgur.com/MpaUphY.jpg by Idriu E:3

Membro Onorario, Ambasciatore dei Coniglietti (Membro n.44)

http://i.imgur.com/PgUqHPm.png
Ufficiale
"Ad opera della sua onestà e del suo completo appoggio alla causa dei Panda, Guardian Of Irael viene ufficialmente considerato un Membro portante del Partito, e Ambasciatore del suo Popolo presso di noi"


http://i.imgur.com/TbRr4iS.png<- Grazie Testament E:3
Ricorda...se rivolgi il tuo sguardo ^ ^ a Guardian anche Guardian volge il suo sguardo ^ ^ a te ^ ^
http://i.imgur.com/u8UJ4Vm.gifby Flame ^ ^
http://i.imgur.com/VbggEKS.gifhttp://i.imgur.com/2tJmjFJ.gifhttp://projectste.altervista.org/Our_Hero_adotta/ado2.png
Grazie Testament XD Fan n°1 ufficiale di PQ! :D

Viva
il Rhaxen! <- Folletto te lo avevo detto (fa pure rima) che non
avevo programmi di grafica per fare un banner su questo pc XD (ora ho di
nuovo il mio PC veramente :D)

Rosso Guardiano della
http://i.imgur.com/Os5rvhx.png

Rpg2s RPG BY FORUM:

Nome: Darth Reveal

 

PV totali 2
PA totali 16

Descrizione: ragazzo dai lunghi capelli rossi ed occhi dello stesso colore. Indossa una elegante giacca rossa sopra ad una maglietta nera. Porta pantaloni rossi larghi, una cintura nera e degli stivali dello stesso colore. E' solito trasportare lo spadone dietro la schiena in un fodero apposito. Ha un pendente al collo e tiene ben legato un pezzo di stoffa (che gli sta particolarmente a cuore) intorno al braccio sinistro sotto la giacca, copre una cicatrice.
Bozze vesti non definitive qui.

Equipaggiamento:
Indossa:
60$ e 59$ divisi in due tasche interne
Levaitan

Spada a due mani elsa lunga

Guanti del Defender (2PA)
Anello del linguaggio animale (diventato del Richiamo)

Scrinieri da lanciere (2 PA)

Elmo del Leone (5 PA)

Corazza del Leone in Ferro Corrazzato (7 PA)

ZAINO (20) contenente:
Portamonete in pelle di cinghiale contenente: 100$
Scatola Sanitaria Sigillata (può contenere e tenere al sicuro fino a 4 oggetti curativi) (contiene Benda di pronto soccorso x3, Pozione di cura)
Corda
Bottiglia di idromele
Forma di formaggio
Torcia (serve ad illuminare, dura tre settori)

Fiasca di ceramica con Giglio Amaro (Dona +1PN e Velocità all'utilizzatore)
Ampolla Bianca

Semi di Balissa

 

CAVALLO NORMALE + SELLA (30 +2 armi) contentente:
66$
Benda di pronto soccorso x3
Spada a due mani

Fagotto per Adara (fazzoletto ricamato)


 

Link to comment
Share on other sites

  • 0
Guest gino

È che purtroppo mi tocca ricopiare le funzioni base una per una, ma fuori dal loro solito posto. Comunque ora ho aggiunto anche i tone (spero che tu li lasci costanti per tutta la scena).

 

 

=begin [ISTRUZIONI] RICHIEDE LA PRESENZA DI UN FILE CHIAMATO void NELLA CARTELLA FOGS! VA BENE UNFILE QUALSIASI BASTA CHE SIA UN FILE .PNG VUOTO E TRASPARENTE. Inserisci i seguenti comandi in un evento: $super_fog.create([nomefile], [opacità], [red], [green], [blue], [grey] )  crea una fog caricando il file [nomefile] dalla cartella fogs,   applicando un'opacità pari a [opacità]   e un tono dato da [red], [green], [blue], [grey]  (ricorda che i valori vanno da 0 a 255)  $super_fog.set_xvar(2)  determina quanto velocemente si sposta la fog in senso orizzontale. $super_fog.set_yvar(0)  determina quanto velocemente si sposta la fog in senso verticale. $super_fog.dispose  elimina la fog.  Il comportamento della fog è determinato anche dalle sue dimensioni.Prova combinazioni diverse per trovare il risultato migliore. =end class Scene_Title   alias gino_fog_command_new_game command_new_game  def command_new_game	$super_fog = Super_Fog.new	gino_fog_command_new_game  endend class Scene_Load   alias gino_fog_read_save_data read_save_data  def read_save_data(file)	$super_fog = Super_Fog.new	gino_fog_read_save_data(file)  end end class Spriteset_Map   alias gino_fog_update update  def update	gino_fog_update	$super_fog.update_fog unless $super_fog == nil  end   alias gino_fog_dispose dispose  def dispose	gino_fog_dispose	$super_fog.dispose unless $superfog == nil  end end class Super_Fog  attr_accessor :plane  attr_accessor :xvar  attr_accessor :yvar  attr_accessor :tone   def initialize	@xvar = 4	@yvar = 4	@tone = Tone.new(0, 0, 0, 0)	viewport = Viewport.new(0, 0, 640, 480)	viewport.z =3000	@plane = Plane.new(viewport)	bitmap = RPG::Cache.fog("void", 0)	@plane.bitmap = bitmap	@plane.opacity = 100	update_fog  end   def create(fog_name = "void", opacity = 100, red = 0, green = 0, blue = 0, grey = 0)	@tone = Tone.new(red, green, blue, grey)	@plane.bitmap.dispose	bitmap = RPG::Cache.fog(fog_name, 0)	@plane.bitmap = bitmap	@plane.opacity = opacity	update_fog  end   def set_xvar(value = 4)	@xvar = value #unless value == 0  end   def set_yvar(value = 4)	@yvar = value #unless value == 0  end   def update_fog	if @xvar != 0	  @plane.ox = $game_map.display_x / @xvar  unless $game_map == nil	else	  @plane.ox = 0	end	if @yvar != 0	  @plane.oy = $game_map.display_x / @yvar  unless $game_map == nil	else	  @plane.oy = 0	end	@plane.tone = @tone rescue god = "shit" #MA CHE CAZZO DE ERRORE E' MADONNA FRADICIA?!  end   def dispose	self.plane.dispose unless self.plane.disposed?  end end

 

Link to comment
Share on other sites

  • 0

Mmm strano, è tornato a darmi errore sulla linea 274 della pagina "Interpreter 7"

 

 

http://imageshack.us/m/135/2319/senzaolo1h.jpg

 

 

 

@Guardian: hai ragione, chiedo scusa, non c'avevo proprio fatto caso :smile:

Link to comment
Share on other sites

  • 0
Guest gino

Prova ad aggiungere questo script prima di main e dimmi se cambia qualcosa. Purtroppo pare che potrebbe trattarsi di un errore di RPG Maker:

 

class Interpreter   def command_355	script = @list[@index].parameters[0] + "n"	loop do	  if @list[@index+1].code == 655		script += @list[@index+1].parameters[0] + "n"	  else		break	  end	  @index += 1	end	result = eval(script)	#exception handling	begin	  return false if result == false	rescue	  Window_Help.new.set_text("Errore")	ensure	  return true #La mia risposta ad un errore del cazzo.	end	#@@	return true  end end

 

Link to comment
Share on other sites

  • 0

Niente niente :(

per di più è comparsa un'alquanto misteriosa scritta proprio ad altezza dell'hud della salute...e non appena premo esc per accedere al menu default di rpg maker xp e tornare al menu principale, la fog adoperata riesce perfino a porsi al di sopra di questo.

http://imageshack.us/m/16/5879/errorckg.jpg

 

http://imageshack.us/m/813/421/errorhc.jpg

Link to comment
Share on other sites

  • 0
Guest gino

La misteriosa scritta è "errore" e serviva a me per sapere che il mio metodo funziona :P ho risolto un problemuccio non da poco. Se ci fai caso dove prima ti dava un errore fatale adesso il gioco riesce a proseguire. Per il fatto che si sovrappone il discorso è molto semplice, basta cambiare la profondità della viewport. Ti posto le correzioni apportate fra un secondo.

 

EDIT: Per il discorso dell'HUD che è sovrascritto, prova tu stesso a cambiare il valore "viewport.z = 300" finché non va al posto giusto.

 

Fog Script:

 

=begin [ISTRUZIONI] RICHIEDE LA PRESENZA DI UN FILE CHIAMATO void NELLA CARTELLA FOGS! VA BENE UNFILE QUALSIASI BASTA CHE SIA UN FILE .PNG VUOTO E TRASPARENTE. Inserisci i seguenti comandi in un evento: $super_fog.create([nomefile], [opacità], [red], [green], [blue], [grey] )  crea una fog caricando il file [nomefile] dalla cartella fogs,   applicando un'opacità pari a [opacità]   e un tono dato da [red], [green], [blue], [grey]  (ricorda che i valori vanno da 0 a 255)  $super_fog.set_xvar(2)  determina quanto velocemente si sposta la fog in senso orizzontale. $super_fog.set_yvar(0)  determina quanto velocemente si sposta la fog in senso verticale. $super_fog.dispose  elimina la fog.  Il comportamento della fog è determinato anche dalle sue dimensioni.Prova combinazioni diverse per trovare il risultato migliore. =end class Scene_Title   alias gino_fog_command_new_game command_new_game  def command_new_game	$super_fog = Super_Fog.new	gino_fog_command_new_game  endend class Scene_Load   alias gino_fog_read_save_data read_save_data  def read_save_data(file)	$super_fog = Super_Fog.new	gino_fog_read_save_data(file)  end end class Spriteset_Map   alias gino_fog_update update  def update	gino_fog_update	$super_fog.update_fog unless $super_fog == nil  end   alias gino_fog_dispose dispose  def dispose	gino_fog_dispose	$super_fog.dispose unless $superfog == nil  end end class Super_Fog  attr_accessor :plane  attr_accessor :xvar  attr_accessor :yvar  attr_accessor :tone   def initialize	@xvar = 4	@yvar = 4	@tone = Tone.new(0, 0, 0, 0)	viewport = Viewport.new(0, 0, 640, 480)	viewport.z = 300	@plane = Plane.new(viewport)	bitmap = RPG::Cache.fog("void", 0)	@plane.bitmap = bitmap	@plane.opacity = 100	update_fog  end   def create(fog_name = "void", opacity = 100, red = 0, green = 0, blue = 0, grey = 0)	@tone = Tone.new(red, green, blue, grey)	@plane.bitmap.dispose	bitmap = RPG::Cache.fog(fog_name, 0)	@plane.bitmap = bitmap	@plane.opacity = opacity	update_fog  end   def set_xvar(value = 4)	@xvar = value #unless value == 0  end   def set_yvar(value = 4)	@yvar = value #unless value == 0  end   def update_fog	if @xvar != 0	  @plane.ox = $game_map.display_x / @xvar  unless $game_map == nil	else	  @plane.ox = 0	end	if @yvar != 0	  @plane.oy = $game_map.display_x / @yvar  unless $game_map == nil	else	  @plane.oy = 0	end	@plane.tone = @tone #rescue god = "shit" #MA CHE CAZZO DE ERRORE E' MADONNA FRADICIA?!  end   def dispose	self.plane.dispose unless self.plane.disposed?  end end

 

 

Interpreter Fix:

 

class Interpreter   def command_355	script = @list[@index].parameters[0] + "n"	loop do	  if @list[@index+1].code == 655		script += @list[@index+1].parameters[0] + "n"	  else		break	  end	  @index += 1	end	result = eval(script)	#exception handling	begin	  return false if result == false	rescue	  #do nothing	ensure	  return true #mica è detto che è vero, però proviamo!	end	#@@	return true  end end

 

Edited by gino
Link to comment
Share on other sites

  • 0

Ok...ho poco alla volta diminuito i valori e mi sono reso conto che la fog va a posizionarsi sotto agli hud di gioco e alle intestazioni del menu di default solo se imposto a 0...

 

però purtroppo ancora non reagisce all'impostazione di tonalità schermo e ne scompare del tutto dal menu di default.

http://imageshack.us/m/843/4219/errorgv.jpg

 

mi sa che è proprio complessa la cosa :( beh vabbè tranquillo, non voglio stressarti oltremodo, mi sa che mi accontento della fog fissa, sei già stato grandioso

Link to comment
Share on other sites

  • 0
Guest gino

1°) Per ora ho aggiunto solo che tu puoi dare il tono alla fog... chiaramente ancora non va ad adeguarsi automaticamente alla mappa, ma posso provare e dovrebbe essere fattibile.

2°) Riguardo al menù, tu vorresti che la fog compaia sopra la windowskin, ma sotto le scritte?

3°) Posizionandola a 0 con gli HUD di gioco è tutto a posto? EDIT: ca**ata, a 0 manco se vede!

Edited by gino
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...