Jump to content
TrinityCore

Rochet2

Members
  • Posts

    967
  • Joined

  • Last visited

  • Days Won

    83

Posts posted by Rochet2

  1. 14 hours ago, Aokromes said:

    i pasted the item to use the add item after.

    I assume you are using actual item link.
    The command is supposed to work with exact item name as well, not just item link. At least from what I recall reading from the command tooltip.
    So typing ".additem [Champion Herod's Shoulder]" in plain text to the chat should work and works for items that dont have apostrophe iirc.

  2. It would be best to avoid SQL queries if you can.
    However as you asked for an example of how to make this query, here is one:

    #include "DatabaseEnv.h"
    
    int64 count = CharacterDatabase.PQuery("SELECT COUNT(*) FROM characters_spells WHERE guid = %u", player->GetGUID().GetCounter())->Fetch()[0].GetInt64();
    if (count >= 30)
    {
    }

    In this code

    - the include allows you to use CharacterDatabase variable, which is a global variable.
    - PQuery makes a database query and allows you to use printf like syntax to format variables into the SQL.
    - GetCounter returns the part of the guid that is usually used in DB for players and items to identify them.
    - Fetch returns the current row from the query result, we call this directly as we know that a result will be returned from this specific SQL.
    - [0] accesses the first column in the query result. In this case it is the count.
    - GetInt64() takes the column data and handles it as an int64 value. Most math in SQL is done with bigint, so using uint32 or similar may actually not work on some machines. Always use proper type!
    - the resulting value is stored into a variable "count" and then compared against 30.

  3. @Verytas Starting over with the source code that matches your client version (7.x) should fix the most imminent issues you have. (follow what I said before)

    TrinityCore seems to be in the middle of transitioning to 8.x. Guides have not been updated yet and without external tools you cannot use 8.x client yet with TC, so I would not personally recommend trying to use the latest master branch or 8.x clients yet.

    • Like 1
  4. 1 minute ago, meeek said:

    I added this:

    if (boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
      target_compile_definitions(boost
        INTERFACE
          -DBOOST_DATE_TIME_NO_LIB
          -DBOOST_REGEX_NO_LIB
          -DBOOST_CHRONO_NO_LIB)
    else()
      target_compile_definitions(boost
        INTERFACE
          -DBOOST_DATE_TIME_NO_LIB
          -DBOOST_REGEX_NO_LIB
          -DBOOST_CHRONO_NO_LIB
    -DBOOST_NO_CXX11_SCOPED_ENUMS)

    And the only problem I get is with the first line and if, cause its not closed.

    1

    Hmm, why did you add that? I don't think I suggested such at least.
    The commit/changes I referenced had no mention of such code.
    https://github.com/TrinityCore/TrinityCore/commit/5734643cecbadfffb7ee1b66c9665d57108923f6#diff-82d123ab4d0745ba8103dc4b10c23d9f
     

    5 minutes ago, fonigoy said:

    Sorry for being a big big noob but I have no idea what you mean by cherrypick, Should I just download a less recent boost version too?

    4 minutes ago, fonigoy said:

    I have absolutely 0 coding experience and I'm doing this just to experience and learn with my friends while having fun IG

    If you have 0 experience, maybe trying out the latest version of TC is easier. And if you are already are using the latest version, then you have probably mismatching dependencies or you installed only boost source without the precompiled binaries or similar - for that you should post information about your installation like what boost you have, how does the installation of it look etc.
    If you really need to try some old unsupported core .. maybe using old versions is an ok choice if you just want to get things working.
    Less recent boost usually means using a less recent compiler as well if you use the precompiled packages.
    Cherry-picking is taking only a specific commit/change. You can do that with the command "git cherry-pick <commit>". You can also just do the changes manually. Googling will get you far :)

     

    6 minutes ago, meeek said:

    I tried cheerypicking literally every row and what made sense, nothing works. I'm clueless

    Hmm, after the other post you made I am not sure what exactly you did or tried.
    Maybe using the older version of compiler and boost is ok if you can't get anything to work and if they work. To be able to work with the latest tools and libs you would need the changes though.

  5. 2 minutes ago, meeek said:

    So I'm supposed to use Boost 1.51?
     

    > find_package(Boost 1.51 REQUIRED system filesystem thread program_options iostreams regex)

    >

    set(BOOST_DEBUG ON)
    if(DEFINED ENV{BOOST_ROOT})
    set(BOOST_ROOT $ENV{BOOST_ROOT})
    if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0)
    set(BOOST_LIBRARYDIR ${BOOST_ROOT}/lib${PLATFORM}-msvc-12.0)
    else()
    set(BOOST_LIBRARYDIR ${BOOST_ROOT}/lib${PLATFORM}-msvc-14.0)

    endif()

     

    and CMake less than 19?

     

     

    No. You should cherry-pick the commit I referenced. It should fix your problem with boost (clear cmake cache and retry configure after you cherry picked).

    Though I guess also using older versions would get rid of the error since it is caused by newer versions, but .. is  using old stuff really the solution?

  6. With the boost you have you should be using win64.
    There was some problems with the new boost versions and the cmake script a while back. Maybe the 6.x core you have has the old cmake script that cannot handle the .1 in the folder name. For this reason I think I temporarily copied my lib64-msvc-14.1 folder and named it lib64-msvc-14.0. But instead of that maybe its better to check if your core has the needed boost cmake changes: https://github.com/TrinityCore/TrinityCore/commit/5734643cecbadfffb7ee1b66c9665d57108923f6#diff-82d123ab4d0745ba8103dc4b10c23d9f

     

     

    .. and now right after writing that I just went there and checked and it doesnt, so maybe cherry pick that commit or something.

  7. 4 minutes ago, meeek said:

    I have 1, yes. lib64-msvc-14.1 and, libs.

     

    I'll try one more time :P You have discord or I can link you my stream and you can walk through me from there? I'd be down to paypal for help

     

    Which compiler did you choose in cmake?

    eku8DB8.png

    Did you choose Win64? or the one without it?

  8. Usually, if you have boost root set up properly, it can still fail if you are using the boost source instead of precompiled binaries or binaries compiled by yourself.

    For example, I have everything set up correctly, however when I hide lib64-msvc-14.0 and lib64-msvc-14.1 from my boost installation folder, Cmake will complain with

    	CMake Error at cmake/macros/FindBoost.cmake:1231 (message):
    Unable to find the requested Boost libraries.
    
    Boost version: 1.64.0
    
    Boost include path: C:/local/boost_1_64_0
    
    Could not find the following static Boost libraries:
    
    boost_system
    boost_filesystem
    boost_thread
    boost_program_options
    boost_iostreams
    boost_regex
    
    No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
    directory containing Boost libraries or BOOST_ROOT to the location of
    Boost. If you still have problems search on forum for TCE00020.
    Call Stack (most recent call first):
    dep/boost/CMakeLists.txt:44 (find_package)
    	

  9. Due to .. relatively new changes .. majority of guides and scripts are now outdated.
    This happens every now and then since the TC scripting "API" changes to better meet the needs of scripts in the core and sometimes external code.
    Also currently TC master and 3.3.5 branches have different gossip scripting APIs.

    While guides and old scripts may be a good way to learn things, they always eventually get outdated if no one maintains them.
    I think that the most uptodate "documentation" is the code in the core itself. So looking at existing gossip scripts you know what to do.
    Here is an example of a gossip script:
    https://github.com/TrinityCore/TrinityCore/blob/f6b6f57a6da909426e3171d09f989c554f20b43d/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp#L53-L108

     

    • Upvote 1
×
×
  • Create New...