The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Scripts & Tutorials
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Scripts & Tutorials This forum is for scripts and code, as well as all kinds of tutorials, software, tools and so forth. Remember to give credit!
The thread revival limit does not apply here.


Reply
 
Thread Tools
  #26    
Old September 28th, 2013, 06:33 PM
Alexandre's Avatar
Alexandre
 
Join Date: Mar 2005
Age: 19
Nature: Lonely
Quote:
Originally Posted by ShadowFiendZX View Post
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...
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.
Reply With Quote
  #27    
Old September 29th, 2013, 06:09 AM
ShadowFiendZX's Avatar
ShadowFiendZX
Gym Leader
 
Join Date: Jan 2013
Location: Hamden Connecticut
Age: 17
Gender: Male
Nature: Serious
Send a message via Skype™ to ShadowFiendZX
Quote:
Originally Posted by Alexandre View Post
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.
Click image for larger version

Name:	what.png
Views:	22
Size:	39.4 KB
ID:	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/wi...on_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

Last edited by ShadowFiendZX; November 15th, 2013 at 12:10 PM. Reason: A few changes
Reply With Quote
  #28    
Old October 3rd, 2013, 04:56 PM
ShadowFiendZX's Avatar
ShadowFiendZX
Gym Leader
 
Join Date: Jan 2013
Location: Hamden Connecticut
Age: 17
Gender: Male
Nature: Serious
Send a message via Skype™ to ShadowFiendZX
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
Reply With Quote
  #29    
Old October 4th, 2013, 05:06 PM
ShadowFiendZX's Avatar
ShadowFiendZX
Gym Leader
 
Join Date: Jan 2013
Location: Hamden Connecticut
Age: 17
Gender: Male
Nature: Serious
Send a message via Skype™ to ShadowFiendZX
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
Reply With Quote
  #30    
Old October 6th, 2013, 11:41 AM
ShadowFiendZX's Avatar
ShadowFiendZX
Gym Leader
 
Join Date: Jan 2013
Location: Hamden Connecticut
Age: 17
Gender: Male
Nature: Serious
Send a message via Skype™ to ShadowFiendZX
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:
Click image for larger version

Name:	Error.png
Views:	22
Size:	55.5 KB
ID:	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 by ShadowFiendZX; October 6th, 2013 at 11:44 AM. Reason: Elaboration
Reply With Quote
  #31    
Old October 30th, 2013, 07:17 AM
Peaverin's Avatar
Peaverin
 
Join Date: Sep 2013
Gender: Male
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.
__________________
Click Here to enter my project's Webpage!
Hey guys, Im a Spanish boy. It's hard for me to speak completely good in english, but I'll do my best. Please, don't be too bad with me
Reply With Quote
  #32    
Old October 30th, 2013, 04:40 PM
Alexandre's Avatar
Alexandre
 
Join Date: Mar 2005
Age: 19
Nature: Lonely
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.
Reply With Quote
  #33    
Old November 2nd, 2013, 08:26 AM
Peaverin's Avatar
Peaverin
 
Join Date: Sep 2013
Gender: Male
Quote:
Originally Posted by Alexandre View Post
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
__________________
Click Here to enter my project's Webpage!
Hey guys, Im a Spanish boy. It's hard for me to speak completely good in english, but I'll do my best. Please, don't be too bad with me
Reply With Quote
  #34    
Old November 16th, 2013, 01:18 PM
p.claydon
 
Join Date: Jan 2011
Gender:
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
Reply With Quote
  #35    
Old November 16th, 2013, 02:02 PM
Alexandre's Avatar
Alexandre
 
Join Date: Mar 2005
Age: 19
Nature: Lonely
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?
Reply With Quote
  #36    
Old November 16th, 2013, 04:25 PM
Zeak6464's Avatar
Zeak6464
The MMO bringer
 
Join Date: Mar 2013
Location: USA
Age: 21
Gender: Male
Nature: Calm
Send a message via Skype™ to Zeak6464
I do have the PVP script that was in Pokemon Zeta but is there a way to add it in ??
https://hotfile.com/dl/255368395/f3d7879/PVP.txt.html
__________________
"Here one day gone the next!"
www.legendsofkanto.com
Reply With Quote
  #37    
Old November 17th, 2013, 02:58 PM
p.claydon
 
Join Date: Jan 2011
Gender:
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?
Reply With Quote
  #38    
Old November 17th, 2013, 03:53 PM
Zeak6464's Avatar
Zeak6464
The MMO bringer
 
Join Date: Mar 2013
Location: USA
Age: 21
Gender: Male
Nature: Calm
Send a message via Skype™ to Zeak6464
Quote:
Originally Posted by p.claydon View Post
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
Reply With Quote
  #39    
Old November 18th, 2013, 11:03 AM
Lanyons's Avatar
Lanyons
Love Type
 
Join Date: Nov 2013
Location: Colorado, USA
Gender: Female
Nature: Bold
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.
Reply With Quote
  #40    
Old November 18th, 2013, 11:55 AM
p.claydon
 
Join Date: Jan 2011
Gender:
Quote:
Originally Posted by Zeak6464 View Post
I can send you mine if you like ??
add me on skype Zeak6464
ive added you and yh id like to try yours if that is ok
Reply With Quote
  #41    
Old November 18th, 2013, 12:37 PM
Zeak6464's Avatar
Zeak6464
The MMO bringer
 
Join Date: Mar 2013
Location: USA
Age: 21
Gender: Male
Nature: Calm
Send a message via Skype™ to Zeak6464
Quote:
Originally Posted by Lanyons View Post
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.
yeah it's still alive but right now were waiting for PVP , to get done ...
Reply With Quote
  #42    
Old November 18th, 2013, 06:12 PM
Alexandre's Avatar
Alexandre
 
Join Date: Mar 2005
Age: 19
Nature: Lonely
What are you guys on about? There is some severe confusion going on in this thread (and to be honest, this entire forum).

The system used in Zeta and Omicron is my system. I have no idea what you're doing posting scripts from Zeta/Omicron here claiming they're different and then asking me how you integrate it.

PVP is also working and integrated, I don't know why you're saying you're waiting on it. Following the fixes listed by a member in this thread will fix any errors that occur.

Seriously, if some of the members on this forum would just open their eyes, they would realise the answers to their questions are staring right back at them.
Reply With Quote
  #43    
Old November 20th, 2013, 12:30 PM
Zeak6464's Avatar
Zeak6464
The MMO bringer
 
Join Date: Mar 2013
Location: USA
Age: 21
Gender: Male
Nature: Calm
Send a message via Skype™ to Zeak6464
Quote:
Originally Posted by Alexandre View Post
What are you guys on about? There is some severe confusion going on in this thread (and to be honest, this entire forum).

The system used in Zeta and Omicron is my system. I have no idea what you're doing posting scripts from Zeta/Omicron here claiming they're different and then asking me how you integrate it.

PVP is also working and integrated, I don't know why you're saying you're waiting on it. Following the fixes listed by a member in this thread will fix any errors that occur.

Seriously, if some of the members on this forum would just open their eyes, they would realise the answers to their questions are staring right back at them.
So were is this PVP then ??
I mean seriously link to it ??
Reply With Quote
  #44    
Old November 20th, 2013, 12:58 PM
ShadowFiendZX's Avatar
ShadowFiendZX
Gym Leader
 
Join Date: Jan 2013
Location: Hamden Connecticut
Age: 17
Gender: Male
Nature: Serious
Send a message via Skype™ to ShadowFiendZX
Quote:
Originally Posted by Zeak6464 View Post
So were is this PVP then ??
I mean seriously link to it ??
The "PVP" is in the code, if you install the scripts into the game as directed, set up the server with MySQL, then in an event add a script saying
Code:
$scene=Connect.new
It will enable you to Login,Register, or cancel.
After Registering and Logging in you may either logout, trade with another person SIGNED ON IN YOUR SERVER, or battle another person SIGNED ON IN YOUR SERVER If you had read the explanation or looked around the code you would know this. There are a few bugs in the system, I fixed one or two of them, and he has them fixed for whenever he decides to update it.
No links required. It's all in the download that's on the first post.
It was all provided, all you had to do was look and learn.
__________________
BEHOLD THE FLOPPY MAGIKARP IN ALL ITS GLORY AND WISDOM

Reply With Quote
  #45    
Old November 20th, 2013, 03:30 PM
Zeak6464's Avatar
Zeak6464
The MMO bringer
 
Join Date: Mar 2013
Location: USA
Age: 21
Gender: Male
Nature: Calm
Send a message via Skype™ to Zeak6464
Quote:
Originally Posted by ShadowFiendZX View Post
The "PVP" is in the code, if you install the scripts into the game as directed, set up the server with MySQL, then in an event add a script saying
Code:
$scene=Connect.new
It will enable you to Login,Register, or cancel.
After Registering and Logging in you may either logout, trade with another person SIGNED ON IN YOUR SERVER, or battle another person SIGNED ON IN YOUR SERVER If you had read the explanation or looked around the code you would know this. There are a few bugs in the system, I fixed one or two of them, and he has them fixed for whenever he decides to update it.
No links required. It's all in the download that's on the first post.
It was all provided, all you had to do was look and learn.
Thank you very much !

Last edited by Maruno; November 21st, 2013 at 06:25 AM.
Reply With Quote
  #46    
Old November 22nd, 2013, 09:06 PM
akane159
 
Join Date: Oct 2012
Gender: Female
I need your help, I followed the guide, but does not connect, here I leave images, please help me I really want to connect, thanks


i.imgur.com/ Mil6PKv.jpg

i.imgur.com/ 4rPh5MC.jpg

i.imgur.com/ QBTyo9N.jpg

(the link has blank spaces, delete the spaces)
Reply With Quote
  #47    
Old November 22nd, 2013, 11:57 PM
Alexandre's Avatar
Alexandre
 
Join Date: Mar 2005
Age: 19
Nature: Lonely
Please post bigger images, I can't see anything.
Reply With Quote
  #48    
Old November 23rd, 2013, 10:10 AM
ShadowFiendZX's Avatar
ShadowFiendZX
Gym Leader
 
Join Date: Jan 2013
Location: Hamden Connecticut
Age: 17
Gender: Male
Nature: Serious
Send a message via Skype™ to ShadowFiendZX
Quote:
Originally Posted by akane159 View Post
I need your help, I followed the guide, but does not connect, here I leave images, please help me I really want to connect, thanks


i.imgur.com/Mil6PKv.jpg

i.imgur.com/4rPh5MC.jpg

i.imgur.com/QBTyo9N.jpg
I'm pretty sure you need to enter things into "GMAILUSER" "GMAILPASS" and "GAMENAME"

Did you port forward and set the Options' IP to the IP to connect to your port? It's originally set to "127.0.0.1" which is localhost only.


That's the only thing that works for me, because port forwarding did nothing, both me and my friend tried it, and it said the server was off.
Also, you have to press the "C" key to connect, it says "Connecting to server" then you press C and it says something else.
__________________
BEHOLD THE FLOPPY MAGIKARP IN ALL ITS GLORY AND WISDOM

Reply With Quote
  #49    
Old January 6th, 2014, 12:42 AM
conejo
 
Join Date: Jan 2014
Gender: Male
when I run the pvpserver, this close automatically.. like this: start. . . . finish..

my english is bad



- - - Updated - - -

I think is problem with smtp server.. you can delete this?
Reply With Quote
  #50    
Old January 6th, 2014, 07:05 AM
Alexandre's Avatar
Alexandre
 
Join Date: Mar 2005
Age: 19
Nature: Lonely
The server won't work without giving a valid SMTP account. This is on purpose as your users would have a poor experience if they can't recover their password. Just set up a GMail or live account or something.
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 08:06 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.