McPaul
On my way to become a controversial and hated memb
- 289
- Posts
- 7
- Years
- He/ Him
- Switzerland
- Seen Apr 20, 2025
Hello! I have a problem with adding fuctions to items.
Here is an explanation:
If I do this:
const u8 gItemEffect_HondewBerry[10] = {
[4] = ITEM4_EV_SPATK | ITEM4_EV_SPDEF | ITEM4_FRIENDSHIP_ALL,
[5] = 1,
[6] = 1,
[7] = 10,
[8] = 5,
[9] = 2,
};
I get these error messages:
But if I obey what the compilator wants me to do and put [5] = ITEM5_EV_SPATK | ITEM5_EV_SPDEF | ITEM5_FRIENDSHIP_ALL, I must sacrifice a friendship gain line.
What can I do to avoid sacrifices?
Here is an explanation:
If I do this:
const u8 gItemEffect_HondewBerry[10] = {
[4] = ITEM4_EV_SPATK | ITEM4_EV_SPDEF | ITEM4_FRIENDSHIP_ALL,
[5] = 1,
[6] = 1,
[7] = 10,
[8] = 5,
[9] = 2,
};
I get these error messages:
Spoiler:
In file included from src/pokemon.c:1349:
src/data/pokemon/item_effects.h:374: `ITEM4_EV_SPATK' undeclared here (not in a function)
src/data/pokemon/item_effects.h:374: `ITEM4_EV_SPDEF' undeclared here (not in a function)
src/data/pokemon/item_effects.h:374: `ITEM4_FRIENDSHIP_ALL' undeclared here (not in a function)
src/data/pokemon/item_effects.h:374: initializer element for `gItemEffect_HondewBerry[4]' is not constant
src/data/pokemon/item_effects.h:380: initializer element for `gItemEffect_HondewBerry' is not constant
Makefile:252: recipe for target 'build/emerald/src/pokemon.o' failed
make: *** [build/emerald/src/pokemon.o] Error 1
src/data/pokemon/item_effects.h:374: `ITEM4_EV_SPATK' undeclared here (not in a function)
src/data/pokemon/item_effects.h:374: `ITEM4_EV_SPDEF' undeclared here (not in a function)
src/data/pokemon/item_effects.h:374: `ITEM4_FRIENDSHIP_ALL' undeclared here (not in a function)
src/data/pokemon/item_effects.h:374: initializer element for `gItemEffect_HondewBerry[4]' is not constant
src/data/pokemon/item_effects.h:380: initializer element for `gItemEffect_HondewBerry' is not constant
Makefile:252: recipe for target 'build/emerald/src/pokemon.o' failed
make: *** [build/emerald/src/pokemon.o] Error 1
But if I obey what the compilator wants me to do and put [5] = ITEM5_EV_SPATK | ITEM5_EV_SPDEF | ITEM5_FRIENDSHIP_ALL, I must sacrifice a friendship gain line.
What can I do to avoid sacrifices?