(shouting)

LunaDLL/LunaLUA help thread

The second SMBX collab!
LukasSMBX
Posts: 0
Joined: 10 years ago

Re: LunaDLL help thread

Post by LukasSMBX »

do i have to replace the lunadll.Exe?
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

replace LunaDll.dll
DON'T PM me. Ask your question in the help thread so everyone can be answered.
LukasSMBX
Posts: 0
Joined: 10 years ago

Re: LunaDLL help thread

Post by LukasSMBX »

ok it works but i now want to have 50 seconds before the drown countdown starts and the drown music don't play. how to fix that?
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

To change the time change this 600 here
IfVar,0,1,600,1002,1,MYDROWNCOUNTER

600 = 10 second
3000 = 50 seconds

That's a long time though. Try 1500 or 1200.

For the drown music you have to add your own music into the folder and name it drown.wav.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Kil wrote:
LukasSMBX wrote:Can you please give me the codes?

Code: Select all

#-1
// reset drown counter
SetVar,0,0,0,0,1,MyDrownCounter


#0
// -> #1000 if in water
OnPlayerMem,0x34,2,0,1000,0,w

// -> #1001 if not in water
OnPlayerMem,0x34,0,0,1001,0,w


#1000
// underwater so add to counter
SetVar,0,1,1,0,1,MyDrownCounter

// -> #1002 if counter gets too high
IfVar,0,1,600,1002,1,MyDrownCounter


#1001
// reset counter when out of water
SetVar,0,0,0,0,1,MyDrownCounter


#1002
// Final kill event when counter is too high
Kill,0,0,0,0,1,0

// Play drown sound
SFX,0,0,0,0,1,drown.wav

// also reset counter
SetVar,0,0,0,0,1,MyDrownCounter
you'll have to put your own drown.wav file in the level folder
TiKi wrote:Is there a way to make the autoscroll move in multiple directions (like YI) without manually setting it to move after like 1500 frames? If I have to wait till v8 that's fine by me.
How would that work?
Oh you're right. I suggest in V8 having a toggle able "frame counter" like the timer but it counts frames.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

Really though how do you want to autoscroll in a way that isn't possible already? You should be able to autoscroll in any which way. In YI it uses a similar system where the level bounds follow hardcoded speeds the camera moves along.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

I already said that I agreed that there wasnt an easier way.
If you're wondering why I ask all the questions, SMBX can only make one direction of autoscroll, in section 1, at the start.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

Actually I think I'm gonna add a command that handles scrolling to a target position you give it, based on a time length you give. It'll be more precise than manually pushing the screen boundaries but less powerful.

so like AutoscrollTo,x,y,0,0,60,0 will scroll the screen over to x,y in 1 second (very fast), or if you set 6000 frames it would take 100 seconds (very slow scroll) to scroll there
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
docopoper
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non pharetra enim, nec maximus odio.
Posts: 78
Joined: 12 years ago
First name: Shane Farrell
Pronouns: they/he
Location: Ireland

Re: LunaDLL help thread

Post by docopoper »

Can you see if you can find some way to catch the death function and cause something else to happen instead? I have a great idea for a really long and epic autoscroll level that the player shouldn't be able to die during and I'd like things like when they get crushed by the level boundaries they instead just reappear at some currently on-screen checkpoint so that they can continue without having to restart.

I could check to see if they're about to be crushed manually and teleport them then - but I imagine there will be plenty of glitch deaths associated with that and I really don't want that to happen since that ruins the flow of the level.

(obviously I'll probably continue to just use C++ btw :P I really like the power)
The first thing I would do with infinite power would be to make myself a cave where I could look at my shadow forever.

Image <- Go team Yeah Doctor Shemp.!
Image <- That's everyone being nice to me. ^^

I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

That sounds awesome! It's quite easier to understand! Thanks!

Though what was the solution for that "the player can escape the autoscroll" bug?
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

docopoper wrote:Can you see if you can find some way to catch the death function and cause something else to happen instead? I have a great idea for a really long and epic autoscroll level that the player shouldn't be able to die during and I'd like things like when they get crushed by the level boundaries they instead just reappear at some currently on-screen checkpoint so that they can continue without having to restart.

I could check to see if they're about to be crushed manually and teleport them then - but I imagine there will be plenty of glitch deaths associated with that and I really don't want that to happen since that ruins the flow of the level.

(obviously I'll probably continue to just use C++ btw :P I really like the power)
The only real way to catch it would be to add another hook to the .exe which is a bit too much trouble especially with different .exe floating around, but it might also be possible if you just continuously scan the player variables associated with death and like... cancel em out once they change.

I just tested it and apparently you can cancel a death by setting player DeathState and DeathTimer to 0, but make sure to teleport at the same time or you get this weird glitchy fountain of demos who die 60 times per second.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
docopoper
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non pharetra enim, nec maximus odio.
Posts: 78
Joined: 12 years ago
First name: Shane Farrell
Pronouns: they/he
Location: Ireland

Re: LunaDLL help thread

Post by docopoper »

Kil wrote:The only real way to catch it would be to add another hook to the .exe which is a bit too much trouble especially with different .exe floating around, but it might also be possible if you just continuously scan the player variables associated with death and like... cancel em out once they change.

I just tested it and apparently you can cancel a death by setting player DeathState and DeathTimer to 0, but make sure to teleport at the same time or you get this weird glitchy fountain of demos who die 60 times per second.
Oh cool. Well that sure is convenient. :D
The first thing I would do with infinite power would be to make myself a cave where I could look at my shadow forever.

Image <- Go team Yeah Doctor Shemp.!
Image <- That's everyone being nice to me. ^^

I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
User avatar
Trotim
Posts: 13
Joined: 15 years ago
Location: Germany

Re: LunaDLL help thread

Post by Trotim »

So what's actually the most recent LunaDLL version, and where does one get it?
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

This one I guess, but i'm still upgrading it at this moment http://www.gamearchaeology.com/LunaDll.dll
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

TiKi wrote:Though what was the solution for that "the player can escape the autoscroll" bug?
Help please
User avatar
Mabel
Just west of wierd
Posts: 302
Joined: 10 years ago
https://marbels.talkhaus.com/

Re: LunaDLL help thread

Post by Mabel »

is there a code that makes default sound effects not play?
im looking at the drown thing and I dont want the default death sound to play.
Image
Image
Image Image
User avatar
Willhart
Stalker, Doxxer, and Sexual Harasser
Banned
Posts: 2434
Joined: 13 years ago
Location: Finland

Re: LunaDLL help thread

Post by Willhart »

It would be nice if there was a way to clear all of the trigger zones. I'm making Aus/Cat planet style screen transitions with trigger zones and super fast screen movement.

Here is what I have so far. It works, but I can't expand it yet.
Attachments
AusCamera.rar
(1.93 KiB) Downloaded 41 times
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

TiKi wrote:
TiKi wrote:Though what was the solution for that "the player can escape the autoscroll" bug?
wat
Mabel wrote:is there a code that makes default sound effects not play?
im looking at the drown thing and I dont want the default death sound to play.

I don't think that's possible, once SMBX has played the sound there's nothing that can be done about it. The only way is to to bypass the regular death and create your own custom death event. You can do it with PlayerMemSet,0,0x13C,0xFFFF,0,1,w or PlayerMemSet,0,0x13E,130,0,1,w but they're not quite the same as a regular death.
Willhart wrote:It would be nice if there was a way to clear all of the trigger zones. I'm making Aus/Cat planet style screen transitions with trigger zones and super fast screen movement.

Here is what I have so far. It works, but I can't expand it yet.
Maybe I should make a new command to handle this? It seems tedious to do it all by hand with trigger zone. Also, not sure what problem you're having exactly.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Willhart
Stalker, Doxxer, and Sexual Harasser
Banned
Posts: 2434
Joined: 13 years ago
Location: Finland

Re: LunaDLL help thread

Post by Willhart »

Kil wrote:Maybe I should make a new command to handle this? It seems tedious to do it all by hand with trigger zone. Also, not sure what problem you're having exactly.
I've had to respawn the trigger zones every time one is used. If there are two on top of each other they both trigger at a same time, making the screen go too far.

The screens are so close to each other that there is no space for trigger between them. They extend to the neightboring screen areas and can be triggered from the wrong side. With clear command I could remove excess trigger zones to prevent them from stacking, aka have only the adjasent triggers to a section active all times. A new command would be super helpful though for the metroidvania style levels I have planned.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

Yeah to solve both of those problems I was thinking of a command like

Code: Select all

ScreenBorderTrigger,1000,1001,1002,1003,0,10

// up border triggered...
#1000
push borders up

// down border triggered...
#1001
push borders down
That would attach 4 trigger zones to the camera. I'm thinking the final number 10 would be for setting how many pixels deep the zones are into the screen. I would also make it so they only trigger when the player is moving TOWARDS them.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Willhart
Stalker, Doxxer, and Sexual Harasser
Banned
Posts: 2434
Joined: 13 years ago
Location: Finland

Re: LunaDLL help thread

Post by Willhart »

That would be pretty much perfect.
There are still two things though. If the player somehow managed to get out of bounds, they would fall forever. I just need to design around that. Other thing is that the background breaks if I try to use one on the example level I made. I can get around that too with the help of resized blocks.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

There is a way to fix the background actually. You need to start the borders of the level in the editor all the way around the entire level, so when it loads it loads the background properly. Of course, then your borders won't be in the right place... but you could try pushing them by a certain amount for 1 frame so they end up where you want them. It'll be really easy to fix once I add the other AutoscrollTo command..
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

Basically you can walk out of the autoscroll zone. It "catches up" to you if you wait for a bit outside of the zone.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

The only reason that should be happening is you made your borders bigger than one screen. Your borders have to be one screen or the camera will follow you around until it hits a border.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Luigifan2010
Lua squad
Posts: 2
Joined: 9 years ago
First name: Mike
Pronouns: he/him/his
Location: United States

Re: LunaDLL help thread

Post by Luigifan2010 »

Alrighty! I've finally found my way over to this thread. I decided I'm ready to start doing a little bit of playing around with this for fun.

First things first, let's say I have my own SMBX 1.3.0.1 not LunaDLL "injected". Is there a one-stop shop to inject the DLL into my own version of SMBX or should I just remodify your lunadll SMBX with my changes?

Second of all, I decided I wanted to at least compile my own LunaDLL. What I wanted to do is change the demo counter to a death counter which thankfully was just a simple string change. I proceeded to try and compile it against the VS2010 platformset on VS2013 (every time I tried to build on VSC++ 2010 Express the IDE just broke :/). I got this error
Error 1 error LNK2019: unresolved external symbol __imp__PlaySoundW@12 referenced in function "public: void __thiscall Autocode::Do(bool)" (?Do@Autocode@@QAEX_N@Z) C:\Users\Mike\Desktop\take 2 lunadll\LunaDll\Autocode.obj LunaDll
Error 2 error LNK1120: 1 unresolved externals C:\Users\Mike\Desktop\take 2 lunadll\Debug\LunaDll.dll 1 1 LunaDll
For those who get this error, here's what I did and it compiled fine.
  1. Project>Project Property Pages
  • Go to "Linker" then to "Input"
  • Under "Additional Dependencies" add "winmm.lib" to the end of the list before the "%(AdditionalDependencies)" (be sure to add the semicolon after winmm.lib)
EDIT: this then caused this to happen
Image
on entering the toggledemocounter cheat

EDIT2: ok set the project to release and then you don't get that error, i also copied lunadll.lib and lunadll.exp but i dont think those are necessary

which I guess this leads me into my second question: how up to date is this source code?

EDIT3: also, what do the death counter numbers mean? the two numbers there. the one on the right seems to be one higher than the one on the left
Post Reply