RPG Creator : créez votre MMORPG ou RPG sans aucune connaissance en programmation


Disponible le 4 Juin !




- Jouez à votre jeu sur tablettes tactiles, Smartphones et navigateurs Web
- Personnalisez vos menus
- Dessinez facilement et rapidement vos cartes
- Créez des actions pour le combat A-RPG


www.rpgcreator.net


Heures au format UTC + 1 heure [ Heure d’été ]


Règles du forum


Consultez la liste des Scripts : cliquez ici



Publier un nouveau sujet Répondre au sujet  [ 23 messages ]  Aller à la page 1, 2, 3  Suivant
Auteur Message
 Sujet du message: [Heros] 3D isométrique
MessagePublié: 19 Aoû 2006, 20:30 

Points d'aide: 0/60

Créations :

Voir ses créations

Voila il y a deux seconde j'ai trouver un script de la 3d iso a la kingdom hearts sur gameboy voici le script a metre au dessus de main nomme le comme vous le voulez (tester et fonctionel):
Code: Tout sélectionner
#==============================================================================
# ** Game_Character (Modification)
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================

DIR_8_FRAMES = 8        # This holds the number of motion frames when walking
DIR_8_STAND = true      # This determines if separate frame used for standing

class Game_Character 
 
  attr_reader   :step_anime
  attr_reader   :stop_count
 
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Branch with jumping, moving, and stopping
    if 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 > 18 - @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 + 1 ) % DIR_8_FRAMES)
      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

  #--------------------------------------------------------------------------
  # * Move Lower Left (Rewritten for diagonal animation)
  #-------------------------------------------------------------------------- 
  def move_lower_left
    unless @direction_fix
      @direction = 1
    end
    if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or
      (passable?(@x, @y, 4) and passable?(@x - 1, @y, 2))
      turn_downleft
      @x -= 1
      @y += 1
      increase_steps
    end
  end

  #--------------------------------------------------------------------------
  # * Move Lower Right (Rewritten for diagonal animation)
  #-------------------------------------------------------------------------- 
  def move_lower_right
    unless @direction_fix
      @direction = 3
    end
    if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
      (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
      turn_downright
      @x += 1
      @y += 1
      increase_steps
    end
  end

  #--------------------------------------------------------------------------
  # * Move Upper Left (Rewritten for diagonal animation)
  #-------------------------------------------------------------------------- 
  def move_upper_left
    unless @direction_fix
      @direction = 7
    end
    if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or
      (passable?(@x, @y, 4) and passable?(@x - 1, @y, 8))
      turn_upleft
      @x -= 1
      @y -= 1
      increase_steps
    end
  end

  #--------------------------------------------------------------------------
  # * Move Upper Left (Rewritten for diagonal animation)
  #-------------------------------------------------------------------------- 
  def move_upper_right
    unless @direction_fix
      @direction = 9
    end
    if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or
      (passable?(@x, @y, 6) and passable?(@x + 1, @y, 8))
      turn_upright
      @x += 1
      @y -= 1
      increase_steps
    end
  end
 
  #--------------------------------------------------------------------------
  # * Turn Up Left (Rewritten for diagonal animation)
  #-------------------------------------------------------------------------- 
  def turn_upleft
    unless @direction_fix
    @direction = 7
    @stop_count = 0
    end
  end

  #--------------------------------------------------------------------------
  # * Turn Up Right (Rewritten for diagonal animation)
  #-------------------------------------------------------------------------- 
  def turn_upright
    unless @direction_fix
    @direction = 9
    @stop_count = 0
    end
  end

  #--------------------------------------------------------------------------
  # * Turn Down Left (Rewritten for diagonal animation)
  #-------------------------------------------------------------------------- 
  def turn_downleft
    unless @direction_fix
    @direction = 1
    @stop_count = 0
    end
  end

  #--------------------------------------------------------------------------
  # * Turn Down Right (Rewritten for diagonal animation)
  #-------------------------------------------------------------------------- 
  def turn_downright
    unless @direction_fix
    @direction = 3
    @stop_count = 0
    end
  end
end


#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
#  This class handles the player. Its functions include event starting
#  determinants and map scrolling. Refer to "$game_player" for the one
#  instance of this class.
#==============================================================================

class Game_Player < Game_Character

  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Remember whether or not moving in local variables
    last_moving = moving?
    # If moving, event running, move route forcing, and message window
    # display are all not occurring
    unless moving? or $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing
     
      # Move player in the direction the directional button is being pressed
      # Rewritten for diagonal animation
      case Input.dir8
      when 2
        move_down
      when 4
        move_left
      when 6
        move_right
      when 8
        move_up
      when 7
        move_upper_left
      when 9
        move_upper_right
      when 3
        move_lower_right
      when 1
        move_lower_left
      end
    end
   
    # Remember coordinates in local variables
    last_real_x = @real_x
    last_real_y = @real_y
    super
    # If character moves down and is positioned lower than the center
    # of the screen
    if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
      # Scroll map down
      $game_map.scroll_down(@real_y - last_real_y)
    end
    # If character moves left and is positioned more let on-screen than
    # center
    if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
      # Scroll map left
      $game_map.scroll_left(last_real_x - @real_x)
    end
    # If character moves right and is positioned more right on-screen than
    # center
    if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
      # Scroll map right
      $game_map.scroll_right(@real_x - last_real_x)
    end
    # If character moves up and is positioned higher than the center
    # of the screen
    if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
      # Scroll map up
      $game_map.scroll_up(last_real_y - @real_y)
    end
    # If not moving
    unless moving?
      # If player was moving last time
      if last_moving
        # Event determinant is via touch of same position event
        result = check_event_trigger_here([1,2])
        # If event which started does not exist
        if result == false
          # Disregard if debug mode is ON and ctrl key was pressed
          unless $DEBUG and Input.press?(Input::CTRL)
            # Encounter countdown
            if @encounter_count > 0
              @encounter_count -= 1
            end
          end
        end
      end
      # If C button was pressed
      if Input.trigger?(Input::C)
        # Same position and front event determinant
        check_event_trigger_here([0])
        check_event_trigger_there([0,1,2])
      end
    end
  end
end

 
 
 
#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
#  This sprite is used to display the character.It observes the Game_Character
#  class and automatically changes sprite conditions.
#==============================================================================

class Sprite_Character < RPG::Sprite 

  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  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)
        if DIR_8_STAND 
          @cw = bitmap.width / (DIR_8_FRAMES + 1)  # Movement frames w/ stand
        else
          @cw = bitmap.width / (DIR_8_FRAMES)      # Movement frames regular
        end
        @ch = bitmap.height / 8                    # This sets for 8 directions
        self.ox = @cw / 2
        self.oy = @ch
      end
    end
    # Set visible situation
    self.visible = (not @character.transparent)
    # If graphic is character
    if @tile_id == 0
      # Set rectangular transfer
     
      # Set horizontal transfer (animation frames)
      if not @character.step_anime and @character.stop_count > 0
        sx = (@character.pattern) * @cw
      else
        sx = (@character.pattern + 1) * @cw
      end
      # If you want the standing frame to be PART of the walking animation...
      # like the default sprites (very plain...) comment out the above set
      # of statements EXCEPT sx = (@character.pattern) * @cw

      # Set vertical transfer (direction)
      dir = @character.direction            # These routines allow for eight
      dec = (dir == 7 or dir== 9) ? 3 : 1   # directional movement.  I forgot
      sy = (dir - dec) * @ch                # how I came up with it.  Really.
     
      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)
    # Set opacity level, blend method, and bush depth
    self.opacity = @character.opacity
    self.blend_type = @character.blend_type
    self.bush_depth = @character.bush_depth
    # Animation
    if @character.animation_id != 0
      animation = $data_animations[@character.animation_id]
      animation(animation, true)
      @character.animation_id = 0
    end
  end
end


pour qu'il marche il faut avoir des chara de ce genre voila le template avec 72 image lol:
Image

Voila a+.
EDIT:j'ai oublier de preciser il viens pas de moi et je sais pas de qui dsl


Haut
  
 
 Sujet du message: Re: [Heros] 3D isométrique
MessagePublié: 19 Aoû 2006, 20:35 
Bourgeois (Nv 5)

Inscrit le: 15 Aoû 2006, 00:00
Messages: 292
Points d'aide: 0/60

Créations :

Voir ses créations

il me sera utile merci


Haut
 Profil  
 
 Sujet du message: Re: [Heros] 3D isométrique
MessagePublié: 19 Aoû 2006, 23:00 
Villageois (Nv 3)

Inscrit le: 11 Aoû 2006, 00:00
Messages: 50
Points d'aide: 0/60

Créations :

Voir ses créations

WHOOA merci il sera tres utile dans notre projet


Haut
 Profil  
 
 Sujet du message: Re: [Heros] 3D isométrique
MessagePublié: 19 Aoû 2006, 23:47 
Bourgeois (Nv 3)

Inscrit le: 16 Aoû 2006, 00:00
Messages: 257
Points d'aide: 0/60

Créations :

Voir ses créations

Je vais voir s'il est plus intéressant que celui que j'ai ^^
Car je l'utilise pour mon KH également mais il y a quelque bug avec d'autre scripts.
Merci beaucoup Very Happy

[]EDIT: :P Enorme LOL c'est pas de l'iso mon bonhomme! l'iso, en déplacement se fait par des diagonales en 120° et la elles n'y sont pas!


Haut
 Profil  
 
 Sujet du message: Re: [Heros] 3D isométrique
MessagePublié: 20 Aoû 2006, 13:57 
Ancien membre du staff
Ancien membre du staff

Inscrit le: 17 Aoû 2006, 00:00
Messages: 940
Points d'aide: 7/60

Créations :

Voir ses créations

joli ! mais chiant a faire...


Haut
 Profil  
 
 Sujet du message: Re: [Heros] 3D isométrique
MessagePublié: 20 Aoû 2006, 14:00 
Membre royal très actif

Inscrit le: 11 Aoû 2006, 00:00
Messages: 1521
Points d'aide: 0/60

Créations :

Voir ses créations

screen?

sinon sa a l'air sympa


Haut
 Profil  
 
 Sujet du message: Re: [Heros] 3D isométrique
MessagePublié: 20 Aoû 2006, 14:19 

Points d'aide: 0/60

Créations :

Voir ses créations

De rien et pourquoi un screen je vais montrer quoi comment il se deplace il y a deja tout sur le templates^^


Haut
  
 
 Sujet du message: Re: [Heros] 3D isométrique
MessagePublié: 20 Aoû 2006, 14:25 
Bourgeois (Nv 3)

Inscrit le: 16 Aoû 2006, 00:00
Messages: 257
Points d'aide: 0/60

Créations :

Voir ses créations

Non mais ce scripts ne fait pas de l'iso à proprement parler. Normalement il suit des axes à 120°:
Image
Regarder seulement l'image où il est écrit "Isométrie"

Pour parler du script qu'il a poster il ne se déplace pas en suivant ces axes donc il ne sert seulement à se déplacer dans les 8 directions.

Voici un script dont je me sers pour mon Kingdom Hearts (encore secret ;D) qui respectes ses lois:
Code: Tout sélectionner
#--------------------------------------------------------------------------
class Game_Character
#--------------------------------------------------------------------------
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
@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
@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 += 6
# If move animation is OFF, and stop animation is ON
elsif @step_anime
# Increase animation count by 1
@anime_count += 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 = 1
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) and passable?(@x - 2, @y + 1, 1)) or
(passable?(@x, @y, 4) and passable?(@x - 2, @y, 2) and passable?(@x - 2, @y + 1, 1))
# Update coordinates
@x -= 2
@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 = 3
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) and passable?(@x + 2, @y + 1, 1)) or
(passable?(@x, @y, 6) and passable?(@x + 2, @y, 2) and passable?(@x + 2, @y + 1, 1))
# Update coordinates
@x += 2
@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 = 7
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) and passable?(@x - 2, @y - 1, 1)) or
(passable?(@x, @y, 4) and passable?(@x - 2, @y, 8) and passable?(@x - 2, @y - 1, 1))
# Update coordinates
@x -= 2
@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 = 9
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) and passable?(@x + 2, @y - 1, 1)) or
(passable?(@x, @y, 6) and passable?(@x + 2, @y, 8) and passable?(@x + 2, @y - 1, 1))
# Update coordinates
@x += 2
@y -= 1
# Increase steps
increase_steps
end
end
end

class Game_Player < Game_Character
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Remember whether or not moving in local variables
last_moving = moving?
# If moving, event running, move route forcing, and message window
# display are all not occurring
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# Move player in the direction the directional button is being pressed
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
end
# Remember coordinates in local variables
last_real_x = @real_x
last_real_y = @real_y
super
# If character moves down and is positioned lower than the center
# of the screen
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
# Scroll map down
$game_map.scroll_down(@real_y - last_real_y)
end
# If character moves left and is positioned more let on-screen than
# center
if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
# Scroll map left
$game_map.scroll_left(last_real_x - @real_x)
end
# If character moves right and is positioned more right on-screen than
# center
if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
# Scroll map right
$game_map.scroll_right(@real_x - last_real_x)
end
# If character moves up and is positioned higher than the center
# of the screen
if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
# Scroll map up
$game_map.scroll_up(last_real_y - @real_y)
end
# If not moving
unless moving?
# If player was moving last time
if last_moving
# Event determinant is via touch of same position event
result = check_event_trigger_here([1,2])
# If event which started does not exist
if result == false
# Disregard if debug mode is ON and ctrl key was pressed
unless $DEBUG and Input.press?(Input::CTRL)
# Encounter countdown
if @encounter_count > 0
@encounter_count -= 1
end
end
end
end
# If C button was pressed
if Input.trigger?(Input::C)
# Same position and front event determinant
check_event_trigger_here([0])
check_event_trigger_there([0,1,2])
end
end
end
end

class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
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 = 32
self.oy = 64
# 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 / 8
self.ox = @cw / 2
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
dec = (@character.direction == 7 or @character.direction == 9) ? 3 : 1
sy = (@character.direction - dec) * @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)
# Set opacity level, blend method, and bush depth
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
# Animation
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
end
end


Auteur: Je ne sais pas mais il n'est pas de moi.
Utilisation:
Code: Tout sélectionner
@cw = bitmap.width / 9
@ch = bitmap.height / 8

Ceci est à modifier car c'est pour mes charsets à moi.
-La première ligne est le nombre de frames dans l'animation du déplacement du héros. Ceux des RTP en utilise 4 donc il faut remplacer le "9" par le chiffre "4" etc...
-La deuxième ligne représente le nombre de directions donc le 8 n'est pas changer.

Voila.
En ce qui concerne un screen, un screen ne pourra te montrer quoi que se soit car c'est en déplaçant ton héros que tu y verras la différence et comme une image est censé être fixe...
Bref...

J'espère vous avoir été utile.


Haut
 Profil  
 
 Sujet du message: Re: [Heros] 3D isométrique
MessagePublié: 03 Sep 2006, 16:01 
Villageois (Nv 5)

Inscrit le: 29 Aoû 2006, 00:00
Messages: 90
Points d'aide: 0/60

Créations :

Voir ses créations

super script!
Dommage qu'il n'existe pas de ressources déja toutes faites


Haut
 Profil  
 
 Sujet du message: Re: [Heros] 3D isométrique
MessagePublié: 03 Sep 2006, 16:10 
Membre royal très actif

Inscrit le: 11 Aoû 2006, 00:00
Messages: 1521
Points d'aide: 0/60

Créations :

Voir ses créations

qui a dit qu ca n'existait pas?faut bien chercher c'est tout.


Haut
 Profil  
 
Afficher les messages depuis:  Trier par  
Publier un nouveau sujet Répondre au sujet  [ 23 messages ]  Aller à la page 1, 2, 3  Suivant

Heures au format UTC + 1 heure [ Heure d’été ]


Qui est en ligne ?

Utilisateurs parcourant actuellement ce forum : Aucun utilisateur inscrit et 2 invités


Vous ne pouvez pas publier de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas insérer de pièces jointes dans ce forum

Rechercher pour:
Sauter vers:  
cron
RPG Creative Forum version 5 ; Tous droits réservés
phpBB Group (Traduit par Xaphos)
Optimisé pour une résolution 1024*728