Advertiser Content

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

Started by poccil September 6th, 2007 10:37 PM
  • 1228823 views
  • 9588 replies

Nickalooose

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

Female
Seen April 24th, 2019
Posted March 26th, 2017
1,309 posts
11.4 Years
It's not that I didn't read it, is that usually when I get that message, there is something more fundamentally wrong with the way I called the script. Anyway, I removed the parenthesis at the beginning, and got another syntax error:
---------------------------
Pokemon PC Version
---------------------------
Exception: RuntimeError
Message: Script error within event 14, map 89 (lecture1):
Exception: SyntaxError
Message: (eval):2:in `pbExecuteScript'compile error
(eval):2: syntax error
PBSpecies::TADOLEDON,5,$Trainer) 
                       ^
***Full script:
poke=PokeBattle_Pokemon.new
PBSpecies::TADOLEDON,5,$Trainer) 
poke.item=PBItems::ORANBERRY
pbAddToParty(poke)
Interpreter:275:in `pbExecuteScript'
Interpreter:1592:in `command_355'
Interpreter:493:in `execute_command'
Interpreter:193:in `update'
Interpreter:106:in `loop'
Interpreter:198:in `update'
Scene_Map:103:in `update'
Scene_Map:101:in `loop'
Scene_Map:114:in `update'
Scene_Map:68:in `main'
This exception was logged in 
C:\Users\Jordan\Saved Games/Pokemon PC Version/errorlog.txt.
Press Ctrl+C to copy this message to the clipboard.
OK
The highlighted red needs to be;

poke=PokeBattle_Pokemon.new(
PBSpecies::TADOLEDON,5,$Trainer)
poke.item=PBItems::ORANBERRY
pbAddToParty(poke)

notice where the bracket starts... The error itself soley explains, as Maruno so nicely said... Again, all you needed to do was READ the error... Although error messages are quite cryptic, the solution is sometimes within the error, I fix LOTS of my errors by reading them. x
Male
Seen August 25th, 2014
Posted August 3rd, 2014
302 posts
8.6 Years
The highlighted red needs to be;

poke=PokeBattle_Pokemon.new(
PBSpecies::TADOLEDON,5,$Trainer)
poke.item=PBItems::ORANBERRY
pbAddToParty(poke)

notice where the bracket starts... The error itself soley explains, as Maruno so nicely said... Again, all you needed to do was READ the error... Although error messages are quite cryptic, the solution is sometimes within the error, I fix LOTS of my errors by reading them. x
Isn't that back to what I originally did? Anyway, I'll try that.
EDIT: It actually worked. It's weird, though. So it makes a difference if the bracket starts at the top line as oppose to the same one as pbwhatever. When the error states "Line '(PBSpecies::TADOLEDON,5,$Trainer)' shouldn't begin with '('" I figured it meant that I was to move the beginning bracket to the last line on the bottom and the beginning bracket shouldn't be before PB at all.

Ho-oh 112

Advance Scripter

Age 23
Male
Seen March 8th, 2014
Posted March 8th, 2014
310 posts
8.5 Years
Ok, a new one.... The Pokemon/levels get screwed up after it reaches 100+ (3 digits)


Spoiler:
def pbWriteGift
shiny = 1 # shiny 1 anything else no
form = 0 # which form it is
species=pbChooseSpecies(1)
if species!=0
Kernel.pbMessage(_INTL("{1}", species))
params=ChooseNumberParams.new
params.setRange(1,PBExperience::MAXLEVEL)
params.setInitialValue(5)
params.setCancelValue(0)
level=Kernel.pbMessageChooseNumber(
_INTL("Set the Pokémon's level."),params)
if level>0
end
end
dat1=[species, level, shiny, form]
dat2=dat1.pack("CvM^*07")
filename="Gifts/Gift.MG"
File.open(filename,"wb"){|f|
f.write(i)
f.write(dat2)
}
end

def pbLoadMGift
data = nil
if $Trainer.party.length==6
Kernel.pbMessage(_INTL("Sorry, you have 6 pokemon in the party."))
return
end
File.open("Gifts/Gift.MG","rb"){|f|
data=f.read
}
if data == nil
Kernel.pbMessage(_INTL("Data is corrupt."))
return false
end
# decompiles
species=dat[0]
level=dat[1]
shiny=dat[2]
form=dat[3]
# checks
if level > PBExperience::MAXLEVEL || level < 0
Kernel.pbMessage(_INTL("gift is corrupt. {1}", level))
return false
end
if species > 493 || species < 0
Kernel.pbMessage(_INTL("Gift is corrupt. {1}", species))
return false
end
# the gift passed
Kernel.pbMessage(_INTL("A gift was found"))
p=PokeBattle_Pokemon.new(species,level,$Trainer)
p.form = form
if shiny = 2
p.makeShiny
end
pbAddToParty(p)
end

Maruno

Lead Dev of Pokémon Essentials

England
Seen 5 Days Ago
Posted 1 Week Ago
5,181 posts
11.6 Years
Isn't that back to what I originally did? Anyway, I'll try that.
EDIT: It actually worked. It's weird, though. So it makes a difference if the bracket starts at the top line as oppose to the same one as pbwhatever. When the error states "Line '(PBSpecies::TADOLEDON,5,$Trainer)' shouldn't begin with '('" I figured it meant that I was to move the beginning bracket to the last line on the bottom and the beginning bracket shouldn't be before PB at all.
I pre-empted your confusion, and changed that error message in future versions to be a bit clearer.

The opening bracket tells the game to expect some parameters, so it looks to the next line to find them, rather than assume the next line is a separate command in itself. It will only stop looking for parameters once it hits the closing bracket at the end of the second line. In effect, it treats the two lines as one as required.

Or, y'know, use the Extend Text thingy.
Go to the Essentials Docs Wiki

Essentials Docs Wiki

Follow me on Twitter: @maruno42


Maruno

Lead Dev of Pokémon Essentials

England
Seen 5 Days Ago
Posted 1 Week Ago
5,181 posts
11.6 Years
Line 87, which reads File.open(Gifts/Gift.MG,"rb"){|f|. Put quote marks around "Gifts/Gift.MG" like I just did.

I may just be reading this wrong, but it looks like your pbWriteGift will end up writing the details of the gift Pokémon over 8 million times (899*8999). I can't help but think that's not right.

Finally, one of your checks is
if @level < 101 || @level < 0
, when it probably should be if @level > PBExperience::MAXLEVEL || @level < 0. And you don't need PBSpecies:: when adding the new Pokémon, because species is a number.

Just a few observations.
Go to the Essentials Docs Wiki

Essentials Docs Wiki

Follow me on Twitter: @maruno42


Ho-oh 112

Advance Scripter

Age 23
Male
Seen March 8th, 2014
Posted March 8th, 2014
310 posts
8.5 Years
Line 87, which reads File.open(Gifts/Gift.MG,"rb"){|f|. Put quote marks around "Gifts/Gift.MG" like I just did.

I may just be reading this wrong, but it looks like your pbWriteGift will end up writing the details of the gift Pokémon over 8 million times (899*8999). I can't help but think that's not right.

Finally, one of your checks is
if @level < 101 || @level < 0
, when it probably should be if @level > PBExperience::MAXLEVEL || @level < 0. And you don't need PBSpecies:: when adding the new Pokémon, because species is a number.

Just a few observations.
Wow lot's of errors, anyways I'll try them.
Male
Seen August 25th, 2014
Posted August 3rd, 2014
302 posts
8.6 Years
I pre-empted your confusion, and changed that error message in future versions to be a bit clearer.

The opening bracket tells the game to expect some parameters, so it looks to the next line to find them, rather than assume the next line is a separate command in itself. It will only stop looking for parameters once it hits the closing bracket at the end of the second line. In effect, it treats the two lines as one as required.

Or, y'know, use the Extend Text thingy.
Oooh-kay. It's helpful that I understand how the compiler is reading these things, thank you.

Nickalooose

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

Female
Seen April 24th, 2019
Posted March 26th, 2017
1,309 posts
11.4 Years
I have a 2 questions... not sure if this one is supposed to be here;
my extendtext.exe, doesn't want to work! Any reasons why, you think?
It doesn't do anything with a text box open... For those smart asses out there haha!

Also, I'm trying to do and learn something new! Learning the way Abillities and Moves work, by checking how to read .txt files, but I can't seem to get my game to read the text within my .txt file, and print in-game...

I have my file, I add which ever name to my pokemon.txt file, it does absolutely nothing, but if I remove my .txt file, it errors because it can't find said name in suchandsuch.txt...? And the new line within pokemon.txt causes an error due to an extra "unneccassary" line... So to speak! Any help on how this works is well apprechiated. X

Maruno

Lead Dev of Pokémon Essentials

England
Seen 5 Days Ago
Posted 1 Week Ago
5,181 posts
11.6 Years
I have a 2 questions... not sure if this one is supposed to be here;
my extendtext.exe, doesn't want to work! Any reasons why, you think?
It doesn't do anything with a text box open... For those smart asses out there haha!
Simply double-clicking extendtext.exe while a text box or script box in RMXP is open should work. I don't know why it isn't, unless you're missing out some important piece of information (but I don't even know what that might be).


Also, I'm trying to do and learn something new! Learning the way Abillities and Moves work, by checking how to read .txt files, but I can't seem to get my game to read the text within my .txt file, and print in-game...

I have my file, I add which ever name to my pokemon.txt file, it does absolutely nothing, but if I remove my .txt file, it errors because it can't find said name in suchandsuch.txt...? And the new line within pokemon.txt causes an error due to an extra "unneccassary" line... So to speak! Any help on how this works is well apprechiated. X
Abilities/moves/items/Pokémon/etc. are defined by writing them in the PBS files. When the game is compiled, it reads this information, converts it into another form it can use later on, and writes it to one (or more) of the VCD files in the Data folder. When running the game, it is actually using these VCD files to get the required information about a move or ability.

Now, that will only define a "thing" in the game (e.g. Quick Feet is a "thing" it calls an "ability"). It does not define what a particular "thing" actually does (i.e. what the effect of Quick Feet is). Those effects need to be scripted, and are not part of the PBS files.

The PBS files need to remain where they are, because they are checked whenever the game is run from RMXP to see if they've changed. If they've changed, the game recompiles itself. If it can't find a PBS file in the first place, it throws a wobbly.

What the game does when it compiles (i.e. how it moves information around) is very complicated, and easy to muck up. I don't like to touch it, and I'm running the kit!

That's all just for your interest.

You've been unhelpfully non-specific in what you've been trying to add, and what errors you end up with. The best I can guess is that you're trying to give a Pokémon a new move or ability, but it's saying such a move/ability doesn't exist. You need to define them in their respective PBS files as well. You can't just type "GIGADRILLBREAKER" into a Pokémon's moveset and expect it to work - what makes Giga Drill Breaker a move is being defined in moves.txt.

When the game is compiled, there is a specific order to which PBS files are compiled. Moves are compiled before Pokémon (for instance), because the latter depends on having an up-to-date former. First Giga Drill Breaker becomes a "thing" known as a "move", and then the Pokémon are compiled where the moves are checked for the existence of a move called Giga Drill Breaker.

Basically, define your "things" in the appropriate PBS files first (moves in moves.txt, etc.), and then assign moves/abilities to particular Pokémon species (in pokemon.txt).
Go to the Essentials Docs Wiki

Essentials Docs Wiki

Follow me on Twitter: @maruno42


Nickalooose

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

Female
Seen April 24th, 2019
Posted March 26th, 2017
1,309 posts
11.4 Years
Simply double-clicking extendtext.exe while a text box or script box in RMXP is open should work. I don't know why it isn't, unless you're missing out some important piece of information (but I don't even know what that might be).



Abilities/moves/items/Pokémon/etc. are defined by writing them in the PBS files. When the game is compiled, it reads this information, converts it into another form it can use later on, and writes it to one (or more) of the VCD files in the Data folder. When running the game, it is actually using these VCD files to get the required information about a move or ability.

Now, that will only define a "thing" in the game (e.g. Quick Feet is a "thing" it calls an "ability"). It does not define what a particular "thing" actually does (i.e. what the effect of Quick Feet is). Those effects need to be scripted, and are not part of the PBS files.

The PBS files need to remain where they are, because they are checked whenever the game is run from RMXP to see if they've changed. If they've changed, the game recompiles itself. If it can't find a PBS file in the first place, it throws a wobbly.

What the game does when it compiles (i.e. how it moves information around) is very complicated, and easy to muck up. I don't like to touch it, and I'm running the kit!

That's all just for your interest.

You've been unhelpfully non-specific in what you've been trying to add, and what errors you end up with. The best I can guess is that you're trying to give a Pokémon a new move or ability, but it's saying such a move/ability doesn't exist. You need to define them in their respective PBS files as well. You can't just type "GIGADRILLBREAKER" into a Pokémon's moveset and expect it to work - what makes Giga Drill Breaker a move is being defined in moves.txt.

When the game is compiled, there is a specific order to which PBS files are compiled. Moves are compiled before Pokémon (for instance), because the latter depends on having an up-to-date former. First Giga Drill Breaker becomes a "thing" known as a "move", and then the Pokémon are compiled where the moves are checked for the existence of a move called Giga Drill Breaker.

Basically, define your "things" in the appropriate PBS files first (moves in moves.txt, etc.), and then assign moves/abilities to particular Pokémon species (in pokemon.txt).
I figured it's this stupid laptop, Windows Vista, I hate the program, I prefer XP... Anyways...

Okay, say for arguments sake, I want;

Spoiler:

[1]
Name=BULBASAUR
InternalName=BULBASAUR
Kind=SEED
Pokedex=BULBASAUR can be seen napping in bright sunlight. There is a seed on its back. By soaking up the sun's rays, the seed grows progressively larger.
Type1=GRASS
Type2=POISON
BaseStats=45,49,49,45,65,65
Rareness=45
BaseEXP=64
Happiness=70
GrowthRate=Parabolic
StepsToHatch=5120
Color=Green
Habitat=Grassland
EffortPoints=0,0,0,0,1,0
Abilities=OVERGROW
Likes=RUNNING
Compatibility=1,7
Height=0.7
Weight=6.9
GenderRate=FemaleOneEighth
Moves=1,TACKLE,4,GROWL,7,LEECHSEED,10,VINEWHIP
EggMoves=LIGHTSCREEN,SKULLBASH,SAFEGUARD,CHARM
Evolutions=IVYSAUR,Level,16
BattlerPlayerY=17
BattlerEnemyY=15
BattlerAltitude=0


Then, within a text file called, likes.txt, it looks somewhat like this

1,RUNNING,Running,The Pokemon may attack first.
2,BANANAS,Bananas,The Pokemon may become confused.
3,SOCKS,Socks,The Pokemon will defrost itself if frozen.


I know adding Abillities is a pain, and you say make edits of already scripted abillities if you are goin to add any... So using how Quick Attack would work would be how this is easily scripted obviously with some edit so the Pokémon doesn't always attack first... But the problem I am getting, everything compiles and errors correctly, if RUNNING is spelt wrong or .txt file is missing, but the game itself, is not registering the info about the "thing" or the name, within the Pokédex and the move itself doesn't do anything... For the Pokédex thing, i literally just replaced the "Abillity" scripts with "Likes" info to check if this works, but nothin comes up, if I rename my likes.txt, to abillities.txt... It works! X

Maruno

Lead Dev of Pokémon Essentials

England
Seen 5 Days Ago
Posted 1 Week Ago
5,181 posts
11.6 Years
You're trying to do what I feared you might be trying to do: create a new "thing".

The effects of these Likes aren't important, and can be scripted just fine. That would be the very very easy part.

PBS files aren't things you just write and they'll be compiled just because they're in the PBS folder. Search the scripts for "pokemon.txt", and you'll see it mentioned in the Compiler script section. The scripts know beforehand which PBS files it expects, and there are extensive scripts that deal with them and do the compiling. Any files in the PBS folder that it doesn't expect aren't looked at at all.

The same goes for lines within pokemon.txt. The scripts don't say what to do with a line beginning "Likes=", so it ignores that line. The information in the Likes line is never compiled and saved elsewhere for actual use. You can write whatever nonsense you want in pokemon.txt, but the only lines that are actually looked at are the ones beginning "blah=", where "blah" are the words in the tables in the wiki's Defining a species page.

You can add some code to make the game recognise a "Likes=" line, and say what to do with the information therein. However, this requires that the information is meaningful (a number or an already-defined "thing"), and that you also know the data structure of a Pokémon species to make sure you save the information correctly and in the right format. You would then need to load the appropriate information later on using this knowledge, and find the appropriate sub-information (i.e. the description based on the ID number), and then display it/use it to determine an effect. That's at the very least. If you want to define a new "thing" for Likes, that's a whole new and much larger kettle of fish in itself.

The reason you got something to work when you renamed "likes.txt" to "abilities.txt" is because the game decided that Bananas and Socks were abilities, and you just happened to use the same PBS data structure to "define" them. That's not a sign that you've done anything right, just that you can edit the list of possible abilities (which frankly, isn't hard).

My point is that there's a lot more involved than you think, and you shouldn't be trying to do anything like this. At all. It's way too easy to mess up, even for me who just explained all this.
Go to the Essentials Docs Wiki

Essentials Docs Wiki

Follow me on Twitter: @maruno42


Nickalooose

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

Female
Seen April 24th, 2019
Posted March 26th, 2017
1,309 posts
11.4 Years
Spoiler:
You're trying to do what I feared you might be trying to do: create a new "thing".

The effects of these Likes aren't important, and can be scripted just fine. That would be the very very easy part.

PBS files aren't things you just write and they'll be compiled just because they're in the PBS folder. Search the scripts for "pokemon.txt", and you'll see it mentioned in the Compiler script section. The scripts know beforehand which PBS files it expects, and there are extensive scripts that deal with them and do the compiling. Any files in the PBS folder that it doesn't expect aren't looked at at all.

The same goes for lines within pokemon.txt. The scripts don't say what to do with a line beginning "Likes=", so it ignores that line. The information in the Likes line is never compiled and saved elsewhere for actual use. You can write whatever nonsense you want in pokemon.txt, but the only lines that are actually looked at are the ones beginning "blah=", where "blah" are the words in the tables in the wiki's Defining a species page.

You can add some code to make the game recognise a "Likes=" line, and say what to do with the information therein. However, this requires that the information is meaningful (a number or an already-defined "thing"), and that you also know the data structure of a Pokémon species to make sure you save the information correctly and in the right format. You would then need to load the appropriate information later on using this knowledge, and find the appropriate sub-information (i.e. the description based on the ID number), and then display it/use it to determine an effect. That's at the very least. If you want to define a new "thing" for Likes, that's a whole new and much larger kettle of fish in itself.

The reason you got something to work when you renamed "likes.txt" to "abilities.txt" is because the game decided that Bananas and Socks were abilities, and you just happened to use the same PBS data structure to "define" them. That's not a sign that you've done anything right, just that you can edit the list of possible abilities (which frankly, isn't hard).

My point is that there's a lot more involved than you think, and you shouldn't be trying to do anything like this. At all. It's way too easy to mess up, even for me who just explained all this.


I see, it was deffinatly worth the question I think! I did think it would be hard, but to learn is to play, I think... But, nevertheless, it was an idea I had, and decided to attempt! If yourself would'nt attempt this, I think I should'nt :P
Advertiser Content