[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

Hello!

I like the all option in the tchat, but...
I have liked some elements as it appears in another window of the same type as chat (So, from the right) who displays the names of players that are currently in the map.
Exemply :
Link For the script :
http://forum.chaos-project.com/index.php/topic,13074.0.html

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

R5GAMER

July 04, 2014, 09:25:18 pm #1 Last Edit: July 23, 2014, 11:25:16 am by R5GAMER
I will wait patiently for your help anyway thank you if you are currently working on ...

Hmmmm.... I managed to read my online.txt and display with print ..

Spoiler: ShowHide

class Scene_Test
  def main
    file = File.open("online.txt")
    fichier = file
    fichier = fichier.read
    print(fichier)
    $scene = Scene_Map.new
  end
end


and i call the script event :
Spoiler: ShowHide

$scene = Scene_Test.new
..........________
....'/,-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

Blizzard

Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

File.open('online.txt') {|f| print f.read }


If you use brackets like that, the file will automatically close when the code within is finished.
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 forgot to close the file .. But is not a problem lol
But I do not see how to view, because I wish have a window at the extreme right of the chat window ..

Exemply :
Spoiler: ShowHide

HUD


Windows_Chat                                            Login
Player01 : Hello!                                          Player01
Player04 : Hello!                                          Player02
                                                                Player03
                                                                Player04
..........________
....'/,-Y"............."~-.
..l.Y.......................^.
./\............................_\
i.................... ___/"...."\
|.................../"...."\ .....o!
l..................].......o !__../
.\..._..._.........\..___./......"~\
..X...\/...\.....................___./
.(. \.___......_.....--~~".....~`-.           
....`.Z,--........./.....................\
.......\__....(......../.........._____)
...........\.........l......../---~~" /
............Y.......\................../
............|........"x_____.^
............|.....................\
............j.....................Y

Sylphe

you just need to get the RMX-OS datas for online players (That's what I don't know how to get...)
then you just make a window where you want, and put all online players name 1 above the other
blindly follow his heart can lead to the loss

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

R5GAMER

July 23, 2014, 08:44:35 pm #7 Last Edit: July 23, 2014, 09:08:44 pm by R5GAMER
I know it is not optimized at all, but .. Basically, I asked in my VB application dl every 30sec online.txt the file and put it at the root of the project .. The RMXP Client, n has read the case online.txt file and display it in a window that it also syncs, every 30sec reading the file vb download!

Ok... To be more simple...

Spoiler: ShowHide




No PV display or PM or anything it's just players connected......
..........________
....'/,-Y"............."~-.
..l.Y.......................^.
./\............................_\
i.................... ___/"...."\
|.................../"...."\ .....o!
l..................].......o !__../
.\..._..._.........\..___./......"~\
..X...\/...\.....................___./
.(. \.___......_.....--~~".....~`-.           
....`.Z,--........./.....................\
.......\__....(......../.........._____)
...........\.........l......../---~~" /
............Y.......\................../
............|........"x_____.^
............|.....................\
............j.....................Y

R5GAMER

I read and reread the code done by our friend Blizzard :)
And I found one code!!
I can inspire me the same code but instead of displaying it in the chat base I can make it past a window in hand.
However, I'm to have these ideas, but I still do not see how to make a window like the style of chat ... :'(
..........________
....'/,-Y"............."~-.
..l.Y.......................^.
./\............................_\
i.................... ___/"...."\
|.................../"...."\ .....o!
l..................].......o !__../
.\..._..._.........\..___./......"~\
..X...\/...\.....................___./
.(. \.___......_.....--~~".....~`-.           
....`.Z,--........./.....................\
.......\__....(......../.........._____)
...........\.........l......../---~~" /
............Y.......\................../
............|........"x_____.^
............|.....................\
............j.....................Y

Sylphe

Oh I thought it was a non-windowskin window with special transparency ^^ maybe u can modify blizzard's window directly instead of yours ?
blindly follow his heart can lead to the loss

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

Zexion

Quote from: R5GAMER on July 24, 2014, 07:36:57 pm
However, I'm to have these ideas, but I still do not see how to make a window like the style of chat ... :'(


I'm not too sure how it works but I know the chatbox is made with class Frame < Sprite and all the other class Frame_(etc) are the other windows used by rmxos. Hope it helps >.>

R5GAMER

I see all this more closely, I soon solved one of my request for, The story of the main menu without RMX-OS
Then I will confirm if this is resolved or not at that time, I will post on the site.

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

R5GAMER

July 29, 2014, 01:31:06 am #12 Last Edit: July 29, 2014, 01:56:19 am by R5GAMER
I managed to see a list online.text however it lag a lot and I think I know ..
But the idea is use of code by our friend I think you will not even need to read a file, but by accessing the server directly ..

My code actually :
(Although my code is pretty rotten lol)
Spoiler: ShowHide

#==============================================================================
# ■ 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
    refresh
  end
  #--------------------------------------------------------------------------
  # ● Mise à jour
  #--------------------------------------------------------------------------
  def refresh
    lines = IO.readlines('online.txt')
    self.contents.clear
    self.contents.font.bold = true
    self.contents.draw_text(0, 0, 200, 32, "(#{lines})", 2)
   self.contents.font.bold = false
  end
end


While Blizzard has retired .. I will need to learn more so that I can integrate in your code ...
..........________
....'/,-Y"............."~-.
..l.Y.......................^.
./\............................_\
i.................... ___/"...."\
|.................../"...."\ .....o!
l..................].......o !__../
.\..._..._.........\..___./......"~\
..X...\/...\.....................___./
.(. \.___......_.....--~~".....~`-.           
....`.Z,--........./.....................\
.......\__....(......../.........._____)
...........\.........l......../---~~" /
............Y.......\................../
............|........"x_____.^
............|.....................\
............j.....................Y

ForeverZer0

I don't understand the need for a file to read. Couldn't you just store the list in a variable?
That would be far easier and more efficient than constantly reading/writing to disk.
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

July 29, 2014, 07:05:53 am #14 Last Edit: July 29, 2014, 07:44:46 am by R5GAMER
Ah yes it's true lol But I do not see how you can do it because I'm not very talented when it comes to actually technical in ruby ​​..


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
   @lecture = IO.readlines('online.txt')
   refresh
 end
 #--------------------------------------------------------------------------
 # ● Mise à jour
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   self.contents.font.bold = true
   self.contents.draw_text(0, 0, 200, 32, "(#{@lecture})", 2)
  self.contents.font.bold = false
 end
end


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

ForeverZer0

Just add a variable to Game_System or something.

User = Struct.new(:server, :username, :password)

class Game_System
 
 attr_accessor :users
 
 alias user_name_init initialize
 def initialize
   user_name_init
   @users = []
 end
end


# Add a user
user = User.new('server', 'R5GAMER', 'password')
$game_system.users.push(user)


# Remove a user
$game_system.users.delete(user)
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

July 29, 2014, 07:25:41 am #16 Last Edit: July 29, 2014, 07:35:22 am by R5GAMER
I posted on another topic to avoid getting yelled lol But I test this code :)

okay... I summarize ..

My file.txt :

Serveur1
Login
Mdp

I read the file:

IO.readlines('file.txt').each {|line| p line }


I apply :

User = Struct.new(:server, :username, :password)
class Game_System
  attr_accessor :users
  alias user_name_init initialize
  def initialize
    user_name_init
    @users = []
  end
end


# Add a user
user = User.new('server', 'R5GAMER', 'password')
$game_system.users.push(user)


# Remove a user
$game_system.users.delete(user)


And if I replaced :

user = User.new('server', 'R5GAMER', 'password')

To :

user = IO.readlines('file.txt').each {|line| p line }


You think this is good? Or not?
..........________
....'/,-Y"............."~-.
..l.Y.......................^.
./\............................_\
i.................... ___/"...."\
|.................../"...."\ .....o!
l..................].......o !__../
.\..._..._.........\..___./......"~\
..X...\/...\.....................___./
.(. \.___......_.....--~~".....~`-.           
....`.Z,--........./.....................\
.......\__....(......../.........._____)
...........\.........l......../---~~" /
............Y.......\................../
............|........"x_____.^
............|.....................\
............j.....................Y

ForeverZer0

It would store the lines of the text file into the array, not users.

The code I provided would allow you to store multiple users, and access them as such:

user = User.new('server', 'R5GAMER', 'password')
$game_system.users.push(user)


me = user[0]
p user.server
p user.username
p user.password


The whole idea was to forget this whole .txt file thing. Its unnecessary and over-complicates a simple thing.
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

Okay. So I can use the same method to display this time the names of connected users?

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

Otherwise, for RMX-OS menu without connection ..
I created a launcher in vb in which the client connects from the login, the MDP and the choice of server .. Once inserted all, it launches the game directly without going through any connection menu of the game
The method you gave me could work?
..........________
....'/,-Y"............."~-.
..l.Y.......................^.
./\............................_\
i.................... ___/"...."\
|.................../"...."\ .....o!
l..................].......o !__../
.\..._..._.........\..___./......"~\
..X...\/...\.....................___./
.(. \.___......_.....--~~".....~`-.           
....`.Z,--........./.....................\
.......\__....(......../.........._____)
...........\.........l......../---~~" /
............Y.......\................../
............|........"x_____.^
............|.....................\
............j.....................Y

ForeverZer0

The launcher is probably the unnecessary part. It is a simpler idea to just have the game automatically connect than create a launcher. I am not very familiar with RMX-OS, but I would image the part where the play enters there login info can be skipped and you can simply have it read stored data to achieve the same thing.
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.