• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Pokemon Essentials: Online

Status
Not open for further replies.
401
Posts
19
Years
  • Age 29
  • Seen Dec 4, 2016
Would there be a way to have all these files off a website so I wouldn't need to use my computer? There's several reasons why I can't use my computer, My dad wouldn't even consider letting me port forward, he frequently shuts off the wifi, executing the SQL in HeidiSQL gave several errors, and after running Main.rb it crashed in like 5 seconds.

I followed the instructions word for word.
Please let me know which errors appeared so I can help you.
 

ShadowFiendZX

Gym Leader
59
Posts
11
Years
It does this every time I press the blue play button.
View attachment 69729

I'm not sure if that's supposed to happen, or if anything happens after that, but I press Ok, and nothing happens, and pressing the blue button again ends with the same result.

Not knowing if the above was supposed to happen, I tried Main.rb and it shows this, then closes after a few seconds.
View attachment 69730
 
401
Posts
19
Years
  • Age 29
  • Seen Dec 4, 2016
Those warnings are normal, not sure what is causing them.

The server isnt starting because it can't connect to the SMTP server. Make sure your SMTP settings are correct.

And with regard to hosting the server online, it is very possible to do. I can host one for you if you like and give you the IP and port for you to put in your client. I can't do that now though, I'm very busy.
 

ShadowFiendZX

Gym Leader
59
Posts
11
Years
I opened Main.rb again, and realized I typed my password wrong. lol sorry. I'm about to test it now on my game, although if you could still tell me how to host it on my website, that'd be great. Also, if it is possible to host this on a website, would it be possible for some sort of GTS, where you "upload" your pokemon for everyone to see, and you choose what you'd like in return for that pokemon? Thanks :)

I just battled myself by using 2 windows, and the two windows had 2 different things happening, I won on both screens...
View attachment 69746

Also, clicking "pokemon" opened bag, and clicking "bag" opened pokemon
 
Last edited:

rescuecp

Redhead :P
34
Posts
15
Years
My server CMD stops at connecting to SMTP server and yet all my information is correct...Also how do you make it so when you launch your game it goes right away to a login/register window?

Thanks :D
 
401
Posts
19
Years
  • Age 29
  • Seen Dec 4, 2016
I opened Main.rb again, and realized I typed my password wrong. lol sorry. I'm about to test it now on my game, although if you could still tell me how to host it on my website, that'd be great. Also, if it is possible to host this on a website, would it be possible for some sort of GTS, where you "upload" your pokemon for everyone to see, and you choose what you'd like in return for that pokemon? Thanks :)

I just battled myself by using 2 windows, and the two windows had 2 different things happening, I won on both screens...
View attachment 69746

Also, clicking "pokemon" opened bag, and clicking "bag" opened pokemon
This happens when you battle yourself and you have the same pokemon against each other. The battle system can't tell which is which because there is no unique identifier for them.
 

ShadowFiendZX

Gym Leader
59
Posts
11
Years
This happens when you battle yourself and you have the same pokemon against each other. The battle system can't tell which is which because there is no unique identifier for them.

I tried again with two different saves that had different players and different pokemon, and it worked this time, the "bag" button opens the pokemon screen, and the "pokemon" button opens the bag screen.


I did however get this error on the loser's screen

---------------------------
Pokémon Combustion
---------------------------
Exception: NameError

Message: uninitialized constant PokeBattle_OnlineBattle::ONLINEGAINMONEY

PokeBattle_OnlineBattle(PEO):3168:in `pbEndOfBattle'

PokeBattle_OnlineBattle(PEO):2155:in `pbStartBattleCore'

PokeBattle_OnlineBattle(PEO):1940:in `pbStartBattle'

Connect/Register/Login(PEO):468:in `start_battle'

Connect/Register/Login(PEO):448:in `check_battle'

Connect/Register/Login(PEO):82:in `handle'

Connect/Register/Login(PEO):62:in `update'

Connect/Register/Login(PEO):45:in `main'

Connect/Register/Login(PEO):43:in `loop'

Connect/Register/Login(PEO):50:in `main'



This exception was logged in ./errorlog.txt.

Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK
---------------------------

Also, I beat the player on the left, and then it still asked what I wanted to do, even though there was no target, then I attacked, it said there was no target, then I lost on the left screen, and got the same error.
View attachment 69760

Some things I noticed are:

When you press X, it exits out of the server menu and when you try to log back in, it says the account is already logged into.

There is no saving before logging in, after trading, or after battling, which could result in multiplication of pokemon, although I'm sure it's a simple fix.

The music isn't battle music, it's the music of whatever building you're in.

To battle or trade, you had to type the other person's name on both screens, there was no popup sending a request, only one saying you accepted eachother's requests.

Since I was in debug mode I could hold ctrl and press "run" and treat it as a win, therefor both screens were wins.

It logs you out after a trade, then when you try to relog it says you're already logged in.

I've got some suggestions as well:

Adding a configurable music for the server menu
Maybe making it have more than one scene for pokecenter second floor use(Although this is just aesthetics and isn't really necessary)
A GTS
Battle music
Popups for trade and battle requests, or like an inbox system to keep track of them
A configurable music for trades
Make it keep your login after a trade
Pressing X on the main screen logs you out
some sort of wifi plaza http://bulbapedia.bulbagarden.net/wiki/Wi-Fi_Plaza
Double battles between 2 people
double battles between 4 people
Forced signout when game crashes/ person quits
Maybe some sort of pal pad to have a list of your friends and be able to look at their trainer card, along with the recording, if they added one.
The ability to specify your location (Country, City, State)
The ability to trade triple triad cards
Dream World Features http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_Dream_World
Underground features http://bulbapedia.bulbagarden.net/wiki/The_Underground
The ability to save your username and password to local variables so you don't need to constantly log in after quitting the game.
Multiple game support, IE if someone were to make two separate games that would be able to connect, but would have different player sprites.
An online pokemon storage system. (Separate from GTS)
Some sort of player vs player Duel (http://pokemonessentials.wikia.com/wiki/Mini-games#Duel)

Other than those things, your scripts are amazing.
Thank you for this amazing multiplayer system :t192:
 
Last edited:

ShadowFiendZX

Gym Leader
59
Posts
11
Years
Some fixes

I found some ways to fix the music, and the battle menu.
There was probably a better way to do this, but I barely know any Ruby

in Pokebattle_Onlinebattle change:
Code:
            elsif cmd==1 # Bag
to
Code:
            elsif cmd==2 # Bag
it was line 2224 for me

also in Pokebattle_Onlinebattle change:
Code:
            elsif cmd==2 # Pokémon
to
Code:
            elsif cmd==1 # Pokémon
it's line 2236 for me


in Connect/Register/Login change:
Code:
    else
      Kernel.pbMessage("Connection Successful.")
      registerorlogin

to
Code:
    else
      Kernel.pbMessage("Connection Successful.")
          pbBGMStop()
    pbBGMPlay("#AUDIOFILE#")
      registerorlogin
where "#AUDIOFILE#" is the name of the audio file in your BGM folder that you want to play in the background of the Online menu

change
Code:
    elsif result == 4
      Kernel.pbMessage(_INTL("The user #{player} has accepted your battle request."))
      deserialized = Marshal.load(opponent.unpack("m")[0])
      return start_battle(deserialized)

to
Code:
    elsif result == 4
      Kernel.pbMessage(_INTL("The user #{player} has accepted your battle request."))
      deserialized = Marshal.load(opponent.unpack("m")[0])
                pbBGMStop()
    pbBGMPlay("#AUDIOFILE#")
      return start_battle(deserialized)
where "#AUDIOFILE#" is the name of the audio file in the BGM folder that will play during the battle

change

Code:
    if decision==1
      Kernel.pbMessage("You won the battle")
    else
      Kernel.pbMessage("You lost the battle")

to
Code:
    if decision==1
      Kernel.pbMessage("You won the battle")
                      pbBGMStop()
                             pbBGMPlay("#AUDIOFILE#")
    else
      Kernel.pbMessage("You lost the battle")
                      pbBGMStop()
                              pbBGMPlay("#AUDIOFILE#")
Where ("#AUDIOFILE#") is the name of the audio file in the BGM folder that you had chosen earlier for playing in the Online menu.

It's not perfect, I looked around a bit, and couldn't find any code that would remember the song that was playing in the map you were originally in as well as the spot in the song it was at, or a script that would start that song after closing the menu, if anyone does know of a way to do that in code, please let me know.

I tried making music play during the trades but putting code in both "Trade" and "PokemonTrading"did not work.

Anyways, I'd like to thank Alexandre again for his Online scripts :)
Happy programming y'all
 

ShadowFiendZX

Gym Leader
59
Posts
11
Years
I finally convinced my dad to port forward, and since he's been working with computers and stuff for most his life, he knows what he's doing when it comes to ports and servers. Some security thing isn't allowing anything to connect to our router, we checked and it said connection was refused, and he says there is no way to fix it. Is it possible to have the server run off pf a webhost or something? If so, could someone tell me how? Otherwise I might not be able to make this work for me, which would be a shame, as I really like this feature.
Thanks in advance :)
 

ShadowFiendZX

Gym Leader
59
Posts
11
Years
Fix for MONEYGAIN error and a comment

In Pokebattle_Onlinebattle change:
Code:
    ##### LOSE, DRAW #####
      when 2, 5
        if @internalbattle
          pbDisplayPaused(_INTL("{1} is out of usable Pokémon!",self.pbPlayer.name))
          if ONLINEGAINMONEY == true
          moneylost=pbMaxLevel(@party1)
          multiplier=[8,16,24,36,48,60,80,100,120]
          moneylost*=multiplier[[multiplier.length-1,self.pbPlayer.numbadges].min]
          moneylost=self.pbPlayer.money if moneylost>self.pbPlayer.money
          moneylost=0 if $game_switches[NO_MONEY_LOSS]
          self.pbPlayer.money-=moneylost

to:
Code:
    ##### LOSE, DRAW #####
      when 2, 5
        if @internalbattle
          pbDisplayPaused(_INTL("{1} is out of usable Pokémon!",self.pbPlayer.name))
          if Options::ONLINEGAINMONEY == true
          moneylost=pbMaxLevel(@party1)
          multiplier=[8,16,24,36,48,60,80,100,120]
          moneylost*=multiplier[[multiplier.length-1,self.pbPlayer.numbadges].min]
          moneylost=self.pbPlayer.money if moneylost>self.pbPlayer.money
          moneylost=0 if Options::ONLINEGAINMONEY == false ##if $game_switches[NO_MONEY_LOSS]
          self.pbPlayer.money-=moneylost


Also, I have to comments. When you have more than one pokemon, and one faints so you have to switch another pokemon in, this happens:
View attachment 69842
The screen on the left is stuck like that, and the screen on the right gets to choose a move, but can't attack. The Charizard is the pokemon that I switched in after having my Wartortle faint. It was damaged by hail. After turning off the server the left screen unfroze, continued the battle for a few seconds, then crashed because the server was off.
And I had a battle with
lvl 5 Abra vs lvl 100 Abomasnow
and obviously Abomasnow won, the screen with Abra lost $40 and the Abomasnow won $300
 
Last edited:
50
Posts
10
Years
  • Age 30
  • Seen Apr 20, 2014
Thanks ShadowFiendZX for some bug fixes.
By the way, Alexandre, will you release a stable version of this?
I was thinking about adding it to my game but it's got some bugs.
 
401
Posts
19
Years
  • Age 29
  • Seen Dec 4, 2016
When I have the time to work on opensource stuff I will be doing some bug fixes. The system has been used extensively in Pokemon Zeta and Omicron which is currently in beta testing with thousands of players. The server is resilient but there are some client side bugs in trading and battling which need to be fixed. 90% of the time a trade goes through without a hitch but battles always crash for the losing player (I know why though). It's just a matter of me finding a week where I can sit down and get back into the pure Ruby mood, I've been spending a lot of time over the past 2 months doing commerical Ruby on Rails stuff.
 
50
Posts
10
Years
  • Age 30
  • Seen Apr 20, 2014
When I have the time to work on opensource stuff I will be doing some bug fixes. The system has been used extensively in Pokemon Zeta and Omicron which is currently in beta testing with thousands of players. The server is resilient but there are some client side bugs in trading and battling which need to be fixed. 90% of the time a trade goes through without a hitch but battles always crash for the losing player (I know why though). It's just a matter of me finding a week where I can sit down and get back into the pure Ruby mood, I've been spending a lot of time over the past 2 months doing commerical Ruby on Rails stuff.
It's nice to hear that.
I'll be waiting for updates then :)
 
423
Posts
13
Years
  • Age 37
  • Seen Aug 31, 2023
not sure what i could be doing wrong installed everything and used same options as mentioned in the set up guide but when use the event to connect to the server the main.rb crashes and closes

any suggestions on a solution
 
401
Posts
19
Years
  • Age 29
  • Seen Dec 4, 2016
Open a command window, type in ruby and then drag the main.rb file onto the terminal window and hit enter. What is the last thing that gets outputted before the program crashes?
 
423
Posts
13
Years
  • Age 37
  • Seen Aug 31, 2023
something about connecting to a sever then it crashes but now cant even get it to load up really have no clue whats going on here does it matter is im running windows 8.1?
 

Zeak6464

Zeak #3205 - Discord
1,101
Posts
11
Years
  • Age 31
  • USA
  • Seen Oct 9, 2023
something about connecting to a sever then it crashes but now cant even get it to load up really have no clue whats going on here does it matter is im running windows 8.1?

I can send you mine if you like ??
add me on skype Zeak6464
 

Lanyons

Love Type
7
Posts
10
Years
Here's to hoping this is still alive :D




I will be making a game (more in the planning stages atm) but I have been trying to get a sense of what is do-able as I started making a Outline of what my game is supposed to be about and the features that it will have.
 
Status
Not open for further replies.
Back
Top