How to Compile a DLL with Video menu

User Tag List

Page 1 of 6 12345 ... LastLast
Results 1 to 15 of 84
  1. #1
    SectorSeven's Avatar Banned
    Reputation
    444
    Join Date
    Oct 2007
    Posts
    1,948
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to Compile a DLL with Video

    I know Cursed made a guide on compiling a DLL, but I didn't think he explained how to make setup files, and project files, so I have created a video and text guide to help you. I suggest you use them together, and refer to the video if you have questions.

    Please download these files or make sure you have them before you begin:
    Microsoft Visual C++ v9: http://www.microsoft.com/express/vc/

    Video made by me:
    [ame="http://www.youtube.com/watch?v=PfpLFZWNoww"]YouTube - How to Compile a DLL[/ame]

    Step 1: Getting the Source
    The source is the .cpp where the actions and behavior of the script is defined. For this example, we will use GastricPenguin's GlobalNPC script. Here is the link to the pastebin: http://pastebin.ca/GPYPNyzR. The password is "gastric". Now that we have the source code, we need to save it as the correct file extension. Copy all the script from the pastebin page, and open up Notepad or Wordpad and paste it in. Go to File, Save As, name the file "GlobalNPC.cpp" and make sure you have "Save as type:" set to "All Files". Click the save button and close out.



    Step 2: Setting Up Source Files
    Create a folder on your Desktop called "GlobalNPC", exactly like that. Drag the GlobalNPC.cpp file into this folder. Now, open up the GlobalNPC.cpp file. It should open in Microsoft Visual C++ now, not Notepad or Wordpad. When we do this, we are looking for one thing, the word after the "void" statement in blue. As we look through the script, we can see that the only void statement is "void GlobalNPC". But wait, there is one that says "void SetupGlobalNPC", we will ignore this statement because it has Setup infront of it. Sometimes you will have more than one "void" statement that you will use for each script. Also, this line:
    mgr->register_gossip_script(112230, gs);
    is giving the NPC ID, you can change it to anything you want. However, you must do this prior to compiling the DLL.

    Now that we have the statements of the script, we need to actually do the Setup files. Now, we need to get the latest "format" for our setup files. You must have Ascent compiled prior to doing this, if you don't, please stop here and compile Ascent. If you don't know how, then search for my guide on it. Browse to the "\trunk\src\scripts\src\GossipScripts" folder. Copy the Setup files in that folder to the GlobalNPC folder. You do NOT need the Makefile.am with the method that we're using to compile. We just need the Setup.cpp and Setup.h files. Open the Setup.cpp file from the GlobalNPC folder. Delete the
    SetupInnkeepers(mgr);
    SetupBattlemaster(mgr);
    SetupGuardGossip(mgr);

    Now, we will use our void statement we got earlier "GlobalNPC". So type this line inbetween the brackets:
    SetupGlobalNPC(mgr);
    We will always have the protions in red there, just replace the portion in blue with your "void" statement you got earlier. Save the file and close out.

    Now open up the Setup.h file. Delete the:
    void SetupInnkeepers(ScriptMgr * mgr);
    void SetupGuardGossip(ScriptMgr * mgr);
    void SetupBattlemaster(ScriptMgr * mgr);

    Replace this with the void statement. Once again, the portions in red will always need to be there, and the portion in blue is what you change, or the void statement.
    void SetupGlobalNPC(ScriptMgr * mgr);
    Save and close out of Setup.h. Your more than halfway there!

    Step 3: Setting Up Your Project File
    This is an easy thing to do, just don't make it hard. Browse in your Ascent directory to: \trunk\src\scripts\projects. Now copy the "GossipScripts2008" file to your Desktop. Right click it, and go to "Open With". We are going to want to open it with Notepad or Wordpad. Now go to Edit, Replace (CTRL H). In the "Find What:" field, enter "GossipScripts". For the "Replace With:" field, we are going to enter what the name of our source file (.cpp) is, which is GlobalNPC. Hit "Replace All" and close out of that window. Now scroll down to the bottom until you see a line that has Name:"Main Recources" there. Make sure that the directories below it are set correctly in the format:
    srcScriptNameSetup.cpp or .h
    Now, look just below that to the Name:"Scripts" line. Delete these two sections of code:
    <File
    RelativePath="..srcGlobalNPCGossip_Innkeepers.cpp"
    >
    </File>
    <File
    RelativePath="..srcGlobalNPCGuardGossip.cpp"
    >
    </File>
    And make sure its in the correct format.
    srcScriptNameScriptName.cpp
    Make nessicary changes and then do: File, Save As, File Name: GlobalNPC.vcproj and "Save as type:" to all files. Click Save and close out.



    Step 4: Compiling the DLL
    Now, browse to "\trunk\src\scripts\src" and copy your GlobalNPC folder to this location. Next, browse to "\trunk\src\scripts\projects". Copy your GlobalNPC.vcproj here. Now double click GlobalNPC.vcproj and set the build to Release. If you really have compiled Ascent before, then you know what I'm talking about. Go to Build, Build Solution or hit F7. It may ask if you want to save a file, hit save, and the compiling should begin. You should either get a "1 succeeded" message or a "1 up-to-date" message.



    You have just successfully compiled a DLL! It should be in your \bin\Release\script_bin\ folder.This should take about 3-4 minutes each time after you get the hang of it, so it will become much easier. If you liked my guide or video please leave comments and/or suggestions!

    Hope you enjoyed my guide/video!

    -SectorSeven out! (No I'm not gay like Secrest...)

    Last edited by SectorSeven; 06-14-2008 at 08:37 PM.

    How to Compile a DLL with Video
  2. #2
    Power of Illuminati's Avatar Contributor
    Reputation
    179
    Join Date
    May 2008
    Posts
    1,410
    Thanks G/R
    6/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow...

    It's good that you updated Cursed guide as it was old. This gave me alot of "aha" experience now

    Very detailed... God, maybe to much? Also.. I didn't know about ctr + h... New and VERY useful for me, looking for that

    +Rep ofc S7!

  3. #3
    Cursed's Avatar Contributor
    Reputation
    270
    Join Date
    Jun 2007
    Posts
    1,380
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have my rep and a link in my thread

  4. #4
    SectorSeven's Avatar Banned
    Reputation
    444
    Join Date
    Oct 2007
    Posts
    1,948
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys!

  5. #5
    thegame240's Avatar Member
    Reputation
    3
    Join Date
    Mar 2008
    Posts
    204
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in the final step he shows me that, what i do bad, help pls !


    Code:
    1>------ Build started: Project: GlobalNPC, Configuration: Release Win32 ------
    1>Compiling...
    1>GlobalNPC.cpp
    1>..srcGlobalNPCGlobalNPC.cpp(1) : error C2059: syntax error : 'constant'
    1>..srcGlobalNPCGlobalNPC.cpp(3) : error C2059: syntax error : 'constant'
    1>..srcGlobalNPCGlobalNPC.cpp(5) : error C2059: syntax error : 'constant'
    1>..srcGlobalNPCGlobalNPC.cpp(18) : error C2059: syntax error : 'public'
    1>..srcGlobalNPCGlobalNPC.cpp(20) : error C2143: syntax error : missing ';' before '{'
    1>..srcGlobalNPCGlobalNPC.cpp(20) : error C2447: '{' : missing function header (old-style formal list?)
    1>..srcGlobalNPCGlobalNPC.cpp(39) : error C2059: syntax error : 'constant'
    1>..srcGlobalNPCGlobalNPC.cpp(40) : error C2653: 'GlobalNPC' : is not a class or namespace name
    1>..srcGlobalNPCGlobalNPC.cpp(42) : error C2143: syntax error : missing ';' before '{'
    1>..srcGlobalNPCGlobalNPC.cpp(42) : error C2447: '{' : missing function header (old-style formal list?)
    1>..srcGlobalNPCGlobalNPC.cpp(83) : error C2059: syntax error : 'constant'
    1>..srcGlobalNPCGlobalNPC.cpp(86) : error C2653: 'GlobalNPC' : is not a class or namespace name
    1>..srcGlobalNPCGlobalNPC.cpp(88) : error C2143: syntax error : missing ';' before '{'
    1>..srcGlobalNPCGlobalNPC.cpp(88) : error C2447: '{' : missing function header (old-style formal list?)
    1>..srcGlobalNPCGlobalNPC.cpp(1457) : error C2059: syntax error : 'constant'
    1>..srcGlobalNPCGlobalNPC.cpp(1460) : error C2653: 'GlobalNPC' : is not a class or namespace name
    1>..srcGlobalNPCGlobalNPC.cpp(1462) : error C2143: syntax error : missing ';' before '{'
    1>..srcGlobalNPCGlobalNPC.cpp(1462) : error C2447: '{' : missing function header (old-style formal list?)
    1>..srcGlobalNPCGlobalNPC.cpp(1467) : error C2059: syntax error : 'constant'
    1>..srcGlobalNPCGlobalNPC.cpp(1472) : error C2143: syntax error : missing ';' before '{'
    1>..srcGlobalNPCGlobalNPC.cpp(1472) : error C2447: '{' : missing function header (old-style formal list?)
    1>Setup.cpp
    1>Build log was saved at "file://h:ArcEmutrunksrcscriptsprojects2008_int_release_GlobalNPCBuildLog.htm"
    1>GlobalNPC - 21 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  6. #6
    Cursed's Avatar Contributor
    Reputation
    270
    Join Date
    Jun 2007
    Posts
    1,380
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That means your C++ Code for the WarpNPC is incorrect...

  7. #7
    SectorSeven's Avatar Banned
    Reputation
    444
    Join Date
    Oct 2007
    Posts
    1,948
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ^^ Yes. You probably forgot the last line >.>

  8. #8
    DemonElite119's Avatar Member
    Reputation
    2
    Join Date
    Mar 2008
    Posts
    24
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am getting a
    Code:
    1>------ Build started: Project: GlobalNPC, Configuration: Release Win32 ------
    1>Compiling...
    1>Gossip_Battlemaster.cpp
    1>c1xx : fatal error C1083: Cannot open source file: '..srcGlobalNPCGossip_Battlemaster.cpp': No such file or directory
    1>Setup.cpp
    1>c:Documents and SettingsJJDesktopNCDBAscentsrcascent-worldScriptSetup.h(25) : fatal error C1083: Cannot open include file: 'svn_revision.h': No such file or directory
    1>Build log was saved at "file://c:Documents and SettingsJJDesktopNCDBAscentsrcscriptsprojects2008_int_release_GlobalNPCBuildLog.htm"
    1>GlobalNPC - 2 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Error (Don't ask why Ascent is in the NCDB folder )

  9. #9
    SectorSeven's Avatar Banned
    Reputation
    444
    Join Date
    Oct 2007
    Posts
    1,948
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats because it needs to be in the right folder.

  10. #10
    riizu's Avatar Active Member
    Reputation
    16
    Join Date
    Oct 2007
    Posts
    263
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, im also getting the code error referencing a billion syntax errors. Any idea how to fix this? I know when I originally compiled this, I used the edited code released by Jedi I think it was.


    EDIT: found the fix. Make sure you copy the code from the text box at the bottom. Just copying the code off the main page creates the syntax errors.
    Last edited by riizu; 06-23-2008 at 01:31 AM.

  11. #11
    SectorSeven's Avatar Banned
    Reputation
    444
    Join Date
    Oct 2007
    Posts
    1,948
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well first of all, I would try the "official" GlobalNPC, as we know it compiles 100% perfect (Because I prooved in video) and we know you made a mistake

    Otherwise, you don't know if its the script or just you

  12. #12
    jb200206's Avatar Member
    Reputation
    2
    Join Date
    Jun 2008
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Sector, seems that all your posts seem to come in handy for me and my new private server. I know this is off topic for this page but your Lua guide was amazing, already know a lil bit about it but you opened the door for meh. Thanks again man.

  13. #13
    SectorSeven's Avatar Banned
    Reputation
    444
    Join Date
    Oct 2007
    Posts
    1,948
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha no problemo

  14. #14
    **Sweeny**'s Avatar Member
    Reputation
    33
    Join Date
    Dec 2007
    Posts
    282
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do I put here
    <File
    RelativePath="..srcMorphNPCGossip_Battlemaster.cpp"
    >
    </File>

    (Bit in red)

  15. #15
    Immüñé's Avatar Member
    Reputation
    9
    Join Date
    Apr 2008
    Posts
    62
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice Guide Sector Helped a Bunch

Page 1 of 6 12345 ... LastLast

Similar Threads

  1. How to Compile a DLL
    By Vindicated in forum WoW EMU Guides & Tutorials
    Replies: 16
    Last Post: 03-08-2009, 02:51 PM
  2. How to increase your fps[with video]!
    By feliz in forum World of Warcraft Guides
    Replies: 31
    Last Post: 07-12-2008, 10:30 AM
  3. How to Compile Ascent 2.3.2 with NCDB!!
    By MooseBoi in forum WoW EMU Guides & Tutorials
    Replies: 26
    Last Post: 03-23-2008, 07:32 PM
  4. How To Compile Ascent [Video]
    By Xiro187 in forum WoW EMU Guides & Tutorials
    Replies: 7
    Last Post: 01-18-2008, 03:29 PM
  5. Guide: How to Compile Ascent yourself! [With photos]
    By Skaren in forum WoW EMU Guides & Tutorials
    Replies: 33
    Last Post: 01-08-2008, 08:18 PM
All times are GMT -5. The time now is 08:58 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search