[RMXP] Online Awareness(Resolved) And RMX-OS no menu connection.

Started by R5GAMER, July 03, 2014, 12:34:21 pm

Previous topic - Next topic

R5GAMER

#========================================
# This part is RMX-Os no menu Connection :
#========================================

That's basically what I would like to :)

:gunz: My idea:
Spoiler: ShowHide





:evil: I would like to delete these menus here:
Spoiler: ShowHide




Spoiler: ShowHide




I wish there direct access to:
Spoiler: ShowHide




#========================================
# This part is RMX-Os Online Awareness :
#========================================
Spoiler: ShowHide
..........________
....'/,-Y"............."~-.
..l.Y.......................^.
./\............................_\
i.................... ___/"...."\
|.................../"...."\ .....o!
l..................].......o !__../
.\..._..._.........\..___./......"~\
..X...\/...\.....................___./
.(. \.___......_.....--~~".....~`-.           
....`.Z,--........./.....................\
.......\__....(......../.........._____)
...........\.........l......../---~~" /
............Y.......\................../
............|........"x_____.^
............|.....................\
............j.....................Y

whitespirits

All looks really good! RMX-OS could use a few tweaks like this!

ForeverZer0

Yes, all that is possible, and easier, without a launcher, and without a text file.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

R5GAMER

So to see players online is simple .. So? How do we ..?

And for without menu how can it be done? Because the idea of ​​file.txt was quite interesting .. Because I'd really like to use my launcher ..
..........________
....'/,-Y"............."~-.
..l.Y.......................^.
./\............................_\
i.................... ___/"...."\
|.................../"...."\ .....o!
l..................].......o !__../
.\..._..._.........\..___./......"~\
..X...\/...\.....................___./
.(. \.___......_.....--~~".....~`-.           
....`.Z,--........./.....................\
.......\__....(......../.........._____)
...........\.........l......../---~~" /
............Y.......\................../
............|........"x_____.^
............|.....................\
............j.....................Y

ForeverZer0

Scene_Servers and Scene_UserPass can both just be modified to automatically set the data, instead of getting it from the user. Its no different than making a title skip when debugging a game. You can basically just erase a bunch of code from these two scenes, create some "initialize" methods for them that passes in the server, username, and password variables, and your done.

I doubt I will have the time, but I MIGHT whip it up real fast. I have never used RMX-OS, and I am not about to go about setting ti all up, but I'm pretty sure I could edit the scenes without being able to debug anything.



I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

R5GAMER

Ok, I'll read all the Scene!

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

To the display of user names you can have idea?

To view the players I think I found a way to do it ..
Basically, I display a variable that gets a string and I display.
But the problem is that in this String, he always return me null ..
I tried to put all the names in a global variable but still nothing ..


#==============================================================================
# ■ Window_Test
#------------------------------------------------------------------------------
# By R5GAMER
# 29/07/2014
#==============================================================================

class Window_Test < Window_Base
  #--------------------------------------------------------------------------
  # ● Initialisation
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 250, 100)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Times New Roman"
    self.contents.font.size = 15
    self.opacity = 0
    self.back_opacity = 0
  end
  #--------------------------------------------------------------------------
  # ● Mise à jour
  #--------------------------------------------------------------------------
  def refresh
    self.contents.refresh
    self.contents.draw_text(0, 0, 200, 32, $names, 1)
  end
end

if !defined?(RMXOS) || RMXOS::VERSION < 2.0
  raise 'ERROR: The "Online Awareness" requires RMX-OS 2.0 or higher.'
end

#==============================================================================
# module BlizzCFG
#==============================================================================

module BlizzCFG

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 
  # set to false if you want to disable login/logout messages
  ONLINE_AWARENESS_SHOW_LOGIN_LOGOUT = true
 
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

end

#==============================================================================
# module RMXOS
#==============================================================================

module RMXOS
 
  #============================================================================
  # module Documentation
  #============================================================================
 
  module Documentation
   
    PARAMETERS['online']   = 'none'
    PARAMETERS['onmap']    = 'none'
    DESCRIPTIONS['online'] = 'Displays the players currently online.'
    DESCRIPTIONS['onmap']  = 'Displays the players currently on the same map.'
   
  end
 
  #============================================================================
  # module Data
  #============================================================================
 
  module Data
   
    OnlineAwarenessLoggedIn     = 'PLAYER has logged in.'
    OnlineAwarenessLoggedOut    = 'PLAYER has logged out.'
    OnlineAwarenessPlayers      = 'Currently online: PLAYERS'
    OnlineAwarenessNoPlayers    = 'No one else is currently online.'
    OnlineAwarenessMapPlayers   = 'Currently on the same map: PLAYERS'
    OnlineAwarenessNoMapPlayers = 'No one else is currently on the same map.'
   
  end
 
 
 
 
 
 
  #============================================================================
  # Network
  #============================================================================
 
  class Network
   
    def add_info2(message)
      self.add_message(nil, message, RMXOS::Data::ColorInfo)
      @window = Window_Test.new
    end
   
    alias check_game_online_awareness_alias check_game
    def check_game(message)
      if BlizzCFG::ONLINE_AWARENESS_SHOW_LOGIN_LOGOUT
        case message
        when /\ADCT\t(.+)/ # disconnection message
          id = $1.to_i
          if self.players.has_key?(id)
            self.add_info2(RMXOS::Data::OnlineAwarenessLoggedOut.sub('PLAYER',
                self.players[id].username))
          end
          # does not return as original processing still needs to be done
        when /\AENT\t(.+)\t(.+)\t(.+)\t(.+)/ # server entry message
          $name = $2
          self.add_info2(RMXOS::Data::OnlineAwarenessLoggedIn.sub('PLAYER', $name))
          # does not return as original processing still needs to be done
        end
      end
      return check_game_online_awareness_alias(message)
    end
   
    alias check_normal_commands_online_awareness_alias check_normal_commands
    def check_normal_commands(message)
      case message
      when /\A\/online\Z/
        $names = self.players.values.map {|player| player = player.username}
        if $names.size > 0
          self.add_info2(RMXOS::Data::OnlineAwarenessPlayers.sub('PLAYERS',
              $names.join(', ')))
        else
          self.add_info2(RMXOS::Data::OnlineAwarenessNoPlayers)
        end
        return true
      when /\A\/onmap\Z/
        $names = self.map_players.values.map {|player| player = player.username}
        if $names.size > 0
          self.add_info2(RMXOS::Data::OnlineAwarenessMapPlayers.sub('PLAYERS',
              $names.join(', ')))
        else
          self.add_info2(RMXOS::Data::OnlineAwarenessNoMapPlayers)
        end
        return true
      end
      return check_normal_commands_online_awareness_alias(message)
    end
  end
end
..........________
....'/,-Y"............."~-.
..l.Y.......................^.
./\............................_\
i.................... ___/"...."\
|.................../"...."\ .....o!
l..................].......o !__../
.\..._..._.........\..___./......"~\
..X...\/...\.....................___./
.(. \.___......_.....--~~".....~`-.           
....`.Z,--........./.....................\
.......\__....(......../.........._____)
...........\.........l......../---~~" /
............Y.......\................../
............|........"x_____.^
............|.....................\
............j.....................Y

Sylphe

You're crazy o_o you can't just display an array like that xD I'm on it, Once I finish I post the code to do what you want x)


EDIT : Finished, is that what you want ?

Spoiler: ShowHide
blindly follow his heart can lead to the loss

Sylphe, descendant of Zoldik Family.
Quote from: TedBearTRY KEEP UP

R5GAMER

..........________
....'/,-Y"............."~-.
..l.Y.......................^.
./\............................_\
i.................... ___/"...."\
|.................../"...."\ .....o!
l..................].......o !__../
.\..._..._.........\..___./......"~\
..X...\/...\.....................___./
.(. \.___......_.....--~~".....~`-.           
....`.Z,--........./.....................\
.......\__....(......../.........._____)
...........\.........l......../---~~" /
............Y.......\................../
............|........"x_____.^
............|.....................\
............j.....................Y

Sylphe

XD so create a window (I did a new script but I think you can do like you did, putting the window in the OnlineAwareness directly)
with this code

#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
# Window displaying onmap players
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\#
class Onmap_Window < Window_Base
  def initialize
    # ça va servir pour l'affichage
    @ancient_player_number = 0
    #ton timer, précision dans le refresh
    @timer = 0
    super(380, 140, 200, 70)
    bitmap = Bitmap.new(width - 32, height - 32)
   bitmap.hue_change((3 - 1.5).sgn * (1.25 - 40 / 0.8) * 120 /
          (3 ** 2))
   bitmap.fill_rect(0, 0, bitmap.width, bitmap.height,
        Color.new(0, 0, 0, 20))
   self.contents = bitmap
   self.opacity=125
   self.windowskin = RPG::Cache.windowskin(BuddyData::Windowskin)
   refresh
  end

  def refresh
    self.contents.clear
    self.contents.font.color= Color.new(255, 255, 255, 255)

    actual_player_number = 1
    y = 0
    w = contents.text_size("Sylph was the Wind Goddess").width
   
    # on récupère les joueurs sur la même dès qu'on entre dans le jeu
    # Ou dès que le timer atteint la valeur citée plus bas
    if @timer == 0
      $network.check_normal_commands('/onmap')
    end
    @timer = @timer+1
    #au bout de combien de temps on récupère les données
    #(255 ça correspond a jsais pas combien de secondes, j'dirais 30)
    if @timer == 255
      @timer = 0
    end
   
    #si t'as des joueurs sur ta map
    if $onmap_players[0] != nil
        # Bah on les affiche tous un par un
        for i in 0..$onmap_players.length-1
          self.contents.draw_text(0, y, w, 32, $onmap_players[i], 1)
          y += 15
          actual_player_number += 1
          # Si on a fait la requete on agrandi la fenetre si y a + de joueurs
          if $onmap_player_need_refresh
            if actual_player_number > @ancient_player_number
              bigger
            end
          end
        end
      end
      # Si y a moins de joueurs on réduit la fenêtre
      if $onmap_player_need_refresh
       
          difference = @ancient_player_number - actual_player_number
          if difference > 0
            for i in 1..difference
              smaller
            end
          end
       
        @ancient_player_number = actual_player_number
        $onmap_player_need_refresh = false
      end
   
   
   
  end
  #agrandis la fenetre et son contenu
  def bigger
    self.height += 10
    bitmap = Bitmap.new(width - 32, height - 32)
   bitmap.hue_change((3 - 1.5).sgn * (1.25 - 40 / 0.8) * 120 /
          (3 ** 2))
   bitmap.fill_rect(0, 0, bitmap.width, bitmap.height,
        Color.new(0, 0, 0, 20))
   self.contents = bitmap
end
  # réduit la fenêtre et son contenu
  def smaller
    self.height -= 10
    bitmap = Bitmap.new(width - 32, height - 32)
   bitmap.hue_change((3 - 1.5).sgn * (1.25 - 40 / 0.8) * 120 /
          (3 ** 2))
   bitmap.fill_rect(0, 0, bitmap.width, bitmap.height,
        Color.new(0, 0, 0, 20))
   self.contents = bitmap
  end
end


In this script you can change the time the game will wait until chacking the onmap players (I put 255 but you can put what you want, but if your number is too small you will have lags)

Then You HAVE to add my 2 lines in OnlineAwareness line 128 and 129   :


when /\A\/onmap\Z/
        names = self.map_players.values.map {|player| player = player.username}
        $onmap_players = names
        $onmap_player_need_refresh = true
        if names.size > 0

and finally you can remove lines 132 and 134 of onlineAwareness if you don't want lines to appear in chat
blindly follow his heart can lead to the loss

Sylphe, descendant of Zoldik Family.
Quote from: TedBearTRY KEEP UP

R5GAMER

One Problem solved on two (Thanks, has sylphie for his help ..) Now, I need than set the history to Launcher and without connection menu.
..........________
....'/,-Y"............."~-.
..l.Y.......................^.
./\............................_\
i.................... ___/"...."\
|.................../"...."\ .....o!
l..................].......o !__../
.\..._..._.........\..___./......"~\
..X...\/...\.....................___./
.(. \.___......_.....--~~".....~`-.           
....`.Z,--........./.....................\
.......\__....(......../.........._____)
...........\.........l......../---~~" /
............Y.......\................../
............|........"x_____.^
............|.....................\
............j.....................Y

R5GAMER

..........________
....'/,-Y"............."~-.
..l.Y.......................^.
./\............................_\
i.................... ___/"...."\
|.................../"...."\ .....o!
l..................].......o !__../
.\..._..._.........\..___./......"~\
..X...\/...\.....................___./
.(. \.___......_.....--~~".....~`-.           
....`.Z,--........./.....................\
.......\__....(......../.........._____)
...........\.........l......../---~~" /
............Y.......\................../
............|........"x_____.^
............|.....................\
............j.....................Y