How to Compile a DLL menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to Compile a DLL with Video

    How to Compile a DLL
    By Vindicated

    Hello there. This is a guide on how to compile a DLL. Have you have seen a C++ script that you don't know how to add to your server? Well this is your solution. After this guide you will be able to compile C++ scripts for your server. This guide is mostly text-based, so good English skills are probably nice. I would recommend using the video in addition to this text guide. It may clear up some questions you have on some things... and you get to hear my sexy voice!

    You will see many shorter and simpiler guides on compiling a DLL. There are many methods to compile a DLL, but I will show you the "true way" or the project way. Using this method will allow your C++ script to have its own DLL (like TeleportNPC.dll), without having to put it in with other scripts. You must also know how to compile ArcEmu prior to starting this guide. In this guide I will use my custom TeleportNPC as a guideline, so just modify it for the script you're using.


    [ame="http://www.youtube.com/watch?v=ZKggcSlwZOo"]YouTube - How to Compile a DLL (ArcEmu)[/ame]
    Suggestion: Watch the video on Youtube. Don't try and watch it here (Better quality + bigger)

    Download Prerisques:
    Microsoft Visual C++:
    Visual C++ 2008 Express Edition
    Sample Project: http://www.filefactory.com/file/af31gch/n/Sample_Project_rar

    I. Getting the Source
    The first step in compiling your custom DLL is to find the file that you wish to compile. There are many scripts out there on MMOwned to use, but we will be compiling my custom TeleportNPC (Please keep in mind it wasn't made for its features :P). This is included in my sample project download at the top.

    Normally, however, you are not presented with a download to the source code, you just get the script in code tags. When this occurs, copy/paste the script into Notepad and go File > Save As. Name the file "ScriptName.cpp" and for the "Save as type:" field select "All Files". You have just saved the cpp file. Move it into the project folder and follow the rest of my guide.

    II. Setting up Setup Files
    Now that you have the source code for the script, it's time to setup our source files, or "Setup.cpp" and "Setup.h". First, lets open up the source of our main script (TeleportNPC.cpp in this case) and look for the line:
    Code:
    class SCRIPT_DECL TeleportNPC : public GossipScript

    Lets remember the name after SCRIPT_DECL, we will need it later (this varies for every script).

    Second, lets open up Setup.cpp. Go to the line that says:
    Code:
    extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
    {
        SetupScriptName(mgr);
    }

    Edit the part after the word setup to what you found after SCRIPT_DECL in the main file. In this case it is "SetupTeleportNPC(mgr);". Save and exit out.

    Now open up the file "Setup.h". Find the line:
    Code:
    void SetupScriptName(ScriptMgr * mgr);

    Edit the part after the word setup to what you found after SCRIPT_DECL in the main file. In this case it is "void SetupTeleportNPC(ScriptMgr * mgr);". Save and exit out.

    You have just successfully edited your setup files.

    III. Creating the Project File
    We are almost there! Now right click the file "ScriptName" with a picture that looks like a program with two plus signs on it and choose to open it with Notepad. Use the keyboard shortcut CTRL H. In the "Find what" field enter in "ScriptName" (Do not fill it in with your script name). In the "Replace with" field enter in your script name, in this case that is "TeleportNPC" (without quotes). Save the file and exit out.

    You are now ready to compile your DLL.

    IV. Compiling the DLL
    Move the project file out of the "SampleProject" folder. Rename the folder your project name, in this case will will rename it "TeleportNPC". Now, move the TeleportNPC folder to "trunk\src\scripts\src" and move the project file to "trunk\src\scripts\projects" Double click on the TeleportNPC project.

    Click the plus symbol right next to your project name and right click Main Resources then click Add > Exsisting Item. Select Setup.cpp & Setup.h. Now right click Scripts and click Add > Exsisting Item and select your main source file (TeleportNPC.cpp).

    Double click your project file and at the top you should see some dropdown menus, one of them should be labled "Debug". Click the down arrow and select "Release". Now use the keyboard shortcut F7. You script is compiled (Go to arcemu\trunk\bin\Release\script_bin).

    You will only have to repeat step 4 (the second paragraph) when compiling the DLL after this time. You will need to recompile your DLL everytime you make a change to it. You will also need to recompile it every time you update your ArcEmu revision.

    If you have any questions, problems, or requests just reply to this post.

    Thanks,
    Vindicated

    Last edited by Vindicated; 03-06-2009 at 05:25 PM.


    How to Compile a DLL
  2. #2
    D1zl3's Avatar Member
    Reputation
    4
    Join Date
    Jan 2009
    Posts
    80
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    good guide, I dont understand c++ but Im sure its helpful haha

  3. #3
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's the beauty of this guide, you don't have to know it, you just have to have the source code of the script

    Video added
    Last edited by Vindicated; 03-03-2009 at 11:06 PM.


  4. #4
    Mirror's Avatar Contributor
    Reputation
    259
    Join Date
    Nov 2006
    Posts
    2,602
    Thanks G/R
    0/0
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Vindicated, cool vid too :P
    THIS SIGNATURE IS IN VIALOATION OF SITE RULES, PLEASE FIX ME!
    -Fault

  5. #5
    3xploit's Avatar Member
    Reputation
    9
    Join Date
    Feb 2009
    Posts
    59
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice job! +Rep

    May the Force be with you

  6. #6
    Illegalpie's Avatar Member
    Reputation
    11
    Join Date
    Jul 2008
    Posts
    240
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i dun get it tho I Downloaded Keazin's and i dont have a Setup.h or .cpp... Heelp please
    Offering Powerleveling 1$perlevel Aim me Zackattack7230

  7. #7
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't use a compile, you have to compile your OWN ArcEmu. Guide here:
    http://www.mmowned.com/forums/emulat...le-arcemu.html


  8. #8
    keeevin92's Avatar Member
    Reputation
    8
    Join Date
    Jul 2007
    Posts
    203
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So you can't change things a dll file in a repack?

  9. #9
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, you cannot


  10. #10
    jingxuan's Avatar Member
    Reputation
    1
    Join Date
    Feb 2009
    Posts
    28
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have seen your video guide on "How to Compile a DLL" and I've already complile a dll successfully. Thank you very much. Now I wonder how can I create a teleportNPC in the game?

    Thanks!

  11. #11
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to create an NPC with the Id as the same one listed in your script and in creature_proto column flags change it to "1"


  12. #12
    jingxuan's Avatar Member
    Reputation
    1
    Join Date
    Feb 2009
    Posts
    28
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is very helpful. I've already followed your instruction and created a teleportNPC. Now I need your help with creating a teleportStone in my package. Pls. tell me. Thanks again.

  13. #13
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You follow the EXACT same process. But remember that step where we got what was after SCRIPT_DECL? Do the same thing here and replace ScriptName in the Setup.h & Setup.cpp files with it.


  14. #14
    keeevin92's Avatar Member
    Reputation
    8
    Join Date
    Jul 2007
    Posts
    203
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can I open a dll that is already made. Like I want to change a dll file. It makes so when a player kills another player they get a PvP Card. Any change I can open this?

  15. #15
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No you cannot edit already compiled DLLs. Although you could try a disassembler to try and get the just of how the script was made (just google it).


Page 1 of 2 12 LastLast

Similar Threads

  1. How to Compile a DLL with Video
    By SectorSeven in forum WoW EMU Guides & Tutorials
    Replies: 83
    Last Post: 10-17-2008, 03:16 PM
  2. [Guide] How to compile your own DLL
    By Cursed in forum WoW EMU Guides & Tutorials
    Replies: 58
    Last Post: 06-19-2008, 09:38 AM
  3. How to compile ascent
    By Viter in forum World of Warcraft Emulator Servers
    Replies: 42
    Last Post: 04-19-2008, 09:59 AM
  4. 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
  5. [RELEASE] How to compile your own funserver and Patch the source code
    By pepsi1x1 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 12-26-2007, 06:24 PM
All times are GMT -5. The time now is 03:00 AM. 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