Development New Battle System Page 2

Started by FBI November 24th, 2015 12:21 PM
  • 46851 views
  • 178 replies

FBI

Free supporter

Male
Unknown Island
Seen August 2nd, 2020
Posted December 17th, 2019
1,910 posts
7.7 Years
I've fixed all the stated errors, put in as much tool compatibility as I could (though I didn't do the life orb thing yet...sorry :D). It will actually compile now. If you see more random errors let me know. Currently working on the setup and graphical starting and such of the battle.


Read if you have time but don't know C or ASM & are interested in helping:
Spoiler:

Guys, if you want to help, just take a look at the OP. Pick one that's not in green and not in orange and do one. There's plenty of work to go around :)

There's also this in BPRE.LD:
/*
* Place holder data
*/

sheer_force_t = 0x0;
mega_items_t = 0x0;
Those are supposed to be tables. For sheer_force_t, it's a table where each entry is 2 bytes long (reversed), each entry is a move which is affected by the ability Sheer Force. For mega_items_t, that's a table of item IDs (reversed again) where each ID is the ID of a mega stone.

Finally, I still need tables for Fling, Mold breaker (abilities it disables), Iron fist, Reckless, Berries table (table of all the berry's item ids) and Natural gift.

Some harder to make tables (since they'd have to made them by hand - but they are BADLY needed) :
- Type chart (your type chart MUST work for Pokemon more than 2 types)
- Move table using this format:
struct move_table {
	u8 script_id;
	u8 base_power;
	u8 type;
	u8 accuracy;
	u8 PP;
	u8 effect_accuracy;
	u8 affected_targets;
	u8 priority;
	u8 contact : 1;
	u8 protect : 1;
	u8 magic_coat : 1;
	u8 snatch : 1;
	u8 mirror_move : 1;
	u8 kings_2,k : 1;
	u8 crit_chance : 1;
	u8 padding_field : 1;
	u8 is_special;
	u16 move_id;
};
note u8 something : 1;
basically is like saying something takes up 1 bit of a bitfield size u8 (1 byte). So the first bit in the move table's bit field is contact (if a move makes contact) second bit is protect (if it's affected by protect) ect.


EDIT: If you have suggestions for algorithms for certain things those are welcome to.
...
Age 22
Male
Online now
Posted 2 Weeks Ago
546 posts
8 Years
I've fixed all the stated errors, put in as much tool compatibility as I could (though I didn't do the life orb thing yet...sorry :D). It will actually compile now. If you see more random errors let me know. Currently working on the setup and graphical starting and such of the battle.


Read if you have time but don't know C or ASM & are interested in helping:
Spoiler:

Guys, if you want to help, just take a look at the OP. Pick one that's not in green and not in orange and do one. There's plenty of work to go around :)

There's also this in BPRE.LD:
/*
* Place holder data
*/

sheer_force_t = 0x0;
mega_items_t = 0x0;
Those are supposed to be tables. For sheer_force_t, it's a table where each entry is 2 bytes long (reversed), each entry is a move which is affected by the ability Sheer Force. For mega_items_t, that's a table of item IDs (reversed again) where each ID is the ID of a mega stone.

Finally, I still need tables for Fling, Mold breaker (abilities it disables), Iron fist, Reckless, Berries table (table of all the berry's item ids) and Natural gift.

Some harder to make tables (since they'd have to made them by hand - but they are BADLY needed) :
- Type chart (your type chart MUST work for Pokemon more than 2 types)
- Move table using this format:
struct move_table {
    u8 script_id;
    u8 base_power;
    u8 type;
    u8 accuracy;
    u8 PP;
    u8 effect_accuracy;
    u8 affected_targets;
    u8 priority;
    u8 contact : 1;
    u8 protect : 1;
    u8 magic_coat : 1;
    u8 snatch : 1;
    u8 mirror_move : 1;
    u8 kings_2,k : 1;
    u8 crit_chance : 1;
    u8 padding_field : 1;
    u8 is_special;
    u16 move_id;
};
note u8 something : 1;
basically is like saying something takes up 1 bit of a bitfield size u8 (1 byte). So the first bit in the move table's bit field is contact (if a move makes contact) second bit is protect (if it's affected by protect) ect.


EDIT: If you have suggestions for algorithms for certain things those are welcome to.
Should the tables be in hex (hex editor format ie. FF FF FF FF) or just like 0xFFFF 0xFFFF or is there any other table format?

FBI

Free supporter

Male
Unknown Island
Seen August 2nd, 2020
Posted December 17th, 2019
1,910 posts
7.7 Years
Should the tables be in hex (hex editor format ie. FF FF FF FF) or just like 0xFFFF 0xFFFF or is there any other table format?
Neither.
Make a text file like this one https://github.com/EternalCode/Battle-System/blob/master/src/Defines/generation/pokemon
Note your text file could be neater, if you want an easier python program. I just copy-pasted this one from Wikipedia. After you get your text file set up, make a program (python preferably) which converts the contents of the text document -> a file with the hex string for the table.

The idea is to have a text file which is easy to edit that you apply the python script on, then you produce the table. That way in future, editing these tables are as simple as editing the text file and re-compiling.

I know it seems a little complicated, but if you make the first text file, I will write the python script (unless you can which would be great).
...

PokemonBen

Kanto Champion

Seen April 27th, 2020
Posted December 7th, 2015
60 posts
4.9 Years
Are you wanting some do this for every move? Pretend this is tackle:

struct move_table {
u8 script_id; 5
u8 base_power; 50
u8 type; Normal
u8 accuracy; 70%
u8 PP; 15
u8 effect_accuracy; ????
u8 affected_targets; Single
u8 priority; ???
u8 contact : 1; I assume 0=no 1= yes
u8 protect : 1;
u8 magic_coat : 1;
u8 snatch : 1;
u8 mirror_move : 1;
u8 kings_2,k : 1;
u8 crit_chance : 1;
u8 padding_field : 1;
u8 is_special; 0
u16 move_id; 5
};

EDIT: Also that list has 720 Pokemon, isn't there 721?
Male
Seen June 6th, 2020
Posted April 30th, 2020
218 posts
7.1 Years
Damage calculator doesn't handle this sort of thing. It simply just calculates damage.



Maybe later, it would've been nice to know the item table had a field like that before I made this code :x



This is definitely better, good catch.



That's a temporary solution. In one of the header files I've made some settings to use a table instead of this way, but I haven't gotten around to making the actual table so a switch statement was put for place-holding. I'm waiting for contributions for this kind of thing :D

To current date, people have offered to contribute, even asked for details, but I've yet to receive any dev. help as of yet.
For the first one, knock off get a 1.5 multiplier if it manages to knock an item
Male
California
Seen May 3rd, 2016
Posted December 22nd, 2015
51 posts
7.2 Years
Hey,

I'm impressed with how much work has been done. I don't know C but I do code and the damage calc looks honestly amazing. I'm curious how this engine will work in terms of emulating the game? Does this engine function as an emulator? Or will we still use VBA?

Edit: On lines 290-310, shouldn't the checks for species come before the check for move_type? Just a small nitpick, but it would increase the efficiency, since there are so many more times where, for instance, a water or dragon type move will be used when it's not palkia, than when palkia uses a non water or dragon-type move. It just breaks sooner if the species check is first I believe

Also, in the same file, at 948, natural gift changes the attacking type as well as the base power.
~Eclectic~

FBI

Free supporter

Male
Unknown Island
Seen August 2nd, 2020
Posted December 17th, 2019
1,910 posts
7.7 Years
Are you wanting some do this for every move? Pretend this is tackle:

struct move_table {
u8 script_id; 5
u8 base_power; 50
u8 type; Normal
u8 accuracy; 70%
u8 PP; 15
u8 effect_accuracy; ????
u8 affected_targets; Single
u8 priority; ???
u8 contact : 1; I assume 0=no 1= yes
u8 protect : 1;
u8 magic_coat : 1;
u8 snatch : 1;
u8 mirror_move : 1;
u8 kings_2,k : 1;
u8 crit_chance : 1;
u8 padding_field : 1;
u8 is_special; 0
u16 move_id; 5
};

EDIT: Also that list has 720 Pokemon, isn't there 721?
For the move table stuff check out this convo: http://www.pokecommunity.com/converse.php?u=471720&u2=365518

For the first one, knock off get a 1.5 multiplier if it manages to knock an item
added~

Hey,

I'm impressed with how much work has been done. I don't know C but I do code and the damage calc looks honestly amazing. I'm curious how this engine will work in terms of emulating the game? Does this engine function as an emulator? Or will we still use VBA?

Edit: On lines 290-310, shouldn't the checks for species come before the check for move_type? Just a small nitpick, but it would increase the efficiency, since there are so many more times where, for instance, a water or dragon type move will be used when it's not palkia, than when palkia uses a non water or dragon-type move. It just breaks sooner if the species check is first I believe

Also, in the same file, at 948, natural gift changes the attacking type as well as the base power.
So the battle engine is a replacement to the one that's currently in Fire Red. You build this version and replace the one that's currently in the ROM. So to answer your question, you'd be able to use your favourite Emulator or console to play a FR ROM with this engine inplace.

Yes, Natural gift and a few others are place holders until I get some tables working inplace. Fling, Natural power, mold breaker, sheer force, iron fist ect, will be using tables in the near future.

As for the comparison thing, you're totally right if I were deriving these values on each loop up, but they're pre-derrived. Also It'd only hit that part of code if the Pokemon is holding lustrous orb (which would be strange for anything that's not a Palkia).

Sheer Force Table:
Spoiler:

SheerForceTableLocation:
.hword ACID
.hword ACID_SPRAY
.hword AIR_SLASH
.hword ANCIENTPOWER
.hword ASTONISH
.hword AURORA_BEAM
.hword BITE
.hword BLAZE_KICK
.hword BLIZZARD
.hword BLUE_FLARE
.hword BODY_SLAM
.hword BOLT_STRIKE
.hword BONE_CLUB
.hword BOUNCE
.hword BUBBLE
.hword BUBBLEBEAM
.hword BUG_BUZZ
.hword BULLDOZE
.hword CHARGE_BEAM
.hword CHATTER
.hword CONFUSION
.hword CONSTRICT
.hword CROSS_POISON
.hword CRUNCH
.hword CRUSH_CLAW
.hword DARK_PULSE
.hword DISCHARGE
.hword DIZZY_PUNCH
.hword DRAGON_RUSH
.hword DRAGONBREATH
.hword DYNAMICPUNCH
.hword EARTH_POWER
.hword ELECTROWEB
.hword EMBER
.hword ENERGY_BALL
.hword EXTRASENSORY
.hword FAKE_OUT
.hword FIERY_DANCE
.hword FIRE_BLAST
.hword FIRE_FANG
.hword FIRE_PUNCH
.hword FLAME_CHARGE
.hword FLAME_WHEEL
.hword FLAMETHROWER
.hword FLARE_BLITZ
.hword FLASH_CANNON
.hword FOCUS_BLAST
.hword FORCE_PALM
.hword FREEZE_SHOCK
.hword GLACIATE
.hword GUNK_SHOT
.hword HEADBUTT
.hword HEART_STAMP
.hword HEAT_WAVE
.hword HURRICANE
.hword HYPER_FANG
.hword ICE_BEAM
.hword ICE_BURN
.hword ICE_FANG
.hword ICE_PUNCH
.hword ICICLE_CRASH
.hword ICY_WIND
.hword INFERNO
.hword IRON_HEAD
.hword IRON_TAIL
.hword LAVA_PLUME
.hword LEAF_TORNADO
.hword LICK
.hword LOW_SWEEP
.hword LUSTER_PURGE
.hword METAL_CLAW
.hword METEOR_MASH
.hword MIRROR_SHOT
.hword MIST_BALL
.hword MOONBLAST
.hword MUD_BOMB
.hword MUD_SHOT
.hword MUD_SLAP
.hword MUDDY_WATER
.hword NEEDLE_ARM
.hword NIGHT_DAZE
.hword OCTAZOOKA
.hword OMINOUS_WIND
.hword PLAY_ROUGH
.hword POISON_FANG
.hword POISON_JAB
.hword POISON_STING
.hword POISON_TAIL
.hword POWDER_SNOW
.hword PSYBEAM
.hword PSYCHIC
.hword RAZOR_SHELL
.hword RELIC_SONG
.hword ROCK_CLIMB
.hword ROCK_SLIDE
.hword ROCK_SMASH
.hword ROCK_TOMB
.hword ROLLING_KICK
.hword SACRED_FIRE
.hword SCALD
.hword SEARING_SHOT
.hword SECRET_POWER
.hword SEED_FLARE
.hword SHADOW_BALL
.hword SIGNAL_BEAM
.hword SILVER_WIND
.hword SKY_ATTACK
.hword SLUDGE
.hword SLUDGE_BOMB
.hword SLUDGE_WAVE
.hword SMOG
.hword SNARL
.hword SNORE
.hword SPARK
.hword STEAMROLLER
.hword STEEL_WING
.hword STOMP
.hword STRUGGLE_BUG
.hword THUNDER
.hword THUNDER_FANG
.hword THUNDERBOLT
.hword THUNDERPUNCH
.hword THUNDERSHOCK
.hword TRI_ATTACK
.hword TWINEEDLE
.hword TWISTER
.hword VOLT_TACKLE
.hword WATER_PULSE
.hword WATERFALL
.hword ZAP_CANNON
.hword ZEN_HEADBUTT
.hword 0xFEFE, 0xFFFF @ End table


Perhaps not exactly the format you want, but I had it so I post it
So...I can't use this without a second reference file. How would I associate Move names -> Move IDs (which is needed to make the table)? I'd first have to generate my file for my #defines for moves, then use that to replace the move names here before finally converting. I was looking for something more like this:

Sheer Force Table:

Move_name Move_id
Move_name2 Move_id2
... ect
Thanks though :o

---------

Well, I managed to finish doing the set-up for the battle structs today. You can checkout which battle modes are supported by default (ones I'm coding atleast, if you wanted to, you could add your own). https://github.com/EternalCode/Battle-System/blob/master/src/battle_init.c

Finally, a note, if you're working on something, please let us know in the thread that way we don't overlap resources. Not that anyone is working on any code except me right now :c.
...
Male
Antarctica
Seen April 1st, 2020
Posted September 26th, 2017
326 posts
6.4 Years
I see, I don't know Hex so I cannot help you with moves as I have idea how 0x23 = 40. However, if you need help with HTML... :P
Use an online dec -> hex converter. Hex, binary, and decimal are just different ways to show numbers, and hex is easier to work with for this kind of stuff. Hex is base 16 (0-F), decimal is base ten (0-9), and binary is base two (0-1). You can't learn hex because it's not a language, just a better way to show certain things in the ROM.

PokemonBen

Kanto Champion

Seen April 27th, 2020
Posted December 7th, 2015
60 posts
4.9 Years
Use an online dec -> hex converter. Hex, binary, and decimal are just different ways to show numbers, and hex is easier to work with for this kind of stuff. Hex is base 16 (0-F), decimal is base ten (0-9), and binary is base two (0-1). You can't learn hex because it's not a language, just a better way to show certain things in the ROM.
I see, I know Binary (or at least 0=no, 1=yes.) But thanks for tips.

Edit: @FBI Is BluRose helping you with the moves? Just started doing Absorb but don't want to have no point to it.

FBI

Free supporter

Male
Unknown Island
Seen August 2nd, 2020
Posted December 17th, 2019
1,910 posts
7.7 Years
I see, I know Binary (or at least 0=no, 1=yes.) But thanks for tips.

Edit: @FBI Is BluRose helping you with the moves? Just started doing Absorb but don't want to have no point to it.
I don't know if he'll actually do it. I haven't been informed. Maybe you should start from the bottom up, likely he would've started with pound.
...

PokemonBen

Kanto Champion

Seen April 27th, 2020
Posted December 7th, 2015
60 posts
4.9 Years
I don't know if he'll actually do it. I haven't been informed. Maybe you should start from the bottom up, likely he would've started with pound.
Dunno what list he'll be using then, was going to do it in alphabetical order using Pokemondb.net list of attacks in Pokemon.

I do have some questions. Could you tell me where to find the hex values for move types? Like in your Pound example, 0x00 = normal. Also, I get the Bitfield to binary but how did you calculate Bitfield, I don't know what that is.

Edit: Forget that bit field, I think I know how to work it out. I'll explain when I give you my first example.
Male
Seen June 6th, 2020
Posted April 30th, 2020
218 posts
7.1 Years
So...I can't use this without a second reference file. How would I associate Move names -> Move IDs (which is needed to make the table)? I'd first have to generate my file for my #defines for moves, then use that to replace the move names here before finally converting. I was looking for something more like this:


Thanks though :o
Can't you just #include move.h ?

FBI

Free supporter

Male
Unknown Island
Seen August 2nd, 2020
Posted December 17th, 2019
1,910 posts
7.7 Years
Dunno what list he'll be using then, was going to do it in alphabetical order using Pokemondb.net list of attacks in Pokemon.

I do have some questions. Could you tell me where to find the hex values for move types? Like in your Pound example, 0x00 = normal. Also, I get the Bitfield to binary but how did you calculate Bitfield, I don't know what that is.

Edit: Forget that bit field, I think I know how to work it out. I'll explain when I give you my first example.
Umm, I don't mean to offend you, but I'm not sure that you know enough to help out just yet. I wouldn't be confident using the stuff you made if I knew you didn't know the basic data types.

Maybe something easier will pop up for you to do. I've explained all your questions in that conversation I linked you previously.

I modified the pokemon.h file with the forms added, and I intend to do the megas soon after :)
Great! I noticed someone forked the repo, I guess that was you? Will wait along for a PR later :D

Can't you just #include move.h ?
Nope, I'm writing all the file generation programs in Python, not C. While I could try doing it in C, I'm unfamiliar with the string regex libraries C uses (and honestly I'd much rather keep it using this system). I could use Shell script/bash but I have a feeling most people here don't have that on their machines.
...
Male
California
Seen May 3rd, 2016
Posted December 22nd, 2015
51 posts
7.2 Years
Great! I noticed someone forked the repo, I guess that was you? Will wait along for a PR later :D
I have never used github before so...
What does that even mean? All I tried to do was submit an edit to the repo online. Is that what a fork is? Also, what is a PR? hahaha, sorry for the questions

Edit: added megas
~Eclectic~

PokemonBen

Kanto Champion

Seen April 27th, 2020
Posted December 7th, 2015
60 posts
4.9 Years
Umm, I don't mean to offend you, but I'm not sure that you know enough to help out just yet. I wouldn't be confident using the stuff you made if I knew you didn't know the basic data types.

Maybe something easier will pop up for you to do. I've explained all your questions in that conversation I linked you previously.
Well that's a shame but I understand.

DizzyEgg

Age 23
Male
Poland
Seen 1 Week Ago
Posted April 23rd, 2020
795 posts
6.6 Years
This is amazing FBI. I can't wait to see an usable version of this. I'd also gladly help with tables. Though, I have some questions.

Read if you have time but don't know C or ASM & are interested in helping:
Spoiler:

Guys, if you want to help, just take a look at the OP. Pick one that's not in green and not in orange and do one. There's plenty of work to go around :)

There's also this in BPRE.LD:
/*
* Place holder data
*/

sheer_force_t = 0x0;
mega_items_t = 0x0;
Those are supposed to be tables. For sheer_force_t, it's a table where each entry is 2 bytes long (reversed), each entry is a move which is affected by the ability Sheer Force. For mega_items_t, that's a table of item IDs (reversed again) where each ID is the ID of a mega stone.

Finally, I still need tables for Fling, Mold breaker (abilities it disables), Iron fist, Reckless, Berries table (table of all the berry's item ids) and Natural gift.

Some harder to make tables (since they'd have to made them by hand - but they are BADLY needed) :
- Type chart (your type chart MUST work for Pokemon more than 2 types)
- Move table using this format:
struct move_table {
    u8 script_id;
    u8 base_power;
    u8 type;
    u8 accuracy;
    u8 PP;
    u8 effect_accuracy;
    u8 affected_targets;
    u8 priority;
    u8 contact : 1;
    u8 protect : 1;
    u8 magic_coat : 1;
    u8 snatch : 1;
    u8 mirror_move : 1;
    u8 kings_2,k : 1;
    u8 crit_chance : 1;
    u8 padding_field : 1;
    u8 is_special;
    u16 move_id;
};
note u8 something : 1;
basically is like saying something takes up 1 bit of a bitfield size u8 (1 byte). So the first bit in the move table's bit field is contact (if a move makes contact) second bit is protect (if it's affected by protect) ect.
I read your linked conversation with BluRose but there are still some things that aren't clear to me. Let's say I want to do Acid Amror.

Spoiler:

struct move_table {
u8 script_id; 0x00
u8 base_power; 0x00
u8 type; 0x03
u8 accuracy; 0x64
u8 PP;
u8 effect_accuracy;0x64 (what's the difference between this and accuracy?)
u8 affected_targets;0x10
u8 priority;0x0(is there a list with values depending on the priority of the moves?)
u8 contact : 0
u8 protect : 0;
u8 magic_coat : 0;
u8 snatch : 1;
u8 mirror_move : 1;
u8 kings_2,k : 0;
u8 crit_chance : 0;
u8 padding_field : 1;
u8 is_special;(it's a status move, not sure what here)
u16 move_id;0x97
};

But obviously it's not the format you want for moves, is it? You posted this:
Pound, script_id :0x00, base_power: 0x28, type: 0x00, Effect accuracy: 0x64, PP: 0x23, Affected targets: 0x00, Priority: 0x00, Flags: 0x00, Bitfield: 0x33, is_special : 0x00, move ID: 0x0000
So I assume that's how you want it written. There's no accuracy there though.
I hope you'll answer my questions and I'll get to work and do some moves.

PokemonBen

Kanto Champion

Seen April 27th, 2020
Posted December 7th, 2015
60 posts
4.9 Years
This is amazing FBI. I can't wait to see an usable version of this. I'd also gladly help with tables. Though, I have some questions.



I read your linked conversation with BluRose but there are still some things that aren't clear to me. Let's say I want to do Acid Amror.

Spoiler:

struct move_table {
u8 script_id; 0x00
u8 base_power; 0x00
u8 type; 0x03
u8 accuracy; 0x64
u8 PP;
u8 effect_accuracy;0x64 (what's the difference between this and accuracy?)
u8 affected_targets;0x10
u8 priority;0x0(is there a list with values depending on the priority of the moves?)
u8 contact : 0
u8 protect : 0;
u8 magic_coat : 0;
u8 snatch : 1;
u8 mirror_move : 1;
u8 kings_2,k : 0;
u8 crit_chance : 0;
u8 padding_field : 1;
u8 is_special;(it's a status move, not sure what here)
u16 move_id;0x97
};

But obviously it's not the format you want for moves, is it? You posted this:
So I assume that's how you want it written. There's no accuracy there though.
I hope you'll answer my questions and I'll get to work and do some moves.
He has a new system called Bitfield where you do not need to do u8 contact ect. This is mine for Acid Amor before he told me to stop: Link I don't even know if I am doing it right, as I never actually showed him.

FBI

Free supporter

Male
Unknown Island
Seen August 2nd, 2020
Posted December 17th, 2019
1,910 posts
7.7 Years
This is amazing FBI. I can't wait to see an usable version of this. I'd also gladly help with tables. Though, I have some questions.



I read your linked conversation with BluRose but there are still some things that aren't clear to me. Let's say I want to do Acid Amror.

Spoiler:

struct move_table {
u8 script_id; 0x00
u8 base_power; 0x00
u8 type; 0x03
u8 accuracy; 0x64
u8 PP;
u8 effect_accuracy;0x64 (what's the difference between this and accuracy?)
u8 affected_targets;0x10
u8 priority;0x0(is there a list with values depending on the priority of the moves?)
u8 contact : 0
u8 protect : 0;
u8 magic_coat : 0;
u8 snatch : 1;
u8 mirror_move : 1;
u8 kings_2,k : 0;
u8 crit_chance : 0;
u8 padding_field : 1;
u8 is_special;(it's a status move, not sure what here)
u16 move_id;0x97
};

But obviously it's not the format you want for moves, is it? You posted this:
So I assume that's how you want it written. There's no accuracy there though.
I hope you'll answer my questions and I'll get to work and do some moves.
Either is fine. It just has to be in a static format so I can write a program to generate the table :)
...

FBI

Free supporter

Male
Unknown Island
Seen August 2nd, 2020
Posted December 17th, 2019
1,910 posts
7.7 Years
This is amazing FBI. I can't wait to see an usable version of this. I'd also gladly help with tables. Though, I have some questions.



I read your linked conversation with BluRose but there are still some things that aren't clear to me. Let's say I want to do Acid Amror.

Spoiler:

struct move_table {
u8 script_id; 0x00
u8 base_power; 0x00
u8 type; 0x03
u8 accuracy; 0x64
u8 PP;
u8 effect_accuracy;0x64 (what's the difference between this and accuracy?)
u8 affected_targets;0x10
u8 priority;0x0(is there a list with values depending on the priority of the moves?)
u8 contact : 0
u8 protect : 0;
u8 magic_coat : 0;
u8 snatch : 1;
u8 mirror_move : 1;
u8 kings_2,k : 0;
u8 crit_chance : 0;
u8 padding_field : 1;
u8 is_special;(it's a status move, not sure what here)
u16 move_id;0x97
};

But obviously it's not the format you want for moves, is it? You posted this:
So I assume that's how you want it written. There's no accuracy there though.
I hope you'll answer my questions and I'll get to work and do some moves.
Either is fine. It just has to be in a static format so I can write a program to generate the table. Have effect accuracy == move accuracy in your table, and priorities are just 0, 1, 2, 3, 4 (I don't know if there is a move with +4 priority, fakeout maybe?). Recall that there are also negative priority moves as well. For the u8 is_special section, use 0x3 for status move.
...

BluRose

blu rass

Age 19
Male
michigan tech
Seen 6 Hours Ago
Posted 17 Hours Ago
788 posts
6.4 Years
Spoiler:
This is amazing FBI. I can't wait to see an usable version of this. I'd also gladly help with tables. Though, I have some questions.



I read your linked conversation with BluRose but there are still some things that aren't clear to me. Let's say I want to do Acid Amror.

Spoiler:

struct move_table {
u8 script_id; 0x00
u8 base_power; 0x00
u8 type; 0x03
u8 accuracy; 0x64
u8 PP;
u8 effect_accuracy;0x64 (what's the difference between this and accuracy?)
u8 affected_targets;0x10
u8 priority;0x0(is there a list with values depending on the priority of the moves?)
u8 contact : 0
u8 protect : 0;
u8 magic_coat : 0;
u8 snatch : 1;
u8 mirror_move : 1;
u8 kings_2,k : 0;
u8 crit_chance : 0;
u8 padding_field : 1;
u8 is_special;(it's a status move, not sure what here)
u16 move_id;0x97
};

But obviously it's not the format you want for moves, is it? You posted this:
So I assume that's how you want it written. There's no accuracy there though.
I hope you'll answer my questions and I'll get to work and do some moves.
I don't believe FBI answered the "this and accuracy" question, only really saying that it should be equal in the case of Acid Armor, which is true.
"Effect Accuracy" is going to be the chance of the secondary effect happening. It should be 0 for Acid Armor because Acid Armor doesn't have a secondary effect. For example, Aurora Beam--a move with a 10% chance of lowering attack--has a table that should look something like this (correct me if I'm wrong, someone):
struct move_table {
    u8 script_id; 0x00
    u8 base_power; 0x41
    u8 type; 0x0F //I don't have a tool with me so going off of memmory here for ice type
    u8 accuracy; 0x64
    u8 PP; 0x14
    u8 effect_accuracy; 0x0A //10% chance of lowering attack
    u8 affected_targets; 0x00
    u8 priority; 0x0
    u8 contact : 0;
    u8 protect : 1;
    u8 magic_coat : 0;
    u8 snatch : 0;
    u8 mirror_move : 1;
    u8 kings_2,k : 1;
    u8 crit_chance : 0;
    u8 padding_field : 0;
    u8 is_special; 0x1
    u16 move_id; 0x3E //again, no tool, going off of memory here
};
And, also, Gen 3 Tools has a Move Editor which has the full list of priorities~ One thing that sticks out in my mind is that the lower priorities are the highest values...
And, the "padding_field" is just filler to make the bitfield 8 bits, right?
am i cool yet

DizzyEgg

Age 23
Male
Poland
Seen 1 Week Ago
Posted April 23rd, 2020
795 posts
6.6 Years
Either is fine. It just has to be in a static format so I can write a program to generate the table. Have effect accuracy == move accuracy in your table, and priorities are just 0, 1, 2, 3, 4 (I don't know if there is a move with +4 priority, fakeout maybe?). Recall that there are also negative priority moves as well. For the u8 is_special section, use 0x3 for status move.
Got it. One more thing. Bluerose explained the difference between accuracy and "effect_accuracy" which is the chance of the secondary effect happening. Though, how will you know which effect to apply? In vanilla games, there is one more byte responsible for the effect, for example 0x11 nay be the chance of paralyzing and 0x12 the chance of poisoning.