Page 19 of 59

Re: LunaDLL help thread

Posted: 11 Aug 2014, 20:18
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

Re: LunaDLL help thread

Posted: 12 Aug 2014, 22:46
by TiKi
Does LunaDLL v7 call the HUD? As in, do I need to update my exe?

Re: LunaDLL help thread

Posted: 12 Aug 2014, 22:57
by Kil
you don't need to update the exe

you just need lunadll.dll

Re: LunaDLL help thread

Posted: 13 Aug 2014, 03:12
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

Re: LunaDLL help thread

Posted: 13 Aug 2014, 03:27
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

Re: LunaDLL help thread

Posted: 13 Aug 2014, 04:02
by Mabel
whats the code again to give a player x amount of lives upon entering a level?

Re: LunaDLL help thread

Posted: 13 Aug 2014, 04:06
by Kil
probably
#-1
memAssign,0x00B2C5AC,50,1,0,1,f

to add 50 lives

Re: LunaDLL help thread

Posted: 13 Aug 2014, 06:18
by Mabel
Wierd...doesn't seem to be working for me

Re: LunaDLL help thread

Posted: 13 Aug 2014, 13:09
by Kil
I mean MemAssign,0x00B2C5AC,50,1,0,1,f

Re: LunaDLL help thread

Posted: 18 Aug 2014, 03:48
by TiKi
Is it possible to only show the score counter?

Re: LunaDLL help thread

Posted: 18 Aug 2014, 05:02
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

Re: LunaDLL help thread

Posted: 22 Aug 2014, 01:37
by Kil
i'll just leave this here

Image

Re: LunaDLL help thread

Posted: 22 Aug 2014, 01:43
by TiKi
Kil wrote:i'll just leave this here

Image
Is that a danmaku boss?

Re: LunaDLL help thread

Posted: 22 Aug 2014, 02:15
by Kil
Damn dude do you get emails when someone posts in this thread or what :P

Re: LunaDLL help thread

Posted: 22 Aug 2014, 02:39
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

Re: LunaDLL help thread

Posted: 22 Aug 2014, 02:45
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

Re: LunaDLL help thread

Posted: 22 Aug 2014, 10:06
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.

Re: LunaDLL help thread

Posted: 22 Aug 2014, 16:27
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.

Re: LunaDLL help thread

Posted: 22 Aug 2014, 19:47
by docopoper
Wow, great. Is that built in to LunaDLL? Also what do you do about moving layers and blocks outside the level boundaries?

Re: LunaDLL help thread

Posted: 22 Aug 2014, 20:15
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();
				}
			}
		}
	}
}

Re: LunaDLL help thread

Posted: 22 Aug 2014, 23:38
by TiKi
Is there a way to make Mario's hitbox 32 pixels but he LOOKS 44 pixels?

Re: LunaDLL help thread

Posted: 25 Aug 2014, 20:13
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?

Re: LunaDLL help thread

Posted: 25 Aug 2014, 20:40
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

Re: LunaDLL help thread

Posted: 26 Aug 2014, 03:38
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?

Re: LunaDLL help thread

Posted: 26 Aug 2014, 06:23
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.