| Possibilité d'un Multiplayer system VX avec un split screen ? | |
|
Auteur | Message |
---|
Poulet carnivore Lv.2
Age : 32 Inscrit le : 17/01/2010 Messages : 23
| Sujet: Possibilité d'un Multiplayer system VX avec un split screen ? Sam 8 Jan 2011 - 21:01 | |
| Salut à tous, après une très longue absence sur le forum et de mes projets RPG, je veux recommencer sur un projet particulié, mais pour cela j'aurai besoin de plusieurs scripts. J'ai déja celui de Woratana qui marche parfaitement, mais ce que je trouve dommage, il n'y a pas le split screen comme il y a déjà eut dans un script sur rpg maker xp. http://www.mediafire.com/?mykm33nmyij. Donc ce que j'aimerai savoir, es-ce possible d'avoir ce même script pour rpg maker vx? Merci |
|
| |
Age : 134 Inscrit le : 14/04/2009 Messages : 1321
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Sam 8 Jan 2011 - 21:06 | |
| A quoi sert ce script exactement ? |
|
| |
Maître des Duels
Age : 32 Inscrit le : 29/07/2009 Messages : 7841
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Sam 8 Jan 2011 - 21:13 | |
| J'ai pas envie de dl une démo juste pour des précisions perso.
Enfin, j'ai jamais vu un tel script, et j'imagine que le gérer devrait être horriblement chiant.
Donc sauf si tu sais coder, y'a peu d'espoir. |
|
| |
Poulet carnivore Lv.2
Age : 32 Inscrit le : 17/01/2010 Messages : 23
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Sam 8 Jan 2011 - 21:53 | |
| Désoler c'est ma faute d'avoir oublier d'expliquer ce système. Premièrement, il permet d'avoir deux héros sur la carte et de les bouger tout les deux avec différentes touches. Deuxièmement, l'écran est divisé en deux, donc chaques personnages à sont propre écran. Je pense avoir tout dis. |
|
| |
Age : 134 Inscrit le : 14/04/2009 Messages : 1321
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Sam 8 Jan 2011 - 21:57 | |
| Ah, daccord !
Mais je pense que Zang' a raison. A gérer, ça doit etre affreux.
Arty' |
|
| |
Poulet carnivore Lv.2
Age : 32 Inscrit le : 17/01/2010 Messages : 23
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Sam 8 Jan 2011 - 22:23 | |
| Oui je sais justement je le sais qu'il y a plusieurs scripts à gérer, c'est pour cela je demande si ce genre de travail peut être réaliser. |
|
| |
Maître des Duels
Age : 32 Inscrit le : 29/07/2009 Messages : 7841
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Sam 8 Jan 2011 - 22:48 | |
| C'est pas plusieurs scripts à gérer. C'est tout un système à dupliquer.
Oui, tout va devoir être créé en double étant donné qu'il y aura deux écrans. Enfin peut y avoir une solution moins couteuse en ressources...
M'enfin je ne pense pas que quelqu'un ici pourrait s'y pencher ( tu peux toujours attendre, sait on jamais ^^ ), mais ce genre de système me parait trop compliqué et trop peu utile pour une plateforme RPG maker. |
|
| |
Poulet carnivore Lv.2
Age : 32 Inscrit le : 17/01/2010 Messages : 23
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Dim 9 Jan 2011 - 2:27 | |
| Oui c'est sur j'ai pas le choix d'attendre Mais c'est aussi pour cela que j'ai mis le système de celui sur rpg maker xp. Sa peut donner des pistes ou être bien utile et voir comment il fonctionne. De plus, je rajoute une image d'un vieux projet non fini que j'avais fait sur rpg maker xp: |
|
| |
Poulet trizo Lv.3
Age : 27 Inscrit le : 07/01/2011 Messages : 35
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Dim 9 Jan 2011 - 11:52 | |
| Jipitou, en allant fouiller sur le net j'ai découvert le script que tu recherches (Trouver sur un autre forum) :je ris fortement: Lien : http://www.rpg-maker.fr/scripts-134-placer-un-2em-joueur-jouable-sur-la-carte.html
En espérent t'avoir aider ^^ |
|
| |
Maître des Duels
Age : 32 Inscrit le : 29/07/2009 Messages : 7841
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Dim 9 Jan 2011 - 12:41 | |
| - jipitou a écrit:
- il n'y a pas le split screen [...], es-ce possible d'avoir ce même script pour rpg maker vx?
Hum, c'est drôle, je jurerais qu'il avait demandé un script d'écran partagé. |
|
| |
Poulet trizo Lv.3
Age : 27 Inscrit le : 07/01/2011 Messages : 35
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Dim 9 Jan 2011 - 14:36 | |
| |
|
| |
Maître des Duels
Age : 32 Inscrit le : 29/07/2009 Messages : 7841
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Dim 9 Jan 2011 - 14:37 | |
| C'est pas une histoire de faire mieux. Il a déjà le script, c'est pas parce que tu vas lui donner qu'il va être plus avancé... |
|
| |
Poulet carnivore Lv.2
Age : 32 Inscrit le : 17/01/2010 Messages : 23
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Dim 9 Jan 2011 - 14:38 | |
| De plus j'avais dit - Citation :
- J'ai déja celui de Woratana qui marche parfaitement
Et c'est bien le script dont je parlais Tk ce n'est pas plus grave que cela merci quand même d'avoir essayé |
|
| |
Poulet trizo Lv.3
Age : 27 Inscrit le : 07/01/2011 Messages : 35
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Dim 9 Jan 2011 - 14:38 | |
| Ah...bon pg Je me confonds en excuses... :s |
|
| |
Poulet carnivore Lv.2
Age : 32 Inscrit le : 17/01/2010 Messages : 23
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Sam 29 Jan 2011 - 19:30 | |
| Je vais rajouter pour ceux qui n'ont pas RMXP les scripts de ce système. Je met les credits tout de suite: Créateur de ce script: Luis et Near Fantastica Premièrement, ce script doit être placé dans un nouveau script en-dessous de Game_Player:- Spoiler:
- Code:
-
#================================================= ============================= # ** Game_Player2 #------------------------------------------------------------------------------ # 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. #================================================= ============================= #By: Luis #================================================= =============================
class Game_Player2 < Game_Character #-------------------------------------------------------------------------- # * Invariables #-------------------------------------------------------------------------- CENTER_X = (320 - 16) * 4 # Center screen x-coordinate * 4 CENTER_Y = (240 - 16) * 4 # Center screen y-coordinate * 4 #-------------------------------------------------------------------------- # * Passable Determinants # x : x-coordinate # y : y-coordinate # d : direction (0,2,4,6,8) # * 0 = Determines if all directions are impassable (for jumping) #-------------------------------------------------------------------------- def passable?(x, y, d) # Get new coordinates new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0) new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0) # If coordinates are outside of map unless $game_map.valid?(new_x, new_y) # Impassable return false end # If debug mode is ON and ctrl key was pressed if $DEBUG and Input.press?(Input::CTRL) # Passable return true end super end #-------------------------------------------------------------------------- # * Set Map Display Position to Center of Screen #-------------------------------------------------------------------------- def center(x, y) max_x = ($game_map.width - 20) * 128 max_y = ($game_map.height - 15) * 128 $game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max $game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max end #-------------------------------------------------------------------------- # * Move to Designated Position # x : x-coordinate # y : y-coordinate #-------------------------------------------------------------------------- def moveto(x, y) super # Centering center(x, y) # Make encounter count make_encounter_count end #-------------------------------------------------------------------------- # * Increaase Steps #-------------------------------------------------------------------------- def increase_steps super # If move route is not forcing unless @move_route_forcing # Increase steps $game_party.increase_steps # Number of steps are an even number if $game_party.steps % 2 == 0 # Slip damage check $game_party.check_map_slip_damage end end end #-------------------------------------------------------------------------- # * Get Encounter Count #-------------------------------------------------------------------------- def encounter_count return @encounter_count end #-------------------------------------------------------------------------- # * Make Encounter Count #-------------------------------------------------------------------------- def make_encounter_count # Image of two dice rolling if $game_map.map_id != 0 n = $game_map.encounter_step @encounter_count = rand(n) + rand(n) + 1 end end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh # If party members = 0 if $game_party.actors.size == 0 # Clear character file name and hue @character_name = "" @character_hue = 0 # End method return end # Get lead actor actor = $game_party.actors[1] # Set character file name and hue @character_name = actor.character_name @character_hue = actor.character_hue # Initialize opacity level and blending method @opacity = 255 @blend_type = 0 end #-------------------------------------------------------------------------- # * Same Position Starting Determinant #-------------------------------------------------------------------------- def check_event_trigger_here(triggers) result = false # If event is running if $game_system.map_interpreter.running? return result end # All event loops for event in $game_map.events.values # If event coordinates and triggers are consistent if event.x == @x and event.y == @y and triggers.include?(event.trigger) # If starting determinant is same position event (other than jumping) if not event.jumping? and event.over_trigger? event.start result = true end end end return result end #-------------------------------------------------------------------------- # * Front Envent Starting Determinant #-------------------------------------------------------------------------- def check_event_trigger_there(triggers) result = false # If event is running if $game_system.map_interpreter.running? return result end # Calculate front event coordinates new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0) new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0) # All event loops for event in $game_map.events.values # If event coordinates and triggers are consistent if event.x == new_x and event.y == new_y and triggers.include?(event.trigger) # If starting determinant is front event (other than jumping) if not event.jumping? and not event.over_trigger? event.start result = true end end end # If fitting event is not found if result == false # If front tile is a counter if $game_map.counter?(new_x, new_y) # Calculate 1 tile inside coordinates new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0) new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0) # All event loops for event in $game_map.events.values # If event coordinates and triggers are consistent if event.x == new_x and event.y == new_y and triggers.include?(event.trigger) # If starting determinant is front event (other than jumping) if not event.jumping? and not event.over_trigger? event.start result = true end end end end end return result end #-------------------------------------------------------------------------- # * Touch Event Starting Determinant #-------------------------------------------------------------------------- def check_event_trigger_touch(x, y) result = false # If event is running if $game_system.map_interpreter.running? return result end # All event loops for event in $game_map.events.values # If event coordinates and triggers are consistent if event.x == x and event.y == y and [1,2].include?(event.trigger) # If starting determinant is front event (other than jumping) if not event.jumping? and not event.over_trigger? event.start result = true end end end return result end #-------------------------------------------------------------------------- # * 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 if Keyboard.pressed?(83) move_down elsif Keyboard.pressed?(65) move_left elsif Keyboard.pressed?(68) move_right elsif Keyboard.pressed?(87) # W move_up 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 "tab" button was pressed if Keyboard.pressed?(9) # Same position and front event determinant check_event_trigger_here([0]) check_event_trigger_there([0,1,2]) end end end end
Deuxièmement, au dessus de tout les scripts:- Spoiler:
- Code:
-
#====================================== # ■ Keyboard Input Module #====================================== # By: Near Fantastica # Date: 06.07.05 # Version: 3 #====================================== module Keyboard #----------------------------------------------------------- @keys = [] @pressed = [] Mouse_Left = 1 Mouse_Right = 2 Back= 8 Tab = 9 Enter = 13 Shift = 16 Ctrl = 17 Alt = 18 Esc = 27 Space = 32 Numberkeys = {} Numberkeys[0] = 48 Numberkeys[1] = 49 Numberkeys[2] = 50 Numberkeys[3] = 51 Numberkeys[4] = 52 Numberkeys[5] = 53 Numberkeys[6] = 54 Numberkeys[7] = 55 Numberkeys[8] = 56 Numberkeys[9] = 57 Numberpad = {} Numberpad[0] = 45 Numberpad[1] = 35 Numberpad[2] = 40 Numberpad[3] = 34 Numberpad[4] = 37 Numberpad[5] = 12 Numberpad[6] = 39 Numberpad[7] = 36 Numberpad[8] = 38 Numberpad[9] = 33 Letters = {} Letters["A"] = 65 Letters["B"] = 66 Letters["C"] = 67 Letters["D"] = 68 Letters["E"] = 69 Letters["F"] = 70 Letters["G"] = 71 Letters["H"] = 72 Letters["I"] = 73 Letters["J"] = 74 Letters["K"] = 75 Letters["L"] = 76 Letters["M"] = 77 Letters["N"] = 78 Letters["O"] = 79 Letters["P"] = 80 Letters["Q"] = 81 Letters["R"] = 82 Letters["S"] = 83 Letters["T"] = 84 Letters["U"] = 85 Letters["V"] = 86 Letters["W"] = 87 Letters["X"] = 88 Letters["Y"] = 89 Letters["Z"] = 90 Fkeys = {} Fkeys[1] = 112 Fkeys[2] = 113 Fkeys[3] = 114 Fkeys[4] = 115 Fkeys[5] = 116 Fkeys[6] = 117 Fkeys[7] = 118 Fkeys[8] = 119 Fkeys[9] = 120 Fkeys[10] = 121 Fkeys[11] = 122 Fkeys[12] = 123 Collon = 186 Equal = 187 Comma = 188 Underscore = 189 Dot = 190 Backslash = 191 Lb = 219 Rb = 221 Quote = 222 State = Win32API.new("user32","GetKeyState",['i'],'i') Key = Win32API.new("user32","GetAsyncKeyState",['i'],'i') #-------------------------------------------------------------------------- def Keyboard.getstate(key) return true unless State.call(key).between?(0, 1) return false end #-------------------------------------------------------------------------- def Keyboard.testkey(key) Key.call(key) & 0x01 == 1 end #-------------------------------------------------------------------------- def Keyboard.update @keys = [] @keys.push(Keyboard::Mouse_Left) if Keyboard.testkey(Keyboard::Mouse_Left) @keys.push(Keyboard::Mouse_Right) if Keyboard.testkey(Keyboard::Mouse_Right) @keys.push(Keyboard::Back) if Keyboard.testkey(Keyboard::Back) @keys.push(Keyboard::Tab) if Keyboard.testkey(Keyboard::Tab) @keys.push(Keyboard::Enter) if Keyboard.testkey(Keyboard::Enter) @keys.push(Keyboard:hift) if Keyboard.testkey(Keyboard:hift) @keys.push(Keyboard::Ctrl) if Keyboard.testkey(Keyboard::Ctrl) @keys.push(Keyboard::Alt) if Keyboard.testkey(Keyboard::Alt) @keys.push(Keyboard::Esc) if Keyboard.testkey(Keyboard::Esc) @keys.push(Keyboard:pace) if Keyboard.testkey(Keyboard:pace) for key in Keyboard::Numberkeys.values @keys.push(key) if Keyboard.testkey(key) end for key in Keyboard::Numberpad.values @keys.push(key) if Keyboard.testkey(key) end for key in Keyboard::Letters.values @keys.push(key) if Keyboard.testkey(key) end for key in Keyboard::Fkeys.values @keys.push(key) if Keyboard.testkey(key) end @keys.push(Keyboard::Collon) if Keyboard.testkey(Keyboard::Collon) @keys.push(Keyboard::Equal) if Keyboard.testkey(Keyboard::Equal) @keys.push(Keyboard::Comma) if Keyboard.testkey(Keyboard::Comma) @keys.push(Keyboard::Underscore) if Keyboard.testkey(Keyboard::Underscore) @keys.push(Keyboard:ot) if Keyboard.testkey(Keyboard:ot) @keys.push(Keyboard::Backslash) if Keyboard.testkey(Keyboard::Backslash) @keys.push(Keyboard::Lb) if Keyboard.testkey(Keyboard::Lb) @keys.push(Keyboard::Rb) if Keyboard.testkey(Keyboard::Rb) @keys.push(Keyboard::Quote) if Keyboard.testkey(Keyboard::Quote) @pressed = [] @pressed.push(Keyboard::Mouse_Left) if Keyboard.getstate(Keyboard::Mouse_Left) @pressed.push(Keyboard::Mouse_Right) if Keyboard.getstate(Keyboard::Mouse_Right) @pressed.push(Keyboard::Back) if Keyboard.getstate(Keyboard::Back) @pressed.push(Keyboard::Tab) if Keyboard.getstate(Keyboard::Tab) @pressed.push(Keyboard::Enter) if Keyboard.getstate(Keyboard::Enter) @pressed.push(Keyboard:hift) if Keyboard.getstate(Keyboard:hift) @pressed.push(Keyboard::Ctrl) if Keyboard.getstate(Keyboard::Ctrl) @pressed.push(Keyboard::Alt) if Keyboard.getstate(Keyboard::Alt) @pressed.push(Keyboard::Esc) if Keyboard.getstate(Keyboard::Esc) @pressed.push(Keyboard:pace) if Keyboard.getstate(Keyboard:pace) for key in Keyboard::Numberkeys.values @pressed.push(key) if Keyboard.getstate(key) end for key in Keyboard::Numberpad.values @pressed.push(key) if Keyboard.getstate(key) end for key in Keyboard::Letters.values @pressed.push(key) if Keyboard.getstate(key) end for key in Keyboard::Fkeys.values @pressed.push(key) if Keyboard.getstate(key) end @pressed.push(Keyboard::Collon) if Keyboard.getstate(Keyboard::Collon) @pressed.push(Keyboard::Equal) if Keyboard.getstate(Keyboard::Equal) @pressed.push(Keyboard::Comma) if Keyboard.getstate(Keyboard::Comma) @pressed.push(Keyboard::Underscore) if Keyboard.getstate(Keyboard::Underscore) @pressed.push(Keyboard:ot) if Keyboard.getstate(Keyboard:ot) @pressed.push(Keyboard::Backslash) if Keyboard.getstate(Keyboard::Backslash) @pressed.push(Keyboard::Lb) if Keyboard.getstate(Keyboard::Lb) @pressed.push(Keyboard::Rb) if Keyboard.getstate(Keyboard::Rb) @pressed.push(Keyboard::Quote) if Keyboard.getstate(Keyboard::Quote) end #-------------------------------------------------------------------------- def Keyboard.trigger?(key) return true if @keys.include?(key) return false end #-------------------------------------------------------------------------- def Keyboard.pressed?(key) return true if @pressed.include?(key) return false end end
Troisièmement, il faut remplacez Spriteset_map par cela:- Spoiler:
- Code:
-
#================================================= ============================= # ** 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[i] @tilemap.autotiles[i] = 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[i]) @character_sprites.push(sprite) end @character_sprites.push(Sprite_Character.new(@view port1, $game_player)) @character_sprites.push(Sprite_Character.new(@view port1, $game_player2)) # Make weather @weather = RPG::Weather.new(@viewport1) # Make picture sprites @picture_sprites = [] for i in 1..50 @picture_sprites.push(Sprite_Picture.new(@viewport 2, $game_screen.pictures[i])) 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[i].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
Quatrièmement, remplacez Scene_title par cela:- Spoiler:
- Code:
-
#================================================= ============================= # ** Scene_Title #------------------------------------------------------------------------------ # This class performs title screen processing. #================================================= =============================
class Scene_Title #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # If battle test if $BTEST battle_test return end # Load database $data_actors = load_data("Data/Actors.rxdata") $data_classes = load_data("Data/Classes.rxdata") $data_skills = load_data("Data/Skills.rxdata") $data_items = load_data("Data/Items.rxdata") $data_weapons = load_data("Data/Weapons.rxdata") $data_armors = load_data("Data/Armors.rxdata") $data_enemies = load_data("Data/Enemies.rxdata") $data_troops = load_data("Data/Troops.rxdata") $data_states = load_data("Data/States.rxdata") $data_animations = load_data("Data/Animations.rxdata") $data_tilesets = load_data("Data/Tilesets.rxdata") $data_common_events = load_data("Data/CommonEvents.rxdata") $data_system = load_data("Data/System.rxdata") # Make system object $game_system = Game_System.new # Make title graphic @sprite = Sprite.new @sprite.bitmap = RPG::Cache.title($data_system.title_name) # Make command window s1 = "New Game" s2 = "Continue" s3 = "Shutdown" @command_window = Window_Command.new(192, [s1, s2, s3]) @command_window.back_opacity = 160 @command_window.x = 320 - @command_window.width / 2 @command_window.y = 288 # Continue enabled determinant # Check if at least one save file exists # If enabled, make @continue_enabled true; if disabled, make it false @continue_enabled = false for i in 0..3 if FileTest.exist?("Save#{i+1}.rxdata") @continue_enabled = true end end # If continue is enabled, move cursor to "Continue" # If disabled, display "Continue" text in gray if @continue_enabled @command_window.index = 1 else @command_window.disable_item(1) end # Play title BGM $game_system.bgm_play($data_system.title_bgm) # Stop playing ME and BGS Audio.me_stop Audio.bgs_stop # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of command window @command_window.dispose # Dispose of title graphic @sprite.bitmap.dispose @sprite.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update command window @command_window.update # If C button was pressed if Input.trigger?(Input::C) or Keyboard.pressed?(9) # Branch by command window cursor position case @command_window.index when 0 # New game command_new_game when 1 # Continue command_continue when 2 # Shutdown command_shutdown end end end #-------------------------------------------------------------------------- # * Command: New Game #-------------------------------------------------------------------------- def command_new_game # Play decision SE $game_system.se_play($data_system.decision_se) # Stop BGM Audio.bgm_stop # Reset frame count for measuring play time Graphics.frame_count = 0 # Make each type of game object $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new $game_player2 = Game_Player2.new # Set up initial party $game_party.setup_starting_members # Set up initial map position $game_map.setup($data_system.start_map_id) # Move player to initial position $game_player.moveto($data_system.start_x, $data_system.start_y) $game_player2.moveto($data_system.start_x + 1, $data_system.start_y) # Refresh player $game_player.refresh $game_player2.refresh # Run automatic change for BGM and BGS set with map $game_map.autoplay # Update map (run parallel process event) $game_map.update # Switch to map screen $scene = Scene_Map.new end #-------------------------------------------------------------------------- # * Command: Continue #-------------------------------------------------------------------------- def command_continue # If continue is disabled unless @continue_enabled # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # Switch to load screen $scene = Scene_Load.new end #-------------------------------------------------------------------------- # * Command: Shutdown #-------------------------------------------------------------------------- def command_shutdown # Play decision SE $game_system.se_play($data_system.decision_se) # Fade out BGM, BGS, and ME Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # Shutdown $scene = nil end #-------------------------------------------------------------------------- # * Battle Test #-------------------------------------------------------------------------- def battle_test # Load database (for battle test) $data_actors = load_data("Data/BT_Actors.rxdata") $data_classes = load_data("Data/BT_Classes.rxdata") $data_skills = load_data("Data/BT_Skills.rxdata") $data_items = load_data("Data/BT_Items.rxdata") $data_weapons = load_data("Data/BT_Weapons.rxdata") $data_armors = load_data("Data/BT_Armors.rxdata") $data_enemies = load_data("Data/BT_Enemies.rxdata") $data_troops = load_data("Data/BT_Troops.rxdata") $data_states = load_data("Data/BT_States.rxdata") $data_animations = load_data("Data/BT_Animations.rxdata") $data_tilesets = load_data("Data/BT_Tilesets.rxdata") $data_common_events = load_data("Data/BT_CommonEvents.rxdata") $data_system = load_data("Data/BT_System.rxdata") # Reset frame count for measuring play time Graphics.frame_count = 0 # Make each game object $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new $game_player2 = Game_Player2.new # Set up party for battle test $game_party.setup_battle_test_members # Set troop ID, can escape flag, and battleback $game_temp.battle_troop_id = $data_system.test_troop_id $game_temp.battle_can_escape = true $game_map.battleback_name = $data_system.battleback_name # Play battle start SE $game_system.se_play($data_system.battle_start_se) # Play battle BGM $game_system.bgm_play($game_system.battle_bgm) # Switch to battle screen $scene = Scene_Battle.new end end
Cinquièmement, remplacez Scene_Map par cela:- Spoiler:
- Code:
-
#================================================= ============================= # ** Scene_Map #------------------------------------------------------------------------------ # This class performs map screen processing. #================================================= =============================
class Scene_Map #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make sprite set @spriteset = Spriteset_Map.new # Make message window @message_window = Window_Message.new # Transition run Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update Keyboard.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of sprite set @spriteset.dispose # Dispose of message window @message_window.dispose # If switching to title screen if $scene.is_a?(Scene_Title) # Fade out screen Graphics.transition Graphics.freeze end end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Loop loop do # Update map, interpreter, and player order # (this update order is important for when conditions are fulfilled # to run any event, and the player isn't provided the opportunity to # move in an instant) $game_map.update $game_system.map_interpreter.update $game_player.update $game_player2.update # Update system (timer), screen $game_system.update $game_screen.update # Abort loop if player isn't place moving unless $game_temp.player_transferring break end # Run place move transfer_player # Abort loop if transition processing if $game_temp.transition_processing break end end # Update sprite set @spriteset.update # Update message window @message_window.update # If game over if $game_temp.gameover # Switch to game over screen $scene = Scene_Gameover.new return end # If returning to title screen if $game_temp.to_title # Change to title screen $scene = Scene_Title.new return end # If transition processing if $game_temp.transition_processing # Clear transition processing flag $game_temp.transition_processing = false # Execute transition if $game_temp.transition_name == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $game_temp.transition_name) end end # If showing message window if $game_temp.message_window_showing return end # If encounter list isn't empty, and encounter count is 0 if $game_player.encounter_count == 0 and $game_map.encounter_list != [] # If event is running or encounter is not forbidden unless $game_system.map_interpreter.running? or $game_system.encounter_disabled # Confirm troop n = rand($game_map.encounter_list.size) troop_id = $game_map.encounter_list[n] # If troop is valid if $data_troops[troop_id] != nil # Set battle calling flag $game_temp.battle_calling = true $game_temp.battle_troop_id = troop_id $game_temp.battle_can_escape = true $game_temp.battle_can_lose = false $game_temp.battle_proc = nil end end end # If B button was pressed if Input.trigger?(Input::B) # If event is running, or menu is not forbidden unless $game_system.map_interpreter.running? or $game_system.menu_disabled # Set menu calling flag or beep flag $game_temp.menu_calling = true $game_temp.menu_beep = true end end # If debug mode is ON and F9 key was pressed if $DEBUG and Input.press?(Input::F9) # Set debug calling flag $game_temp.debug_calling = true end # If player is not moving unless $game_player.moving? # Run calling of each screen if $game_temp.battle_calling call_battle elsif $game_temp.shop_calling call_shop elsif $game_temp.name_calling call_name elsif $game_temp.menu_calling call_menu elsif $game_temp.save_calling call_save elsif $game_temp.debug_calling call_debug end end end #-------------------------------------------------------------------------- # * Battle Call #-------------------------------------------------------------------------- def call_battle # Clear battle calling flag $game_temp.battle_calling = false # Clear menu calling flag $game_temp.menu_calling = false $game_temp.menu_beep = false # Make encounter count $game_player.make_encounter_count # Memorize map BGM and stop BGM $game_temp.map_bgm = $game_system.playing_bgm $game_system.bgm_stop # Play battle start SE $game_system.se_play($data_system.battle_start_se) # Play battle BGM $game_system.bgm_play($game_system.battle_bgm) # Straighten player position $game_player.straighten $game_player2.straighten # Switch to battle screen $scene = Scene_Battle.new end #-------------------------------------------------------------------------- # * Shop Call #-------------------------------------------------------------------------- def call_shop # Clear shop call flag $game_temp.shop_calling = false # Straighten player position $game_player.straighten $game_player2.straighten # Switch to shop screen $scene = Scene_Shop.new end #-------------------------------------------------------------------------- # * Name Input Call #-------------------------------------------------------------------------- def call_name # Clear name input call flag $game_temp.name_calling = false # Straighten player position $game_player.straighten $game_player2.straighten # Switch to name input screen $scene = Scene_Name.new end #-------------------------------------------------------------------------- # * Menu Call #-------------------------------------------------------------------------- def call_menu # Clear menu call flag $game_temp.menu_calling = false # If menu beep flag is set if $game_temp.menu_beep # Play decision SE $game_system.se_play($data_system.decision_se) # Clear menu beep flag $game_temp.menu_beep = false end # Straighten player position $game_player.straighten $game_player2.straighten # Switch to menu screen $scene = Scene_Menu.new end #-------------------------------------------------------------------------- # * Save Call #-------------------------------------------------------------------------- def call_save # Straighten player position $game_player.straighten $game_player2.straighten # Switch to save screen $scene = Scene_Save.new end #-------------------------------------------------------------------------- # * Debug Call #-------------------------------------------------------------------------- def call_debug # Clear debug call flag $game_temp.debug_calling = false # Play decision SE $game_system.se_play($data_system.decision_se) # Straighten player position $game_player.straighten $game_player2.straighten # Switch to debug screen $scene = Scene_Debug.new end #-------------------------------------------------------------------------- # * Player Place Move #-------------------------------------------------------------------------- def transfer_player # Clear player place move call flag $game_temp.player_transferring = false # If move destination is different than current map if $game_map.map_id != $game_temp.player_new_map_id # Set up a new map $game_map.setup($game_temp.player_new_map_id) end # Set up player position $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y) $game_player2.moveto($game_temp.player2_new_x, $game_temp.player2_new_y) # Set player direction case $game_temp.player_new_direction when 2 # down $game_player.turn_down $game_player2.turn_down when 4 # left $game_player.turn_left $game_player2.turn_left when 6 # right $game_player.turn_right $game_player2.turn_right when 8 # up $game_player.turn_up $game_player2.turn_up end # Straighten player position $game_player.straighten $game_player2.straighten # Update map (run parallel process event) $game_map.update # Remake sprite set @spriteset.dispose @spriteset = Spriteset_Map.new # If processing transition if $game_temp.transition_processing # Clear transition processing flag $game_temp.transition_processing = false # Execute transition Graphics.transition(20) end # Run automatic change for BGM and BGS set on the map $game_map.autoplay # Frame reset Graphics.frame_reset # Update input information Input.update end end
Sixièmement, changez ceci dans Window_Message:- Spoiler:
- Code:
-
# If message is being displayed if @contents_showing # If choice isn't being displayed, show pause sign if $game_temp.choice_max == 0 self.pause = true end # Cancel if Input.trigger?(Input::B) if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0 $game_system.se_play($data_system.cancel_se) $game_temp.choice_proc.call($game_temp.choice_canc el_type - 1) terminate_message end end # Confirm if Input.trigger?(Input::C) if $game_temp.choice_max > 0 $game_system.se_play($data_system.decision_se) $game_temp.choice_proc.call(self.index) end terminate_message end return end
Par cela:- Spoiler:
- Code:
-
# If message is being displayed if @contents_showing # If choice isn't being displayed, show pause sign if $game_temp.choice_max == 0 self.pause = true end # Cancel if Input.trigger?(Input::B) or Keyboard.pressed?(19) if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0 $game_system.se_play($data_system.cancel_se) $game_temp.choice_proc.call($game_temp.choice_canc el_type - 1) terminate_message end end # Confirm if Input.trigger?(Input::C) or Keyboard.pressed?(9) if $game_temp.choice_max > 0 $game_system.se_play($data_system.decision_se) $game_temp.choice_proc.call(self.index) end terminate_message end return end
Et pour finir, ajoutez cela dans Scene_Save: - Code:
-
Marshal.dump($game_player2, file) Sous: - Code:
-
Marshal.dump($game_player, file) Et cela dans Scene_Load: - Code:
-
$game_player2 = Marshal.load(file) Sous: - Code:
-
$game_player = Marshal.load(file) J'espère que cela pourra aider une personne à réaliser ce système dont je ne suis pas le seul à rechercher d'après plusieurs recherches sur des forums français et anglais. Merci |
|
| |
Habitant Lv.6
Age : 28 Inscrit le : 16/08/2009 Messages : 120
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? Mar 1 Fév 2011 - 17:47 | |
| A pire, si tu tiens tant que ça à faire un double écran... Tu duplique ta carte en 2, en faisant une raie noire au milieu. J'ai jamais essayé le script pour 2 joueurs, donc je sais pas si tu peux choisir la position de base des 2 héros... Je dis ça comme ça, hein... |
|
| |
| Sujet: Re: Possibilité d'un Multiplayer system VX avec un split screen ? | |
| |
|
| |
| Possibilité d'un Multiplayer system VX avec un split screen ? | |
|