Bak Posted February 22, 2007 Report Posted February 22, 2007 Alright, in this topic I will attempt to help you make a module. Making a module is easy pie once you know what to do, so let's get to it. Windows with MSVC: First step: make a new VS.net C++ Project. 1. File -> New Projectw2. Win32 Console Project3. Give your project a name ("TestModule" in the picture)4. Press Okhttp://img.photobucket.com/albums/v622/bak2007/disc_module1.png 5. Click on application settings on the left 6. Click DLL from the list of radio buttons7. Press the Empty Project checkbox8. Press Finishhttp://img.photobucket.com/albums/v622/bak2007/disc_module2.png 9. File -> Add New Item10. Select C++ Source File (.cpp)11. Name your source file ("testmodule.cpp" in the picture)12. Press Openhttp://img.photobucket.com/albums/v622/bak2007/disc_module3.png 13. Paste the following code into your source file// Sample Discretion Module Source File #include "Module.h" void* getClassInstance(void* _mm, LoadMode lm) { if (lm == LOADMODE_Init) printf("Test Module Initialized\n"); return 0; } extern "C" { EXPORT void* getInstance(void* mm, LoadMode lm) { return getClassInstance(mm,lm); } } 14. Right Click your project in the Solution Explorer and go to Properties (You can also access this through the Project Menu, Project -> Properties)http://img.photobucket.com/albums/v622/bak2007/disc_module4.png 15. In the properties window, from the drop down menu select "All Configurations"16. Select C++, General from the tree view on the left17. Type the directory to the Modules directory (the one with Module.h in it, not the one with only .dlls!) that comes with the full version of Discretion in the Additional Include Directory property ("E:/client/modules" in the picture)18. Press Okhttp://img.photobucket.com/albums/v622/bak2007/disc_module5.png 19. Go to Buld -> Build ("TestModule" in the pictue)http://img.photobucket.com/albums/v622/bak2007/disc_module6.png If all goes well, you code should compile and a .dll should be produced that is a Discretion module! Now let's put the module into Discretion to see it at work. 20. Copy the produced .dll into your Discretion executable's Module folder (the one with the .dlls in it, not the one with Module.h in it).http://img.photobucket.com/albums/v622/bak2007/disc_module7.png 21. Edit conf/MAIN.CONF with a program such as Notepad22. Add the name of your dll to the Modules::Names setting (it's a comma seperated list of module names, order doesn't matter)23. Save the filehttp://img.photobucket.com/albums/v622/bak2007/disc_module8.png 24. Run Discretion, Select Practice Offline25. Observe your modules initialization in the console windowhttp://img.photobucket.com/albums/v622/bak2007/disc_module9.png Now you might say, rightfully so, that this module doesn't do anything. The way to do real things in Discretion is by using other modules. Want to react to user key presses? Use the KeyControls module. Want to display some images? Use the Graphics module. I'll gladly write additional tutorials for how to use each of these as needed. Tell me what you want to do and I'll write a tutorial with how to use the existing modules to accomplish what you want to do.Linux:Todo... let me know if you're interested in linux dev post here and I'll make a guide, although the makefile provides some hints. Quote
Witchie NL Posted February 22, 2007 Report Posted February 22, 2007 ill try to make some small basic things.Im using MSVC++ 6.0 which is a lil diffrent but thats np. Quote
L.C. Posted February 22, 2007 Report Posted February 22, 2007 Hey Bak, do you plan on bringing back some of the old VIE scripts? Quote
tcsoccerman Posted February 22, 2007 Report Posted February 22, 2007 Url to msvc plz? i use devc++. which is better? Quote
Witchie NL Posted February 22, 2007 Report Posted February 22, 2007 i think there isnt much of a diffrence in the quality. But i prefer MSVC++ coz its more organised.(MSVC++ isnt free) Quote
Bak Posted February 22, 2007 Author Report Posted February 22, 2007 Witchie: here's an addition tutorial for simple functionality: http://wiki.minegoboom.com/index.php/Discr...splaying_Images Quote
Witchie NL Posted February 23, 2007 Report Posted February 23, 2007 k ill read that. but im not realy skilled with C++ (Only coded in merv so far) so i wonder if i menage to make something usefull Quote
L.C. Posted February 23, 2007 Report Posted February 23, 2007 how did they work?The one that keeps popping in my mind is where the wormhole's warp feature would be completely turned off and you can shoot clearly through the wormhole. Bombs and players would eventually end up confined in the center of the wormhole, thus stuck and would have a few options:1) Be killed by enemy bombs, bullets, etc - by people flying around the wormhole2) Insert (Warp)3) Attach to a teammate4) Change ship Other than that, if you can't attach to a teammate, warp, or change ship (including spectator mode), you would be confined to your death pit. It'd be nice if I could somehow integrate some of the old VIE scripts into my zone. Though the zone would have to require the Discretion client to prevent confusion and "cheating." Right now I have a headache, a dozy brain, and somehow I feel really strange although I slept about 9 hours; at the moment I can't think of any other ... oh. There was another one where only Sysops could use Ship 8. Back then Ship 8 was reserved for the gods of the zone, and was known as a super ship compared to the ships 1 through 7. There might be more scripts than this, but I'm unable to remember because of my head problem. Quote
L.C. Posted February 23, 2007 Report Posted February 23, 2007 I have been told by many of the VIE vets that "back in the day" (atleast of Jackpot Zone) VIE had some special scripts, exactly as the ones I described above. I spent a few days researching "VIE Scripts" and asking a bunch of people around. Quote
Samapico Posted February 23, 2007 Report Posted February 23, 2007 the wormhole thing can be done by laying fly-under tiles all over the wormhole (see topic) Quote
Bak Posted February 23, 2007 Author Report Posted February 23, 2007 You can do it in Discretion by not including a position change in a wormhole's StatusModification. Quote
Yoink Posted March 5, 2007 Report Posted March 5, 2007 MS Visual C++ edition is free, and it's just as capable. Google it if you want it. (And yes, it is much better than Dev-C++) Quote
»doc flabby Posted March 9, 2007 Report Posted March 9, 2007 MS Visual C++ edition is free, and it's just as capable. Google it if you want it. (And yes, it is much better than Dev-C++)its not only the re!@#$%^&*ed "express" edition is, which is impossible to get anything done it. Quote
Witchie NL Posted March 9, 2007 Report Posted March 9, 2007 Just buy it or download version 6/7.0...This tutorial is for 7 i thought.. i still need to download that 1. I got 6 but dont feel like buying 7 :S Quote
Witchie NL Posted March 11, 2007 Report Posted March 11, 2007 Bak?Made a project and compiled succesfully.Do you have a simple example code of how to put an image on the screen and to make text apear ingame? Quote
Bak Posted March 13, 2007 Author Report Posted March 13, 2007 great! did you run through the image example?( http://wiki.minegoboom.com/index.php/Discr...splaying_Images ). The Chat stuff is in the Chat module (look in chat.h). If it still confuses you post and I'll make a tutorial for Chat... if not, you make one If you mean the kill-like messages, those are in the Flash Module, if you just want text anywere, the Text module can do that. let me know Quote
Witchie NL Posted March 13, 2007 Report Posted March 13, 2007 K ill !@#$%^&* around with it a bit.Thank you. Quote
L.C. Posted March 13, 2007 Report Posted March 13, 2007 the wormhole thing can be done by laying fly-under tiles all over the wormholeThat hardly works. Continuum is strange and that doesn't work for me, no matter what tiles I use, it always swings a player around a center. Guaranteed. Your example maps somehow manages to act differently. And by the way, that's not an efficient and very professional method, because the player jitters uncontrollably in the center of the wormhole anyway and the top left tile fails to function with the rest of the wormhole region. I already explained this to you a while ago. It does not fully work as you think it does. I don't know why it does this. I experimented with this pretty heavily at all angles using my "ServerKit-Full.exe" with no modified files, and I used Jackpot SVS to experiment and found exactly the same results. Please recreate the VIE scripts. Quote
Bak Posted March 13, 2007 Author Report Posted March 13, 2007 what format did they come in (is there a tutorial somewhere for them)? Quote
L.C. Posted March 13, 2007 Report Posted March 13, 2007 I'm not sure. I don't think VIE ever shared their scripts, and possibly eventually disabled this feature from Subgame or something. Who knows. But it is known that VIE called them "scripts," and they were something they could program. Quote
»CypherJF Posted May 12, 2007 Report Posted May 12, 2007 are you talking about triggered events as these VIE "scripts"? Quote
CRe Posted May 16, 2007 Report Posted May 16, 2007 For the MSVC++ express edition users, dlls aren't enabled in it so you have to edit a few files. Go here for instructions:http://msdn.microsoft.com/vstudio/express/...dk/default.aspx Quote
Russky Posted June 20, 2007 Report Posted June 20, 2007 (edited) What about Python, or you guys going to do everything in C?I can not tick DLL I am really eager to learn help? I just read the above post... God alright I will try to fix. Edited June 20, 2007 by Russky Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.