Ryouken
Joined: 10th Apr 2012
Posts: 1040
Re: Law & Marriage release r300 +
A majority of the errors seem to be from this part not being added:
Source / FWD
12 years, 4 weeks ago
|
Shroud
Joined: 24th Dec 2011
Posts: 16
Re: Law & Marriage release r300 +
chat.hpp : no such file or directory
Should I be including a different file?
Latest rev btw.
12 years, 4 weeks ago
|
Ryouken
Joined: 10th Apr 2012
Posts: 1040
Re: Law & Marriage release r300 +
Did you remember to include all the files in the project and put them in the folder the tutorial told you to? If you don't put them in the right folders, you'll either have to change the file paths in the #includes or move them in the right place.
12 years, 4 weeks ago
|
Shroud
Joined: 24th Dec 2011
Posts: 16
Re: Law & Marriage release r300 +
Yeah, law.cpp and priest.cpp are both in Handlers, and I edited the npc/character.hpp in fwd.
12 years, 4 weeks ago
|
Ryouken
Joined: 10th Apr 2012
Posts: 1040
Re: Law & Marriage release r300 +
Are you sure you have lawaction in the character fwd o.o? Because from what the errors say, you don't.
12 years, 4 weeks ago
|
Shroud
Joined: 24th Dec 2011
Posts: 16
Re: Law & Marriage release r300 +
Yeah I do, I think I fixed that error, it's not showing up anymore but I'm getting this when I try to compile:
...\src\handlers\Priest.cpp|6|fatal error: ../chat.hpp: No such file or directory|
Looking through all the files, I can't see a chat.hpp, is it necessary or can I just delete that line?
Edit: When I delete that line, I get these errors.
...\src\handlers\Citizen.cpp|102|warning: unused parameter 'reader' [-Wunused-parameter]|
...\src\handlers\Priest.cpp||In function 'void Handlers::Priest_Accept(Character*, PacketReader&)':|
...\src\handlers\Priest.cpp|15|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp|15|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp|17|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp|18|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp|20|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp||In function 'void Handlers::Priest_Use(Character*, PacketReader&)':|
...\src\handlers\Priest.cpp|38|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp|40|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp|42|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp|43|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp|46|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp|48|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp|49|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp||In function 'void Handlers::Priest_Request(Character*, PacketReader&)':|
...\src\handlers\Priest.cpp|96|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp|96|error: invalid use of incomplete type 'struct NPC_Marriage'|
...\src\handlers\..\fwd\npc.hpp|18|error: forward declaration of 'struct NPC_Marriage'|
...\src\handlers\Priest.cpp|97|error: 'class NPC' has no member named 'marriage'|
...\src\handlers\Priest.cpp|98|error: 'class NPC' has no member named 'marriage'|
||=== Build finished: 17 errors, 1 warnings ===|
I must have really fucked something up.
12 years, 4 weeks ago
|
Ryouken
Joined: 10th Apr 2012
Posts: 1040
Re: Law & Marriage release r300 +
You need this in your npc class:
NPC_Marriage *marriage;
12 years, 4 weeks ago
|
Shroud
Joined: 24th Dec 2011
Posts: 16
Re: Law & Marriage release r300 +
Ryouken posted: (5th Dec 2012, 02:04 pm)
You need this in your npc class:
NPC_Marriage *marriage;
In fwd\npc.hpp, right?
This is my fwd\npc.hpp:
[deleted, too big lol]
I'm getting the same errors with that.
Sorry about all of this, I'm new to this, but I wanted to learn from other peoples code and stuff and get better instead of using EOSource or something.
Edit: sorry, I understand what you meant now.
I added it into npc.hpp under NPC_Citizenship *citizenship; but now I'm getting about 20 of these:
...\src\handlers\Priest.cpp|15|error: invalid use of incomplete type 'struct NPC_Marriage'|
...\src\handlers\..\fwd\npc.hpp|18|error: forward declaration of 'struct NPC_Marriage'|
12 years, 4 weeks ago
|
Ryouken
Joined: 10th Apr 2012
Posts: 1040
Re: Law & Marriage release r300 +
No, I meant it literally goes in the npc class (this thing:
class NPC
{
public:
12 years, 4 weeks ago
|
Shroud
Joined: 24th Dec 2011
Posts: 16
Re: Law & Marriage release r300 +
Do I have it in the wrong place here?
class NPC
{
public:
bool temporary;
short id;
unsigned char x, y;
Direction direction;
unsigned char spawn_type;
short spawn_time;
unsigned char spawn_x, spawn_y;
std::vector<NPC_Drop *> drops;
std::string shop_name;
std::string skill_name;
std::vector<NPC_Shop_Trade_Item *> shop_trade;
std::vector<NPC_Shop_Craft_Item *> shop_craft;
std::vector<NPC_Learn_Skill *> skill_learn;
NPC_Citizenship *citizenship;
NPC_Marriage *marriage; <------ its here
NPC *parent;
bool alive;
double dead_since;
double last_act;
double act_speed;
int walk_idle_for;
bool attack;
int hp;
int totaldamage;
std::list<NPC_Opponent *> damagelist;
12 years, 4 weeks ago
|
Ryouken
Joined: 10th Apr 2012
Posts: 1040
Re: Law & Marriage release r300 +
Oh, I misunderstood, I thought you put it inside the NPC_Citizenship struct.
12 years, 4 weeks ago
|
Shroud
Joined: 24th Dec 2011
Posts: 16
Re: Law & Marriage release r300 +
Ryouken posted: (5th Dec 2012, 02:58 pm)
Oh, I misunderstood, I thought you put it inside the NPC_Citizenship struct.
I did that at first, but corrected it.
All my original errors are gone, now it's just the ones about invalid usage and forward declarations.
I'm gonna poke around at it and see if I can fix it, any ideas? :3
12 years, 4 weeks ago
|
Ryouken
Joined: 10th Apr 2012
Posts: 1040
Re: Law & Marriage release r300 +
You have this in npc.hpp as well right?:
struct NPC_Marriage
{
Character *partner[2];
bool partner_accepted[2];
bool request_accepted;
unsigned char state;
double last_execution;
NPC_Marriage() : request_accepted(false), state(1), last_execution(0.0)
{
for (int i = 0; i < 2; ++i) partner_accepted[i] = false;
}
};
That goes outside the npc class.
12 years, 4 weeks ago
|
Shroud
Joined: 24th Dec 2011
Posts: 16
Re: Law & Marriage release r300 +
Ryouken posted: (5th Dec 2012, 03:02 pm)
You have this in npc.hpp as well right?:
struct NPC_Marriage
{
Character *partner[2];
bool partner_accepted[2];
bool request_accepted;
unsigned char state;
double last_execution;
NPC_Marriage() : request_accepted(false), state(1), last_execution(0.0)
{
for (int i = 0; i < 2; ++i) partner_accepted[i] = false;
}
};
That goes outside the npc class.
No, actually.
That wasn't in the pastebin. (http://pastebin.com/UMhTGLsc)
I'll add it now and compile, I'll edit this post with the result, thank you. :3
Edit: worked perfectly and compiled, thank you.
One more question though (sorry about this) where do I add the wedding timer in world.cpp, is there a certain area it's supposed to go in?
12 years, 4 weeks ago
|
Ryouken
Joined: 10th Apr 2012
Posts: 1040
Re: Law & Marriage release r300 +
It goes in the world construct (world::world). I would put it near the other timers in there, just be organized.
12 years, 4 weeks ago
| | | | | | | | | | | | | | | |