.::. Déplacement Plus Réaliste .::.

12-11-2006 à 15:40:57
~*.::. Bonjour à tous, j'ai trouvé un bon script permettant à vos héros de se déplacer
de façon plus réaliste .::.*~


Ouvrez l'éditeur de Script avec la touche "F11".
Créez un nouveau script au-dessus de "Main".
Ensuite, nommez-le "Game_Player2".
Enfin, collez-y le code-ci dessous.

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

#############################################
#* Game Player - 4 times smoother walking *#
# #
# Insert a new script into your Script #
# Window and paste this to it, name the new #
# script Game_Player 2 #
# #
# This only effects the Player Character's #
# movment, not event based movments. #
# #
##################################3oops######

class Game_Player < Game_Character
#--------------------------------------------------------------------------
# This is what happens when the hero advances up This is also well commented
# the other 3 movments I got lazy... or just plain silly.
#--------------------------------------------------------------------------
def move_down(turn_enabled = true)
# turn down... I left turning in the likely case it is needed (strafing?)
if turn_enabled
turn_down
end
# When movment is possible,
if passable?(@x, @y, 2)
# turn down
turn_down
# Step forward 1/4 of normal steps
@y += 0.25
# increase party steps
increase_steps
# If the tile can't be walked on
else
# This saves the hero from getting stuck on a no-movment-tile
# It just tosses him to a legal tile when he tries to move
@y = @y.to_i
# Starts a contact event trigger
check_event_trigger_touch(@x, @y+1)
end
end
#--------------------------------------------------------------------------
# ...advance left
#--------------------------------------------------------------------------
def move_left(turn_enabled = true)
# turn left
if turn_enabled
turn_left
end
# ... movment possible?
if passable?(@x, @y, 4)
# turn left
turn_left
# step left
@x -= 0.25
# increase party steps
increase_steps
# movment isn't allowed so...
else
@x = @x.to_i
# contact trigger
check_event_trigger_touch(@x-1, @y)
end
end
#--------------------------------------------------------------------------
# Move right!!!
#--------------------------------------------------------------------------
def move_right(turn_enabled = true)
# turn right
if turn_enabled
turn_right
end
# move allowed?
if passable?(@x, @y, 6)
# turn right... duh
turn_right
# step right
@x += 0.25
# Self Explanitory... getting commenting feaver
increase_steps
else
@x = @x.to_i
# contact trigger
check_event_trigger_touch(@x+1, @y)
end
end
#--------------------------------------------------------------------------
# Moo-ooovin on up!!! To the east side...
#--------------------------------------------------------------------------
def move_up(turn_enabled = true)
# move up... east side
if turn_enabled
turn_up
end
#
if passable?(@x, @y, 8 )
# move up... I hope the candid comments don't confuse you...
turn_up
# step up
@y -= 0.25
# S.E.
increase_steps
else
@y = @y.to_i
# contact trigger
check_event_trigger_touch(@x, @y-1)
end
end
end


--Message édité par le 23-10-06 à 16:48:54--
12-11-2006 à 15:40:57
C'est pas pour me faire gueuler dessus avec le travaille acharné du maker qui a fait se script.........Mais je trouve se script vraiment inutile désolé a l'avance mais je vois pas a quoi pourrais bien servir se script dans nos jeu.