[C++] Creature AI Problem menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Performer's Avatar Contributor
    Reputation
    212
    Join Date
    Nov 2007
    Posts
    874
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [C++] Creature AI Problem

    Okay ive just started learning CreatureAI. Followed guides etc on Sun++ Wiki.
    I get these errors on compile.

    Errors:
    Code:
    1>..\src\DiabloMountains\Wolvie.cpp(16) : error C2504: 'MoonScriptCreatureAI' : base class undefined
    1>..\src\DiabloMountains\Wolvie.cpp(17) : error C2061: syntax error : identifier 'MoonScriptCreatureAI'
    1>..\src\DiabloMountains\Wolvie.cpp(17) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>..\src\DiabloMountains\Wolvie.cpp(17) : warning C4183: 'MOONSCRIPT_FACTORY_FUNCTION': missing return type; assumed to be a member function returning 'int'
    1>..\src\DiabloMountains\Wolvie.cpp(18) : error C2061: syntax error : identifier 'Creature'
    1>..\src\DiabloMountains\Wolvie.cpp(18) : error C2065: 'pCreature' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(19) : error C2614: 'WolvieAI' : illegal member initialization: 'MoonScriptCreatureAI' is not a base or member
    1>..\src\DiabloMountains\Wolvie.cpp(20) : error C2065: 'Target_Current' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(20) : error C3861: 'AddSpell': identifier not found
    1>..\src\DiabloMountains\Wolvie.cpp(21) : error C2065: 'Target_Current' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(21) : error C3861: 'AddSpell': identifier not found
    1>..\src\DiabloMountains\Wolvie.cpp(22) : error C2065: 'Target_Current' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(22) : error C3861: 'AddSpell': identifier not found
    1>..\src\DiabloMountains\Wolvie.cpp(23) : error C2065: 'Target_RandomPlayer' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(23) : error C3861: 'AddSpell': identifier not found
    1>..\src\DiabloMountains\Wolvie.cpp(28) : error C2065: 'Unit' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(28) : error C2065: 'pTarget' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(29) : error C2448: 'OnCombatStart' : function-style initializer appears to be a function definition
    1>..\src\DiabloMountains\Wolvie.cpp(45) : error C2065: 'Unit' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(45) : error C2065: 'mTarget' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(46) : error C2448: 'OnTargetDied' : function-style initializer appears to be a function definition
    1>..\src\DiabloMountains\Wolvie.cpp(63) : error C2065: 'Unit' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(63) : error C2065: 'mTarget' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(64) : error C2448: 'OnCombatStop' : function-style initializer appears to be a function definition
    1>..\src\DiabloMountains\Wolvie.cpp(71) : error C2065: 'Unit' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(71) : error C2065: 'mKiller' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(72) : error C2448: 'OnDied' : function-style initializer appears to be a function definition
    1>..\src\DiabloMountains\Wolvie.cpp(77) : error C2065: 'ScriptMgr' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(77) : error C2065: 'mgr' : undeclared identifier
    1>..\src\DiabloMountains\Wolvie.cpp(78) : error C2448: 'SetupDiabloMountains' : function-style initializer appears to be a function definition
    Source:
    Code:
    /*Created by Performer of MMOwned and HypnoticWoW
    (www.hypnotic-wow.com).
    All Rights Reserved.
    */
    
    #include "Base.h"
    #include "StdAfx.h"
    #include "Setup.h"
    
    /////////////////////////////////////////////////////
    
    #define CN_WOLVIE_GUARD                    600005
    
    #define WOLVIE_GUARD_WHIRLWIND            41097
    #define WOLVIE_GUARD_BLOODTHIRST        35949
    #define WOLVIE_GUARD_ENRAGE                38664
    #define WOLVIE_GUARD_INTERCEPT            61490
    
    /////WOLVIE AI
    
    class WolvieAI : public CreatureAIScript
    {
         MOONSCRIPT_FACTORY_FUNCTION(WolvieAI, CreatureAIScript);
         WolvieAI(Creature *pCreature) : CreatureAIScript(pCreature)
         {
            AddSpell(WOLVIE_GUARD_WHIRLWIND, Target_Current, 15, 0, 15, 0, 10); //15 = chance % 0 = Instantcast 1 would be not instant 15 = cooldown seconds 0, 30 = range
             AddSpell(WOLVIE_GUARD_BLOODTHIRST, Target_Current, 8, 0, 10, 3);
             AddSpell(WOLVIE_GUARD_ENRAGE, Target_Current, 100, 0, 1, 0, 10);
             AddSpell(WOLVIE_GUARD_INTERCEPT, Target_RandomPlayer, 10, 0, 20, 25);
    
         }
     };
    
    void OnCombatStart(Unit *pTarget)
         {
             int RandomSpeach = rand()%3;
            switch (RandomSpeach)
            {
            case 0:
                _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "You picked the wrong guy!");
                break;
            case 1:
                _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "I'll carve the meat from your bones!");
                break;
            case 2:
                _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "Prepare to taste my steel!");
                break;
            }
         }
    
    void OnTargetDied(Unit* mTarget)
        {
            int RandomSpeach = rand()%3;
            switch (RandomSpeach)
            {
            case 0:
                _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You failed!");
                break;
            case 1:
                _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Did you taste the steel!?... Did you??");
                break;
            case 2:
                _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Now for your teammates!");
                break;
            }
         
        }
    
    void OnCombatStop(Unit *mTarget)
        {
            _unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "We will not be hearing anything out of them!"
            _unit->GetAIInterface()->setCurrentAgent(AGENT_NULL);
            _unit->GetAIInterface()->SetAIState(STATE_IDLE);
            RemoveAIUpdateEvent();
        }
    
    void OnDied(Unit * mKiller)
        {
            _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "No..No...My Blades Have Failed Me!!!");
            RemoveAIUpdateEvent();
        }
    
    void SetupWolvie(ScriptMgr * mgr)
     {
         mgr->register_creature_script(CN_WOLVIE_GUARD, &WolvieAI::Create);
     }


    [C++] Creature AI Problem
  2. #2
    Kalash47's Avatar Member
    Reputation
    12
    Join Date
    Oct 2008
    Posts
    61
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not properly linked to Ascent/ArcEmu core.

    It cannot recognize all of the functions & objects that are coded in Ascent/ArcEmu because you haven't linked your script properly to it.

  3. #3
    Performer's Avatar Contributor
    Reputation
    212
    Join Date
    Nov 2007
    Posts
    874
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Explain more.. I did all that the sunplusplus wiki told me to.


  4. #4
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you compile the core first?

  5. #5
    Performer's Avatar Contributor
    Reputation
    212
    Join Date
    Nov 2007
    Posts
    874
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes.

    I also tried the other Creature AI way but that was... to hard. If i put #include "Base.h" i get 1 error saying it cannot find that file.. >_<


  6. #6
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That is project file mess try fixing it!

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

  7. #7
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Performer View Post
    Yes.

    I also tried the other Creature AI way but that was... to hard. If i put #include "Base.h" i get 1 error saying it cannot find that file.. >_<
    You need to include the Sun/Moon headers because you're using the Moon base framework

Similar Threads

  1. Mangos Problem creature only meele attack
    By Bloodskull77 in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 11-30-2008, 08:27 PM
  2. [Problem] Creature Loot, doesn't drop
    By Power of Illuminati in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 07-07-2008, 11:11 PM
  3. Problems with character-creature editing
    By Falcaram in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 01-06-2008, 07:47 AM
  4. [HELP] Creature Spawn Problems
    By Matis02 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 11-23-2007, 07:32 AM
  5. Site problems
    By Shanaar in forum Community Chat
    Replies: 10
    Last Post: 05-14-2006, 01:15 AM
All times are GMT -5. The time now is 02:01 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search