[REQUEST] Multiplayer Script [XP]

Started by punk_Blood, September 26, 2010, 03:40:27 am

Previous topic - Next topic

punk_Blood

Any of you have or can make a multiplayer script for XP? Same computer 2-players


2-player, screen doesnt follow player 2... or if you have a split screen thats cool too
just because im dead doesnt mean that i cant be alive

stripe103

I found this script once on rmrk.net but I can't find it anymore. It had a lot of bugs anyway so it wasn't that good. The second player could only walk, he couldn't click on things or trigger a battle. But maybe if you find it, you can make it better.

cyclope

Things I Hate

1. People who point at their wrist asking for the time... I know where my watch is pal, where the hell is yours? Do I point at my crotch when I ask where the toilet is?

2. People who are willing to get off their a** to search the entire room for the TV remote because they refuse to walk to the TV and change the channel manually.

3. When people say "Oh you just want to have your cake and eat it too". Damn Right! What good is cake if you can't eat it?

4. When people say "it's always the last place you look". Of course it is. Why the hell would you keep looking after you've found it? Do people do this? Who and where are they?

5. When people say while watching a film, "did ya see that?" No Loser, I paid $12 to come to the cinema and stare at the damn floor!

6. People who ask "Can I ask you a question?"... Didn't give me a choice there, did ya sunshine?

Event Master

October 09, 2010, 05:33:17 pm #3 Last Edit: October 13, 2010, 07:49:02 pm by Event Master
Here, this is way better if you are using Blizz-ABS
Make a paralell common event with the same conditional branch as in the demo (Input.press?(Input::Key['Q']) or whatever key you want.
Make in that conditional branch a script call
$BlizzABS.actors[1].direction_fix = false
$BlizzABS.actors[1].move_down
$BlizzABS.actors[1].direction_fix = true


You can take out the $BlizzABS.actors[1].direction_fix = false and $BlizzABS.actors[1].direction_fix = true but that prevents your charecter from freezing up if they try to mave into an unpassable tile.

Change .move_down to .move_left .move_right or .move_down

This is only for Blizz-Abs if caterpillar is On, and the charecter will follow you in game, so you must use
$game_system.caterpillar_active = false

to turn off the caterpillar in game, so the charecters will be displayed, but not follow you.

Additionally you can have the same conditional statement and have
$BlizzABS.actors[1].use_attack

to make player 2 attack, but the AI isn't turned off for that charecter, so it will still automatically use skills and attack on it's own.

I really don't suggest that you use this for a traditional RPG or Action RPG. It fits the game that I am making, but probably nobody else.
This is only good if you want to make it if Player 2 can controll that charecter, but still have that charecter think for itself.

Remember, you can use 2 instead of 1 to controll the next charecter, and so on.

I was working on a simple split screen script, but it's really only some slight modifications to Spriteset_Map
#==============================================================================
# ** 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, 319, 480)
   @viewport2 = Viewport.new(0, 0, 319, 480)
   @viewport3 = Viewport.new(0, 0, 319, 480)
   @viewport2.z = 200
   @viewport3.z = 5000
   @viewport4 = Viewport.new(321, 0, 319, 480)
   @viewport5 = Viewport.new(321, 0, 319, 480)
   @viewport6 = Viewport.new(321, 0, 319, 480)
   @viewport5.z = 200
   @viewport6.z = 5000
   # Make tilemap
   @tilemap = Tilemap.new(@viewport1)
   @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
   @tilemap2 = Tilemap.new(@viewport4)
   @tilemap2.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)
     @tilemap2.autotiles[i] = RPG::Cache.autotile(autotile_name)
   end
   @tilemap.map_data = $game_map.data
   @tilemap.priorities = $game_map.priorities
   @tilemap2.map_data = $game_map.data
   @tilemap2.priorities = $game_map.priorities
   # Make panorama plane
   @panorama = Plane.new(@viewport1)
   @panorama.z = -1000
   @panorama2 = Plane.new(@viewport4)
   @panorama2.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)
     sprite2 = Sprite_Character.new(@viewport4, $game_map.events[i])
     @character_sprites.push(sprite2)
   end
   @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
   @character_sprites.push(Sprite_Character.new(@viewport4, $game_player))
   # Make weather
   @weather = RPG::Weather.new(@viewport1)
   @weather = RPG::Weather.new(@viewport2)
   # Make picture sprites
   @picture_sprites = []
   for i in 1..50
     @picture_sprites.push(Sprite_Picture.new(@viewport2,
       $game_screen.pictures[i]))
     @picture_sprites.push(Sprite_Picture.new(@viewport5,
       $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
   @tilemap2.tileset.dispose
   for i in 0..6
     @tilemap.autotiles[i].dispose
     @tilemap2.autotiles[i].dispose
   end
   @tilemap.dispose
   @tilemap2.dispose
   # Dispose of panorama plane
   @panorama.dispose
   @panorama2.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
   @viewport4.dispose
   @viewport5.dispose
   @viewport6.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
   @tilemap2.ox = $game_map.display_x / 4
   @tilemap2.oy = $game_map.display_y / 4
   @tilemap2.update
   # Update panorama plane
   @panorama.ox = $game_map.display_x / 8
   @panorama.oy = $game_map.display_y / 8
   @panorama2.ox = $game_map.display_x / 8
   @panorama2.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
   @viewport4.tone = $game_screen.tone
   @viewport4.ox = $game_screen.shake
   # Set screen flash color
   @viewport3.color = $game_screen.flash_color
   @viewport6.color = $game_screen.flash_color
   # Update viewports
   @viewport1.update
   @viewport3.update
   @viewport4.update
   @viewport6.update
 end
end


This only adds a second window desplaying the charecter. I tried modifing some of the other scripts to make one screen focus on Player 2, but as of now it doesn't work. To do that, lines 146 and 147 need to be modified to disply anther variable, and It doesn't center on the player, but I'm trying!

EDIT

Okay, I got it to center on your player, but I had to modify the Blizz-ABS script and a few others including Game_Player. You can have the edited project if I can just figure out how to get the second screen to follow $BlizzABS.actors[1]. (if you know how, please tell.)

EDIT...again.

Hm... Not working. I need an expert here to complete this. In the scene, the tileset is being controlled by the ox and oy of the spriteset_
map. What controlls the camera of the scene? How would I get it to focus on something other than the player? I have edited the ox and oy of the spriteset_map to the point where I gave it a constant, and it still focused on the player.

Sorry to ask, while there is another, slightly different question, but if somebody can answer this, we might have an answer to your question punk_Blood.
World's Greatest Gravedigger