Page 3 of 47

Re: LunaDLL - SMBX Extension Module

Posted: Sat Feb 22, 2014 1:16 pm
by Valtteri
The topic is getting derailed. Take the discussion about the Brazilian tutorial to PM.

Re: LunaDLL - SMBX Extension Module

Posted: Sat Feb 22, 2014 7:42 pm
by leif_erikson
Natsu wrote:Wait a second, if that's the case it could be possible to implement C++ programming into the creation of a new version of SMBX without even the Source Code. Even if there's no source code, it's still possible to modify it just a little with some of these.
you can but it's gonna be so much work you might as well program a new mario engine from scratch, and not deal with SMBX limitations.

the smbx play area is just a normal windows device context / bitmap, so anything you can do to one of those you can do to smbx to display a sprite.

example: https://www.youtube.com/watch?v=L68BbB07SzE

This is possible since I found the handle for the main smbx window at some point. Here's some code to blit an image onto the smbx game window / bitmap

Code: Select all

HBITMAP hbmp = (HBITMAP) LoadImage(NULL, L"test.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); // load my sprite, an image in the same folder called test.bmp
HDC hMemDC = CreateCompatibleDC((HDC)GM_SCRN_HDC); // create a device context to match my sprite to the smbx window (GM_SCRN_HDC)
SelectObject(hMemDC, hbmp); // put my image into the device context

BitBlt((HDC)GM_SCRN_HDC, x, y, 69, 44, hMemDC, 0, 0, SRCCOPY); // copy the device context onto the smbx window at coordinates 69,44
	
DeleteDC(hMemDC); // deallocate all that stuff now
DeleteObject(hbmp);
GM_SCRN_HDC is the address I found inside smbx which contains a handle to the smbx window. With that you can display anything you want in the game. That codes works in lunadll if you download the source, and it is run during the HUD update function. If someone knows enough C they could make custom sprites with that, but it's probably too much work, which is why I made the scripting framework thing which can do other stuff more easily.

Re: LunaDLL - SMBX Extension Module

Posted: Sat Feb 22, 2014 7:54 pm
by FanofSMBX
How do "boss hits" work, on NPCs such as Larry who have different means of damage (I.e. 12 fireballs or 3 stomps)?

Re: LunaDLL - SMBX Extension Module

Posted: Sat Feb 22, 2014 7:57 pm
by leif_erikson
He still has an internal hit counter, but I don't know what it is off the top of my head. Probably when you jump on him, he takes more damage than he would from fireballs. I bet if you set his hits to 11, he'll die in 1 hit from anything.

Re: LunaDLL - SMBX Extension Module

Posted: Sat Feb 22, 2014 11:33 pm
by icez
So if I am reading this correctly I could give a mother brain 30 hits or a wart like 15 hits if I wanted to with this scrpit

Re: LunaDLL - SMBX Extension Module

Posted: Sun Feb 23, 2014 2:08 pm
by leif_erikson
unless redigit coded a check to see if enemy health was too high (unlikely), then that should work

Re: LunaDLL - SMBX Extension Module

Posted: Sun Feb 23, 2014 2:13 pm
by FanofSMBX
You know how the SM Glass Cube has a new sprite for each hit? How would that be affected if I gave the cube more or less hits?

Re: LunaDLL - SMBX Extension Module

Posted: Sun Feb 23, 2014 3:38 pm
by leif_erikson
Good question. Is that technically an NPC or a block? If it's an NPC, then... that's a really good question. There's a chance nothing would happen though. If it's a block then well, you can't set block hits and blocks don't have that memory in their structure so idk

Re: LunaDLL - SMBX Extension Module

Posted: Sun Feb 23, 2014 3:59 pm
by FanofSMBX
It's NPC-208 I believe.

Re: LunaDLL - SMBX Extension Module

Posted: Sat Mar 01, 2014 10:25 pm
by leif_erikson
I just now finished making lunadll compatible with the base smbx program. Basically I downloaded the latest smbx 1.3.0.1 and added the links into it so it calls lunadll. In other words, no one has to use a2mbxt anymore, which is good since not a lot of people even know about a2mbxt.

http://www.gamearchaeology.com/SMBX1301+Luna.zip

Re: LunaDLL - SMBX Extension Module

Posted: Sun Mar 02, 2014 2:03 pm
by DarkShadeX
Welp...I made a new txt file called lunadll and added a code in there (from the tutorial) and then i added the txt into my levels folder.
But as soon as i start the level,nothing changes at all...

EDIT:
NVM that above ^^
Is there anyway to remove the Demo text on the upper left screen?

Re: LunaDLL - SMBX Extension Module

Posted: Sun Mar 02, 2014 2:31 pm
by leif_erikson
Sorry I forgot to get rid of that

One last download: http://www.gamearchaeology.com/SMBX1301+Luna.zip

Re: LunaDLL - SMBX Extension Module

Posted: Sun Mar 02, 2014 2:35 pm
by DarkShadeX
Awesome,this will be pretty useful in my episode!
Btw,is there any way to change the timer text so it says: Time: insteand of Timer?

Re: LunaDLL - SMBX Extension Module

Posted: Sun Mar 02, 2014 9:41 pm
by leif_erikson
Not unless you compile a custom version of the dll

Re: LunaDLL - SMBX Extension Module

Posted: Mon Mar 03, 2014 8:34 am
by Chill Pingu
leif_erikson wrote:I just now finished making lunadll compatible with the base smbx program. Basically I downloaded the latest smbx 1.3.0.1 and added the links into it so it calls lunadll. In other words, no one has to use a2mbxt anymore, which is good since not a lot of people even know about a2mbxt.

http://www.gamearchaeology.com/SMBX1301+Luna.zip
thank godness you made it. also this should be made official.

Re: LunaDLL - SMBX Extension Module

Posted: Mon Mar 03, 2014 10:45 am
by icez
Darkchaox100 wrote:Welp...I made a new txt file called lunadll and added a code in there (from the tutorial) and then i added the txt into my levels folder.
But as soon as i start the level,nothing changes at all...
How did you get the timer working I Cant get it working at all

Re: LunaDLL - SMBX Extension Module

Posted: Tue Mar 04, 2014 5:02 am
by Emral
icez wrote:
Darkchaox100 wrote:Welp...I made a new txt file called lunadll and added a code in there (from the tutorial) and then i added the txt into my levels folder.
But as soon as i start the level,nothing changes at all...
How did you get the timer working I Cant get it working at all
You need to use one of the exe files compatible with lunadll.

I love how everyone's amazed by darkchao because he read the tutorial once, maybe twice and now explains everything, not that it was rather easy to understand to begin with.

Re: LunaDLL - SMBX Extension Module

Posted: Tue Mar 04, 2014 7:51 am
by DarkShadeX
Welp,i managed to change Lunadll...it now says TIME insteand of TIMER when using the Timer function (like if you want to add level time)

Re: LunaDLL - SMBX Extension Module

Posted: Tue Mar 04, 2014 8:46 am
by Magician
Emral wrote:I love how everyone's amazed by darkchao because he read the tutorial once, maybe twice and now explains everything, not that it was rather easy to understand to begin with.
You really shouldn't find it altogether surprising that this community might be largely composed of visual learners when SMBX itself is designed to be much easier for visual learners than your typical level editing software.

It's easy for some to understand and intimidating for others.

Re: LunaDLL - SMBX Extension Module

Posted: Tue Mar 04, 2014 9:26 am
by RudeGuy
This website has used up all it's bandwidth. Please try again later.
Why I get this message when I try to go here?:
http://www.gamearchaeology.com/SMBX1301+Luna.zip