azerothcore / mod-npc-talent-template

Template NPC (gear, talents)
http://azerothcore.org/
10 stars 34 forks source link

Compilation fixes on Linux #8

Closed BarbzYHOOL closed 5 years ago

BarbzYHOOL commented 5 years ago

Related to: https://github.com/azerothcore/mod-npc-talent-template/issues/4

The big compilation error might be related to this (but I really don't think so): https://github.com/azerothcore/azerothcore-wotlk/pull/1338

@Winfidonarleyan what do you think?

https://github.com/azerothcore/azerothcore-wotlk/search?q=AddGossipItemFor&unscoped_q=AddGossipItemFor

we have this in the header though #include "ScriptedGossip.h" so it should be fine normally

Note: I haven't tested anything lol, not even compilation

BarbzYHOOL commented 5 years ago

Also if someone else than me merges it, don't squash commits because the commits are not all for the same issue

ide1234000 commented 5 years ago

Compile successfully but npc doesn't have any options in game

BarbzYHOOL commented 5 years ago

o_0 but I didn't touch the scripts My only change is that: https://github.com/azerothcore/mod-npc-talent-template/pull/8/commits/54725c05ff4e69a4ee466d774405ae6f5019bb53

BarbzYHOOL commented 5 years ago

@mindsear any idea if I broke something? apparently it compiles now at least

mindsear commented 5 years ago

I don't have a lot of free time right now. I will test this in a few days or so.

mindsear commented 5 years ago

So, I tried Barbz modified script on windows and it's still working.

Unfortunately, I don't have a linux machine lying around nor a linux vps.

For those having a linux vps and they wanna try Barbz modified script, (branch "compilation_fixes_Barbz"), please update your azerothcore server and try again.

BarbzYHOOL commented 5 years ago

Ok @mindsear thank you, I guess I can merge it until we find the solution for linux

I just need to fix the conflicts

mindsear commented 5 years ago

Managed to get my hands on a linux vps. I'll try your fixes and report back.

Also, about conflicts, I forgot to tell you that I've modified characters.sql file https://github.com/azerothcore/mod-npc-talent-template/commit/17e7e81a06632100e2fd5811703ee77a516e6470

ide1234000 commented 5 years ago

Screenshot from 2019-03-13 17-02-19 got this when compiling on Ubuntu

mindsear commented 5 years ago

Alright, First time compiling on linux server, had some difficulties but I managed to solve them relatively quickly. I've cloned a fresh azerothcore on my linux vps and then Cloned your branch and so far I got one error

alt_tag

Now we have to edit mod-npc-talent-template\src\template_scripts_loader.h Basically, we need to change "AddTemplateScripts" to "AddTemplateNPCScripts".


I figured out why we get those linux errors. My first thought was to look at some examples in azerothcore source. For example, if you take a look at npc_professions.cpp they still use the old format "player->ADD_GOSSIP_ITEM" instead of "AddGossipItemFor". Same goes for "SendGossipMenuFor", "ClearGossipMenuFor" and "CloseGossipMenuFor".

Here's TemplateNPC.cpp fixed for linux os https://gist.github.com/mindsear/d59fc35f2c7189c096db53423aedbcce

Lastly, we need to remove this line

AC_ADD_CONFIG_FILE("${CMAKE_CURRENT_LIST_DIR}/conf/TemplateNPC.conf.dist")

from mod-npc-talent-template\CmakeLists.txt

BarbzYHOOL commented 5 years ago

@ide1234000 you compiled previously and it worked lol, no update have been done to the PR

@mindsear alright, hmm do you want to edit my PR directly? I guess you can

And why do we need these changes? I know there was a big commit about GOSSIP stuff. And for the config file, are you sure? because we still have this in the skeleton module (aka template) https://github.com/azerothcore/skeleton-module/blob/master/CMakeLists.txt

mindsear commented 5 years ago

We don't need that line in CMakeLists.txt because this script doesn't need a configuration file. And we get 1 error on compilation on both linux and windows.

alt_tag

alt_tag

I will edit your PR , merge and close issue #4.