(Old) Game Maker Tutorial - Using/Making DLLs

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ต.ค. 2024
  • New version of this video here:
    • Writing DLLs in GameMaker
    DLLs and buffers and pointers:
    • DLLs, Buffers, and Poi...
    DLLs, code extensions that can do some very useful things that you couldn't otherwise with Game Maker! If you're ever trying to do something that GM doesn't natively support, search the Internet to see if anyone else has made an extension to do it . . . or do it yourself!
    Download this project file:
    www.mediafire.c...
    It's nothing fancy, but here's the C++ file I wrote in this video (if you use it, remember to have your compiler compile a DLL instead of an executable!):
    pastebin.com/e...
    Worth noting that simple C++ bits like this SHOULD work in past versions of Game Maker, but more complicated projects may or may not run into compatibility issues.
    - - - -
    That promised social media link spam.
    / dragonitespam
    Anyone wanna donate?
    tinyurl.com/Dr...
    I do live streams sometimes!
    / dimenticare
    Rate, comment, subscribe, watch more, enjoy!

ความคิดเห็น • 34

  • @DragoniteSpam
    @DragoniteSpam  ปีที่แล้ว

    New version of this video here:
    th-cam.com/video/06cDPkMJbpA/w-d-xo.html
    DLLs and buffers and pointers:
    th-cam.com/video/AzbhaAvTvfQ/w-d-xo.html

  • @fernfaba
    @fernfaba 3 ปีที่แล้ว

    THis legend, still helping those in need in 2021

  • @nujumkey
    @nujumkey 8 ปีที่แล้ว +5

    Never really understood the file things, pretty cool

  • @Warrenaterz
    @Warrenaterz 7 ปีที่แล้ว +1

    You my friend are a legend.

  • @NaudVanDalen
    @NaudVanDalen 2 ปีที่แล้ว

    Either my GameMaker version is broken or my C++ compiler is broken because it doesn't work. It just returns 0 when using an extension and gives the error "Error defining an external function." when trying to use the dll directly. Another extension I used is also broken (returns 0).
    Edit: My version GameMaker Studio 2 is broken because your project file works in GameMaker Studio 1.4 (after setting text color to black), but stops working after I imported it in GMS 2.

  • @NaudVanDalen
    @NaudVanDalen 2 ปีที่แล้ว

    You have to make 64 bit DLLs to get them to work in GameMaker Studio 2. The DLLs will be 91 kb minimum though. A DLL from an extension I found was only 10 kb, which was already 3 times smaller than the 32 bit DLL I made with the code in this video.

    • @DragoniteSpam
      @DragoniteSpam  2 ปีที่แล้ว

      It's possible to shrink the DLL further by messing with some settings:
      yal.cc/cpp-a-very-tiny-dll/
      although depending on what you're writing it might not be very stable, and debatably worth it.

  • @edmanbosch7443
    @edmanbosch7443 7 ปีที่แล้ว

    Why didn't you use the Extensions resource? It allows you to do the same thing, has a nice UI, and is very easy to transfer across projects. Plus they are also used for integrating Third-Party APIs and SDKs such as the ones for Google Play and Facebook by YoYoGames themselves.

    • @DragoniteSpam
      @DragoniteSpam  7 ปีที่แล้ว

      It's been forever since I used the Extension editor, I just prefer to link the DLLs though code because it's not THAT much of a hassle. You can use it if you want though, afaik there's nothing wrong with it.

    • @edmanbosch7443
      @edmanbosch7443 7 ปีที่แล้ว

      I just think you should've mentioned it, especially because of it's benefits.

  • @joaquimjesus6134
    @joaquimjesus6134 6 ปีที่แล้ว

    how can i do when the function don't have arguments?
    GMEXPORT HDC GetHDC()
    {
    return GetWindowDC(GetActiveWindow()));
    }
    //on Game Maker:
    GetWindowDC = external_define("test.dll","GetHDC",dll_cdecl);
    error: "Wrong number of arguments to external_define()
    at gml_Object_object0_CreateEvent_1 (line 2) - GetWindowDC = external_define("test.dll","GetHDC",dll_cdecl);"

    • @joaquimjesus6134
      @joaquimjesus6134 6 ปีที่แล้ว

      finally i fixed:
      GetWindowDC = external_define("test.dll","GetHDC",dll_cdecl,ty_real,0);
      thank you for all

  • @larryteslaspacexboringlawr739
    @larryteslaspacexboringlawr739 8 ปีที่แล้ว

    thank you for gamemaker tutorial, maybe ini files for next tutorial?

    • @DragoniteSpam
      @DragoniteSpam  8 ปีที่แล้ว

      +Larry “lazy2late” Lawrence It's a bit old, but here: th-cam.com/video/S60bI8947yg/w-d-xo.html

  • @AhmedAtem
    @AhmedAtem 7 ปีที่แล้ว

    Hello
    I want to ask for something?
    Can I do a dll to run an Android phone camera?
    If possible, can you explain to me how to do it please?

    • @DragoniteSpam
      @DragoniteSpam  7 ปีที่แล้ว

      DLLs don't work on non-Windows platforms since they're made of compiled machine code, so you'll have to find another way to do it.

  • @joaquimjesus6134
    @joaquimjesus6134 6 ปีที่แล้ว

    it's great too, i belive, we can change the size, type, color and more off line too(before draw a shape). what we need to catch it's the HDC ;)
    do i need the main.h file?

  • @shirtyscarab554
    @shirtyscarab554 8 ปีที่แล้ว

    Does dev-c++ do the same thing?

    • @DragoniteSpam
      @DragoniteSpam  8 ปีที่แล้ว

      As long as it can compile a DLL, it should. You might have to tweak the settings a bit, though.

  • @MrAtanacius
    @MrAtanacius 8 ปีที่แล้ว

    Hello !
    Thanks for your video!
    With Code::Blocks (gcc MingW compiler):
    I suceeded to compile the .DLL with ONLY your code sample, and loaded through GameMaker without any issue..
    With Visual Studio 2015 Community (Visual Studio 14 compiler I assume..):
    I suceeded to compile the .DLL with ONLY your code sample (removed all others files that was added by Visual Studio like Stdafx.h etc..), and when I want load through GameMaker my compiled DLL.. It still throw a "Error defining an external function." when game is in the process of compilation from GameMaker: Studio.
    Anyone know how/why and what to do for be able to compile same DLL from Visual Studio 2015 for being usable in GameMaker: Studio ?
    I have PRO version.
    Thanks.

    • @MrAtanacius
      @MrAtanacius 8 ปีที่แล้ว

      I answer myself to my question...
      It is relative to the BUILD architecture.
      According to that post on reddit: www.reddit.com/r/gamemaker/comments/2hk3n8/anyway_to_build_to_x64/
      I learned that GameMaker support ONLY the 32-bit support generated .EXE. (I didn't take a look in Process Manager before now..)
      So.. as in my setup actually of Visual Studio 2015, it's in x64 (64-bit)..
      Each time I compiled the .dll it produced a .dll for x64 architecture.
      As my computer OS/Processor is 64-bit able, I didn't take a look to that stuff that GameMaker can't handle.
      So.. Answer is simply:
      GameMaker don't support x64-bit architecture (meaning, third-party one, dll).
      It will run fine on 32-bit or 64-bit, but it run only in a 32-bit locked architecture when even we have a 64-bit computer capable.
      So, in Visual Studio 2015, for people having the same "issue" (stupid one due to misunderstanding of the GameMaker architecture) and can't use .dll in GameMaker when build in 64-bit release..
      Try to select a build way for producing compilation in a 32-bit ONLY release.
      Have fun..
      Have bug..
      But Have a nice day.

    • @DragoniteSpam
      @DragoniteSpam  8 ปีที่แล้ว

      Unfortunately (or very fortunately, according to some) I've never used Visual Studio, so I can't really answer many questions about it. Most of the problems in the past that I've had with compiling DLLs for Game Maker has come down to the settings used for it, which apparently was the case here, too.
      Glad you were able to solve it!

    • @amazingsparckman
      @amazingsparckman 8 ปีที่แล้ว

      I use fusion and game maker, fusion recently upgraded 2.5 I haven't noticed but releasing on 64 and 32 would force devs to save two version a 32 and a 64.. i guess it wouldn't be a big deal.

  • @ИнноКентий-ф3х
    @ИнноКентий-ф3х 5 ปีที่แล้ว

    Thank you)))

  • @LightRealms
    @LightRealms 5 ปีที่แล้ว

    Isn't anyone else annoyed at how the thumbnail says "Making/Using" while the title says "Using/Making"? My OCD is killing me from the inside out!