Ressource Hunter
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.

Ressource Hunter

RPG Maker, Ressources, Scripts, Tutoriaux, Forum
 
AccueilRechercherDernières imagesS'enregistrerConnexion
Le deal à ne pas rater :
Smartphone 6,8″ Samsung Galaxy S23 Ultra 256Go Noir
799 €
Voir le deal

 

 script changement de map a la zelda

Aller en bas 
AuteurMessage
Karel
Medium
Medium
Karel


Nombre de messages : 126
Age : 32
Localisation : devant toi innocent
Profession : Nirvaniste
Date d'inscription : 21/10/2006

[R~P]
Prénom: Karel
Race: Humain
Métier: Chercheur de quetes, buteur proffesionel

script changement de map a la zelda Empty
MessageSujet: script changement de map a la zelda   script changement de map a la zelda Icon_minitimeDim 26 Nov 2006 - 19:44

Ce script permet de faire une grande map avec plusieurs, et ça se déroule quand on change, comme dans zelda sur game boy Smile
ouvrez l'éditeur de script ( F11 ) et faites un nouveau script au dessus de "Main", nommez le "Big Map" et collez le code ci-dessous.

Utilisation : Tout d'abord il faut faire une grande map vide où l'aire est trois supérieur à la map (ex: une map fait 20*15 alors la grande map fera 60*45)

Ensuite lorsque vous nommez une map, il faut mettre (en vert)

" BM id1 id2 id3 id4 id5 id6 id7 id8 id9 "

id5 représente l'ID de la map où le héros est dessus (ne pas mettre dans le nom)

id1 représente l'ID de la map en haut à gauche par rapport à id5

id2 représente l'ID de la map en haut par rapport à id5

id3 représente l'ID de la map en haut à droite par rapport à id5

id4 représente l'ID de la map à gauche par rapport à id5

id6 représente l'ID de la map à droite par rapport à id5

id7 représente l'ID de la map en bas à gauche par rapport à id5

id8 représente l'ID de la map en bas par rapport à id5

id9 représente l'ID de la map en bas à droite par rapport à id5

_______________________________________________code :


#==============================================================================
# ** EJ Big Map
#------------------------------------------------------------------------------
# EJ
# Version 1
# 2005 April 9
#==============================================================================

#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------

SDK.log('EJ Big Map', 'EJ', 1, '2005-04-09')
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------

if SDK.state('EJ Big Map') == true

class Game_Temp
attr_accessor :map_changed
attr_accessor :player_transferring2
end

class Game_Map
alias ej_bmap_g_map_setup_load setup_load
alias ej_bmap_g_map_setup_events setup_events
#------------------------------------------------------------------------
attr_accessor :big_map
attr_accessor :a_width
attr_accessor :a_height
attr_accessor :a_tl
attr_accessor :a_tc
attr_accessor :a_tr
attr_accessor :a_cl
attr_accessor :a_cr
attr_accessor :a_bl
attr_accessor :a_bc
attr_accessor :a_br
#------------------------------------------------------------------------
BIG_MAP_ID = 1
#------------------------------------------------------------------------
def setup_load

# load the map
ej_bmap_g_map_setup_load

@a_width = @map.width
@a_height = @map.height

# get the area settings

b_name = name.split
if b_name[0] != 'BM'
@big_map = false
return
end

if @big_map != true
$game_temp.map_changed = true
end

@big_map = true

@a_tl = b_name[1].to_i
@a_tc = b_name[2].to_i
@a_tr = b_name[3].to_i

@a_cl = b_name[4].to_i
@a_cr = b_name[5].to_i

@a_bl = b_name[6].to_i
@a_bc = b_name[7].to_i
@a_br = b_name[8].to_i

# load the empty map
@map = load_data(sprintf('Data/Map%03d.rxdata', BIG_MAP_ID))

#top left map
map_b = load_data(sprintf('Data/Map%03d.rxdata', @a_tl))

for z in 0..2
for y in 0..@a_height - 1
for x in 0..@a_width - 1
@map.data[x, y, z] = map_b.data[x, y, z]
end
end
end

#top map
map_b = load_data(sprintf('Data/Map%03d.rxdata', @a_tc))
for z in 0..2
for y in 0..@a_height - 1
for x in 0..@a_width - 1
@map.data[x + @a_width, y, z] = map_b.data[x, y, z]
end
end
end

#top right map
map_b = load_data(sprintf('Data/Map%03d.rxdata', @a_tr))
for z in 0..2
for y in 0..@a_height - 1
for x in 0..@a_width - 1
@map.data[x + (@a_width * 2), y, z] = map_b.data[x, y, z]
end
end
end

#center left map
map_b = load_data(sprintf('Data/Map%03d.rxdata', @a_cl))
for z in 0..2
for y in 0..@a_height - 1
for x in 0..@a_width - 1
@map.data[x, y + @a_height, z] = map_b.data[x, y, z]
end
end
end

#center map
map_b = load_data(sprintf('Data/Map%03d.rxdata', @map_id))
for z in 0..2
for y in 0..@a_height - 1
for x in 0..@a_width - 1
@map.data[x + @a_width, y + @a_height, z] = map_b.data[x, y, z]
end
end
end

#events
@map.events = map_b.events
@map.encounter_list = map_b.encounter_list
@map.encounter_step = map_b.encounter_step

#center right map
map_b = load_data(sprintf('Data/Map%03d.rxdata', @a_cr))
for z in 0..2
for y in 0..@a_height - 1
for x in 0..@a_width - 1
@map.data[x + (@a_width * 2), y + @a_height, z] = map_b.data[x, y, z]
end
end
end

#bottom left map
map_b = load_data(sprintf('Data/Map%03d.rxdata', @a_bl))
for z in 0..2
for y in 0..@a_height - 1
for x in 0..@a_width - 1
@map.data[x, y + (@a_height * 2), z] = map_b.data[x, y, z]
end
end
end

#bottom map
map_b = load_data(sprintf('Data/Map%03d.rxdata', @a_bc))
for z in 0..2
for y in 0..@a_height - 1
for x in 0..@a_width - 1
@map.data[x + @a_width, y+ (@a_height * 2), z] = map_b.data[x, y, z]
end
end
end

#bottom right map
map_b = load_data(sprintf('Data/Map%03d.rxdata', @a_br))
for z in 0..2
for y in 0..@a_height - 1
for x in 0..@a_width - 1
@map.data[x + (@a_width * 2), y +(@a_height * 2), z] = map_b.data[x, y, z]
end
end
end

end
#----------------------------------------------------------------------
def setup_events
ej_bmap_g_map_setup_events

for event in @events.values
event.moveto(event.x + @a_width, event.y + @a_height)
end
end
#----------------------------------------------------------------------
def name
return $map_infos[@map_id]
end
end

class Game_Player < Game_Character
alias ej_bmap_g_player_update update
alias ej_bmap_g_player_moveto moveto
#------------------------------------------------------------------------
def update
if $game_map.big_map == true
unless moving?
if @x == $game_map.a_width and @direction == 4
#left
unless $game_temp.player_transferring and
$game_temp.message_window_showing and
$game_temp.transition_processing
$game_temp.player_transferring = true
$game_temp.player_transferring2 = true
$game_temp.player_new_map_id = $game_map.a_cl
$game_temp.player_new_x = @x + $game_map.a_width
$game_temp.player_new_y = @y
$game_temp.transition_processing = false
end
elsif @y == $game_map.a_height and @direction == 8
#up
unless $game_temp.player_transferring and
$game_temp.message_window_showing and
$game_temp.transition_processing
$game_temp.player_transferring = true
$game_temp.player_transferring2 = true
$game_temp.player_new_map_id = $game_map.a_tc
$game_temp.player_new_x = @x
$game_temp.player_new_y = @y + $game_map.a_height
$game_temp.transition_processing = false
end
elsif @x == ($game_map.a_width*2)-1 and @direction == 6
#right
unless $game_temp.player_transferring and
$game_temp.message_window_showing and
$game_temp.transition_processing
$game_temp.player_transferring = true
$game_temp.player_transferring2 = true
$game_temp.player_new_map_id = $game_map.a_cr
$game_temp.player_new_x = @x - $game_map.a_width
$game_temp.player_new_y = @y
$game_temp.transition_processing = false
end
elsif @y == ($game_map.a_height*2)-1 and @direction == 2
#down
unless $game_temp.player_transferring and
$game_temp.message_window_showing and
$game_temp.transition_processing
$game_temp.player_transferring = true
$game_temp.player_transferring2 = true
$game_temp.player_new_map_id = $game_map.a_bc
$game_temp.player_new_x = @x
$game_temp.player_new_y = @y - $game_map.a_height
$game_temp.transition_processing = false
end
end
end
end
ej_bmap_g_player_update
end
#----------------------------------------------------------------------
def moveto(x,y)
if $game_temp.map_changed == true
ej_bmap_g_player_moveto(x + $game_map.a_width, y + $game_map.a_height)
$game_temp.map_changed = false
else
ej_bmap_g_player_moveto(x, y)
end
end
end

class Scene_Map
alias ej_bmap_s_map_transfer_player transfer_player
#------------------------------------------------------------------------
def transfer_player
if $game_temp.player_transferring2
$game_temp.player_transferring = false
$game_temp.player_transferring2 = false

$game_map.setup($game_temp.player_new_map_id)

$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)

#$game_map.update

@spriteset.dispose
@spriteset = Spriteset_Map.new

$game_map.autoplay

else
ej_bmap_s_map_transfer_player
end
end
end

class Scene_Title
alias ej_bmap_s_title_main main
#------------------------------------------------------------------------
def main
$map_infos = load_data('Data/MapInfos.rxdata')
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
ej_bmap_s_title_main
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------

end # End SDK Check
Revenir en haut Aller en bas
http://jenniferlobez.oldiblog.com/
 
script changement de map a la zelda
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Script du forum add
» Le script jeu de plateforme
» Le script de menu avec tes persos derriere

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Ressource Hunter :: RPG Maker XP :: Scripts :: Proposition de Script-
Sauter vers:  
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser