LunaDLL/LunaLUA help thread

The second SMBX collab!
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

Are you totally sure you updated lunadll because I just played your level and the HUD is gone.

also you might want to use LunaControl,1,0,0,0,0,0 to get rid of the demo counter as well
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

Does LunaDLL v7 call the HUD? As in, do I need to update my exe?
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

you don't need to update the exe

you just need lunadll.dll
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

...nope

Here's my exe, and the stuff I copied into the smbx folder when you uploaded it.
http://speedy.sh/rNGyx/smbx.zip
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

Somehow it says updated yesterday but it's actually a really old version...

maybe just download the dll directly http://www.gamearchaeology.com/LunaDll.dll
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Mabel
Just west of wierd
Posts: 299
Joined: 9 years ago
https://marbels.talkhaus.com/

Re: LunaDLL help thread

Post by Mabel »

whats the code again to give a player x amount of lives upon entering a level?
Image
Image
Image Image
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

probably
#-1
memAssign,0x00B2C5AC,50,1,0,1,f

to add 50 lives
DON'T PM me. Ask your question in the help thread so everyone can be answered.
User avatar
Mabel
Just west of wierd
Posts: 299
Joined: 9 years ago
https://marbels.talkhaus.com/

Re: LunaDLL help thread

Post by Mabel »

Wierd...doesn't seem to be working for me
Image
Image
Image Image
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

I mean MemAssign,0x00B2C5AC,50,1,0,1,f
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

Is it possible to only show the score counter?
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

No and I'll probably have to get rid of the hud disabler too because something weird is happening where it thinks it's in 2 player mode
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

i'll just leave this here

Image
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

Kil wrote:i'll just leave this here

Image
Is that a danmaku boss?
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

Damn dude do you get emails when someone posts in this thread or what :P
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

No I just look at talkhaus a lot :P

Why exactly is it not possible for lunadll to be hooked to the map? It could do useful stuff like filtering and show/hide BGOs after a level is complete
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

Because I didn't add a hook to the map running function in smbx and no one knows how it all works anyway
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: 11 years ago
First name: Shane Farrell
Pronouns: they/he
Location: Ireland

Re: LunaDLL help thread

Post by docopoper »

Wow. Is that done with npcs or drawing sprites on the screen? Also are you doing that collision checking yourself? The reason I've avoided trying to do that is because it would end up being n^2... And n^2 is the root of all evil in my head.
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.
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

I am doing the collision detection, but not doing an all-pairs test so it's not nearly as slow as it could be. I made a spatial partitioner thing for blocks which divides all the blocks in the level into cells in an associative array, so sprites can query it for nearby blocks only, so your typical sprite is only collision checking against 0-3 blocks at a time instead of 14000 blocks at a time.
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: 11 years ago
First name: Shane Farrell
Pronouns: they/he
Location: Ireland

Re: LunaDLL help thread

Post by docopoper »

Wow, great. Is that built in to LunaDLL? Also what do you do about moving layers and blocks outside the level boundaries?
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.
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

Moving layers in the current section are scanned each frame and added to the cells just as usual so it works out the same. If you have moving layers you should scan every frame. If not, you only need to scan once per section, which can save a lot of cycles. There's currently no special physics for them though, they're just solid blocks. Blocks outside the section aren't scanned. It is built into lunadll now and you can access it with this function

Code: Select all

void GetObjectsOfInterest(list<CellObj>* objlist, double x, double y, int w, int h);	// Get objs that might be intersecting a rectangle
Just give it an empty list and the rectangle of your sprite and it'll populate the list with whatever nearby blocks you'll want to collision test against.

For the bullets I'm using a pretty simple function for colision that just deletes the bullet whenever it hits any block, period.

Code: Select all

void SpriteFunc::CrashMove(CSprite* me, SpriteComponent* obj) {
	me->m_Xpos += me->m_Xspd;
	me->m_Ypos += me->m_Yspd;

	list<CellObj> collide_list;
	gCellMan.GetObjectsOfInterest(&collide_list, me->m_Hitbox.CalcLeft(), 
												me->m_Hitbox.CalcTop(), 
												(int)me->m_Hitbox.W,
												(int)me->m_Hitbox.H);
	if(collide_list.size() > 0) {		
		for each(CellObj cellobj in collide_list) {		
			if(cellobj.Type == CLOBJ_SMBXBLOCK) {
				Block* block = (Block*)cellobj.pObj;
				if(!block->IsHidden && !block->IsInvisible 
					&& me->m_Hitbox.Test((int)block->XPos, (int)block->YPos, (int)block->W, (int)block->H)) {						
						me->Die();
				}
			}
		}
	}
}
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

Is there a way to make Mario's hitbox 32 pixels but he LOOKS 44 pixels?
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

(Please forgive the double post)
How did you do the effect in ASMBXT2 where you could duck twice and you changed between Demo and Iris?
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

You can use an OnInput chain

OnInput can wait for down to be pressed, and it activates another event which also contains a short OnInput command, and if you press down again that second OnInput activates, changing the character
DON'T PM me. Ask your question in the help thread so everyone can be answered.
TiKi
Posts: 690
Joined: 9 years ago

Re: LunaDLL help thread

Post by TiKi »

Okay, I amputated this from Science and:

Code: Select all

#0
//Filter Kood/raocow/Sheath to Demo
FilterPlayer,0,5,1,0,0,0
FilterPlayer,0,3,1,0,0,0
FilterPlayer,0,4,1,0,0,0

//Setp 1 of Double-tap down code
OnInput,0,2,1,1007,0,0

//Determine if character is Demo or Iris and show correct layer/bkg
OnPlayerMem,0xF0,1,0,1005,0,w
OnPlayerMem,0xF0,2,0,1006,0,w

//Disable spinjump, flying, and tailspin
//PlayerMemSet,0,0x164,0xFFFF,0,0,w
//PlayerMemSet,0,0x50,0,0,0,w
//PlayerMemSet,0,0x120,0,0,0,w
PlayerMemSet,0,0x16C,0,0,0,w
PlayerMemSet,0,0x16E,0,0,0,w

//Event 1007 Step 2 of double-tap down code
#1007
OnInput,0,2,1,1008,15,0

//Event 1008 Three steps:
//Cycle the player from Demo to Iris and Iris to Kood (which filters back to Demo)
//Determine what item is in Reserve and Fire event to replace
//(this is so you don't lose your powerup when swapping from Iris to Demo via Kood)
#1008
CyclePlayerRight,0,0,0,0,1,0
OnPlayerMem,0x158,9,0,1009,1,w
OnPlayerMem,0x158,14,0,1010,1,w
OnPlayerMem,0x158,34,0,1011,1,w
And it's working pretty nice. The commenting made it easy to figure out. My only gripe is that as the text says, Peach and her hearts are viewable for a few seconds after switching to Mario. I was planning to switch between Peach Toad and Link, so would this cause trouble for that setup? Would I have to replace it with player specific events that switch to a certain player directly?
Kil
Posts: 13
Joined: 13 years ago

Re: LunaDLL help thread

Post by Kil »

For whatever you want, you just need to put the right FilterPlayer commands in the final event, so they happen at the same time you actually change players, and remember to delete the ones in #0.
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Post Reply