• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • 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.

[Archive] Pokemon Essentials: Starter Kit for RPG Maker XP

Status
Not open for further replies.
Hi again. I was wondering if somebody could help me use the pbDownloadToString method.

I am kind of confused on what to do here.
 
Hi again. I was wondering if somebody could help me use the pbDownloadToString method.

I am kind of confused on what to do here.


Thankfully, this is quite simple. Basically, start off by creating a text file and uploading it to your site in comma seperated format:

Code:
PikaPika,25,10

The actually order and values of course, depends on what you're using the data for. In this case, I'm using nickname, Pokémon number and Pokémon level. There's no limit to the number of values you have. Next, you implement this script - in an event, for example:

Code:
string=pbDownloadToString("https://www.yoursite.com/test.txt")
data = []
string.each(',') {|s| data.push(s.delete(","))}

Basically, this code downloads the information from the text file (the text file needs to be in UTF-8) and puts it into an array. So in this case, data[0] is "PikaPika", data[1] is "25" and data[2] is "10". This values could be used for anything, really, but if you say, wanted to give the player a Pokémon...

Code:
pbAddForeignPokemon(data[1].to_i,data[2].to_i,_("Previous Owner"),_(data[0]))
In this case, it would give you a level 10 Pikachu, with a nickname "PikaPika". The ".to_i" is added after certain variables to convert strings into integers. In other words, the text string "25", is converted into the number value 25.
 
Whenever I test play my game in Pokemon Essentials, it erases the previous save file data. I didn't alter anything besides the script that Maximus gave me to keep the player from doubling the image (and defying priorities) near the intersection of a map. So what's wrong here?
 
Thankfully, this is quite simple. Basically, start off by creating a text file and uploading it to your site in comma seperated format:

Spoiler:

Thanks! I was also wondering, if I could use that, but have it search the website for a certain text.

Sort of like having a certain code like this...
Code:
XdQ8sK9X
...in my thread.

And I was thinking that maybe I could use a conditional branch to check if the website has that code somewhere on it.

It seems like a wacky idea, but maybe it's possible
 
I've changed the characters overworld sprite and now it has a white background in-game, even though I've set the white to transparent. I've had this problem before, but can't remember how I fixed it then.
 
I think I did that once, and for me the white didn't work either. Try using another color; I use a shade of off-purple that I never use for sprites and tiles as a transparent color.
 
If got a problem with that Shadow Pokemon system in the newest version of the starterkit. Everytime I throw a pokeball to a Shadow Pokemon, it will be treated like if that Pokemon isn't a Shadow Pokemon, and thus my ball is blocked. If tried a lot of other branches to let it work, but they all failed. Anybody knows how to fix it?

(Just for sure, the lines where everything goes wrong:

if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
@scene.pbThrowAndDeflect(ball,1)
pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
else
pokemon=battler.pokemon
species=pokemon.species

)
 
If got a problem with that Shadow Pokemon system in the newest version of the starterkit. Everytime I throw a pokeball to a Shadow Pokemon, it will be treated like if that Pokemon isn't a Shadow Pokemon, and thus my ball is blocked. If tried a lot of other branches to let it work, but they all failed. Anybody knows how to fix it?

(Just for sure, the lines where everything goes wrong:

if @opponent && (!pbIsSnagBall?(ball) || !battler.isShadow?)
@scene.pbThrowAndDeflect(ball,1)
pbDisplay(_INTL("The Trainer blocked the Ball!\nDon't be a thief!"))
else
pokemon=battler.pokemon
species=pokemon.species



)
You need to create an snag ball within the editor. To do this go into edit items and ad new item then, you create a new ball and there should be a list and near the bottom there should be an option to make it a snag ball (I think, I can't remember as I havn't used that feature often).
 
Last edited:
Thanks! I was also wondering, if I could use that, but have it search the website for a certain text.

Sort of like having a certain code like this...
Code:
XdQ8sK9X
...in my thread.

And I was thinking that maybe I could use a conditional branch to check if the website has that code somewhere on it.

It seems like a wacky idea, but maybe it's possible

Its certainly possible, but very tricky. You could replace the URL with, say, the thread URL and download the source code to a string, then just search through the data. This is a bit beyond my knowledge of RGSS, through; you should research it a bit more and find out what functions you could use to search through a string for a substring (in this case, your special code).
 
I've changed the characters overworld sprite and now it has a white background in-game, even though I've set the white to transparent. I've had this problem before, but can't remember how I fixed it then.
By this I assume you've just edited the picture file.

You need to re-import the picture file into RPG Maker XP (F10). Delete the old copy of the picture file from the list F10 pops up, and then import the new version.
 
Thanks! I was also wondering, if I could use that, but have it search the website for a certain text.

Sort of like having a certain code like this...
Code:
XdQ8sK9X
...in my thread.

And I was thinking that maybe I could use a conditional branch to check if the website has that code somewhere on it.

It seems like a wacky idea, but maybe it's possible

Of course it's possible; how do you think the Mystery Gift function in Raptor works? :P

You should use a regular expression to find the text you need. For example, if your text doesn't contain the symbol '#', you could enclose the code in '#'s, like so: #XdQ8sK9X#
Then, use a regular expression to search for a string in between two '#'s:
Code:
string[/#(.*?)#/]
code=$1
The '/'s around a string mean the string is treated as a regular expression. In a regular expression, '.' stands for any character, '*' means repeat the previous character an arbitrary number of times, and '?' after the '*' means it stops as soon as it gets to the second '#' (without the '?', it would continue as '#' falls under 'any character'). The brackets around part of the regular expression in this case are used to save the contents of the brackets (the code) into a global variable ($1, as it's the first pair of brackets. If you had another pair, their contents would be in $2 and so on). After using the regular expression, it's a good idea to copy the contents of the $1 variable to your own variable, as next time you use a regular expression, the $1 variable is overwritten.
 
You need to create an snag ball within the editor. To do this go into edit items and ad new item then, you create a new ball and there should be a list and near the bottom there should be an option to make it a snag ball (I think, I can't remember as I havn't used that feature often).

Ah, thanks! That wasn't included in the notes.
Small bad from Poccil =P
 
dont mind my post i just need this 1
 
Of course it's possible; how do you think the Mystery Gift function in Raptor works? :P

You should use a regular expression to find the text you need. For example, if your text doesn't contain the symbol '#', you could enclose the code in '#'s, like so: #XdQ8sK9X#
Then, use a regular expression to search for a string in between two '#'s:
Code:
string[/#(.*?)#/]
code=$1
The '/'s around a string mean the string is treated as a regular expression. In a regular expression, '.' stands for any character, '*' means repeat the previous character an arbitrary number of times, and '?' after the '*' means it stops as soon as it gets to the second '#' (without the '?', it would continue as '#' falls under 'any character'). The brackets around part of the regular expression in this case are used to save the contents of the brackets (the code) into a global variable ($1, as it's the first pair of brackets. If you had another pair, their contents would be in $2 and so on). After using the regular expression, it's a good idea to copy the contents of the $1 variable to your own variable, as next time you use a regular expression, the $1 variable is overwritten.

Thanks a lot! I am still confused where to put the codes though. What exactly would be the script to put. So sorry for being a pain :\
 
Status
Not open for further replies.
Back
Top