LunaDLL - SMBX Extension Module

This is where we'll store the "best" topics that have ever existed on the forums, as well as community events that are no longer relevant. Read at your own risk.
Forum rules
Read at your own risk.
User avatar
lighthouse64
Mouser
Mouser
Posts: 1820
Joined: Sat Apr 26, 2014 6:28 am
Current Project: Soundtrack stuff

Re: LunaDLL - SMBX Extension Module

Postby lighthouse64 » Sun Jan 11, 2015 2:16 am

I've got a problem. So I just used this code and I was trying to play a wav file with this code:

Code: Select all

function onLoad()
     playSFX("../../../pixel/blip.wav")
end
but all smbx does is play the windows "ding".
Just your average user...

Oh, and sometimes I arrange stuff like this :P https://www.noteflight.com/scores/view/ ... 25261b1a11

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaDLL - SMBX Extension Module

Postby Kevsoft » Sun Jan 11, 2015 2:21 am

This means that your soundfile is not found. Please check if your path is correct. The path starts from the custom folder dir.

User avatar
lighthouse64
Mouser
Mouser
Posts: 1820
Joined: Sat Apr 26, 2014 6:28 am
Current Project: Soundtrack stuff

Re: LunaDLL - SMBX Extension Module

Postby lighthouse64 » Mon Jan 12, 2015 12:16 am

Kevsoft wrote:This means that your soundfile is not found. Please check if your path is correct. The path starts from the custom folder dir.
Well, it is in the custom folder. Is it because it needs to go in the worlds folder?
Just your average user...

Oh, and sometimes I arrange stuff like this :P https://www.noteflight.com/scores/view/ ... 25261b1a11

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaDLL - SMBX Extension Module

Postby Kevsoft » Mon Jan 12, 2015 11:34 am

When it is in the custom folder, why don't you use

Code: Select all

function onLoad()
     playSFX("blip.wav")
end

User avatar
lighthouse64
Mouser
Mouser
Posts: 1820
Joined: Sat Apr 26, 2014 6:28 am
Current Project: Soundtrack stuff

Re: LunaDLL - SMBX Extension Module

Postby lighthouse64 » Mon Jan 12, 2015 11:47 pm

Kevsoft wrote:When it is in the custom folder, why don't you use

Code: Select all

function onLoad()
     playSFX("blip.wav")
end
I've tried that too. I'll check again though.
Just your average user...

Oh, and sometimes I arrange stuff like this :P https://www.noteflight.com/scores/view/ ... 25261b1a11

DiamondPhoenix
Shy Guy
Shy Guy
Posts: 9
Joined: Wed Apr 02, 2014 9:24 pm

Re: LunaDLL - SMBX Extension Module

Postby DiamondPhoenix » Thu Jan 29, 2015 2:13 am

Okay, see, this is what i don't get.
I have LunaRef with me, and it upsets me that there are more codes that are not seen in the document i have.
I have been linked there (http://engine.wohlnet.ru/docs/Collected/LunaDLL/), and that lunaref is exactly the same!

http://www.supermariobrosx.org/forums/v ... =31&t=5449
Now i see things like "LoadImage", "PlaceSprite"... Even "ShowVar" isn't in my document! what else am i missing?
Please, if anyone has the TRUE COMPLETE list of the codes, i will be very happy!
Last edited by DiamondPhoenix on Thu Jan 29, 2015 3:52 pm, edited 1 time in total.

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaDLL - SMBX Extension Module

Postby Kevsoft » Thu Jan 29, 2015 5:49 am

I have to dissapoint you, but the original developer of LunaDLL didn't document the latest version of Autocode.

This is the only thing I can provide:

Code: Select all

enum AutocodeType {
	AT_Invalid = 0,
	AT_FilterToSmall,			//1:		2:				3:				4:			5: Active time  6:
	AT_FilterToBig,				//1:		2:				3:				4:			5: Active time  6:
	AT_FilterToFire,			//1:		2:				3:				4:			5: Active time  6:
	AT_FilterMount,				//1:		2:				3:				4:			5: Active time  6:
	AT_FilterReservePowerup,	//1:		2:				3:				4:			5: Active time  6:
	AT_FilterPlayer,			//1:	    2: Filter ID	3: Filter to	4:			5: Active time	6:

	AT_InfiniteFlying,			//1:		2:				3:				4:			5: Active time  6:
	AT_HeartSystem,				//1: X pos	2: Y pos		3: Max hearts	4:			5: Active time	6:

	AT_ScreenEdgeBuffer,		//1: NPC ID	2: UDLR Bordr	3: Buffer space 4:			5: Active time	6: 

	AT_ShowText,				//1:		2: Xpos			3: Ypos			4: Font #	5: Active time  6: Text
	AT_ShowNPCLifeLeft,			//1: NpcID	2: Xpos			3: Ypos			4: Section	5: Active time  6: Base health	

	AT_Trigger,					//1: Newsec	2: Event		3:				4:			5: Active time  6:	
	AT_Timer,					//1: Target	2: Effect		3: Display Y/N	4: Repeat?	5: Active time  6:
	AT_IfNPC,					//1: NpcID  2: Condition	3: Argument		4: Event	5: Active time	6: Option
	AT_BlockTrigger,			//1: NpcID  2: Block Type	3: Argument  	4: Event	5: Active time	6: Option
	AT_TriggerRandom,			//1: Event	2: Event		3: Event		4: Event	5: Active time	6:
	AT_TriggerRandomRange,		//1: StartEv2: EndEv		3:				4:			5: Active time	6:
	AT_TriggerZone,				//1: Event	2: Top			3: Bottom		4: Left		5: Right		6: Option
	AT_ScreenBorderTrigger,		//1: EventL	2: EventU		3: EventR		4: EventD	5: ActiveTime	6: Inward depth

	AT_OnInput,					//1:		2: Button		3: First frame?	4: Event	5: Active time	6:
	AT_OnCustomCheat,			//1:		2:				3: Only once?	4: Event	5: Active time  6: Cheat string
	AT_OnPlayerMem,				//1: Offset	2: Value		3: Comparison	4: Event	5: Active time	6: Type (b, w, dw, f, qw/df)
	AT_OnGlobalMem,				//1: Addr	2: Value		3: Comparison	4: Event	5: Active time	6: Type (b, w, dw, f, qw/df)

	AT_SetVar,					//1: 		2: Op			3: Value		4:			5: Active time	6: 
	AT_LoadPlayerVar,			//1:		2: Offset		3: Op			4: 			5: Active time	6: Type (b, w, dw, f, qw/df)
	AT_LoadNPCVar,				//1: Type	2: Offset		3: Op			4: Section	5: Active time	6: Type (b, w, dw, f, qw/df)
	AT_LoadGlobalVar,			//1: Addr	2: Op			3:				4:			5: Active time	6: Type (b, w, dw, f, qw/df)	
	AT_IfVar,					//1:		2: CompareType	3: Value		4: Event	5: Active time	6: 
	AT_CompareVar,				//$Var 1	1:	2:CompareType 3:			4: Event	5: ActiveTime	6: Var 2
	AT_ShowVar,					//1:		2: Xpos			3: Ypos			4: Font #	5: Active time	6: Base text
	AT_BankVar,					//1:		2:				3:				4:			5: Active time	6: Name of luna var
	AT_WriteBank,				//1:		2:				3:				4:			5:				6:

	AT_LunaControl,				//1: Action	2: Value		3:				4:			5: Active time	6:	

	AT_DeleteCommand,			//1:		2:				3:				4:			5: Active time  6: Refernece to cmd
	AT_ModParam,				//1: To mod#2: Value		3: Operation	4:			5: Active time	6: Refernece to cmd
	AT_ChangeTime,				//1:		2: Value		3: Operation	4:			5: Active time	6: Refernece to cmd

	AT_DeleteEventsFrom,		//1: Section2:				3:				4:			5: Active time  6:
	AT_ClearInputString,		//1:		2:				3:				4:			5: Active time  6:

	AT_LayerXSpeed,				//1: Layer #2: Stop after?	3:				4:  		5: Active time	6: Speed
	AT_LayerYSpeed,				//1: Layer #2: Stop after?	3:				4:			5: Active time	6: Speed
	AT_AccelerateLayerX,		//1: Layer #2: Max speed	3:				4:			5: Active time	6: Speed
	AT_AccelerateLayerY,		//1: Layer #2: Max speed	3:				4:			5: Active time	6: Speed
	AT_DeccelerateLayerX,		//1: Layer #2: Deccel to	3: 				4:			5: Active time	6: Speed
	AT_DeccelerateLayerY,		//1: Layer #2: Deccel to	3:				4:			5: Active time	6: Speed	

	AT_SetAllBlocksID,			//1: Type	2: Set to		3:				4:			5: Active time	6:
	AT_SwapAllBlocks,			//1: Type 1	2: Type 2		3:				4:			5: Active time	6:
	AT_ShowAllBlocks,			//1: Type 1	2:				3:				4:			5: Active time	6:
	AT_HideAllBlocks,			//1: Type 1	2:				3:				4:			5: Active time	6:

	AT_PushScreenBoundary,		//1: Section2: UDLR			3:				4:			5: Active time	6: Speed
	AT_SnapSectionBounds,		//1: Section2: Target X		3: Target Y		4:			5: Active time	6:

	AT_CyclePlayerRight,		//1:		2:				3:				4:			5: Active time	6:
	AT_CyclePlayerLeft,			//1:		2:				3:				4:			5: Active time	6:

	AT_SetHearts,				//1:		2: Hearts		3:				4:			5: Active time	6:
	AT_SetHits,					//1: NpcID  2: Section		3: Hits			4:			5: Active time	6:
	AT_ForceFacing,				//1: NpcID  2: Section		3: 				4:			5: Active time	6:

	AT_SFX,						//1:		2: Index		3:				4:			5: Delay		6:
	AT_SetMusic,				//1: Section2: Music #		3:				4:			5: Active time	6: Optional file name
	AT_PlayMusic,				//1:		2: Section		3:				4:			5: Delay		6:
		
	AT_TriggerSMBXEvent,		//1:		2: Arg			3:				4:			5: Active time	6: Name of event

	AT_Hurt,					//1: Target 2:				3: 				4:			5: Active time	6: Option
	AT_Kill,					//1: Target 2:				3: 				4:			5: Active time	6: Option

	AT_NPCMemSet,				//1: Type	2: Offset		3: Value		4: Op		5: Active time	6: Type (b, w, dw, f, qw/df)
	AT_PlayerMemSet,			//1:		2: Offset		3: Value		4: Op		5: Active time	6: Type (b, w, dw, f, qw/df)
	AT_MemAssign,				//1: Addr	2: Value		3: Operation	4:			5: Active time	6: Type (b, w, dw, f, qw/df)

	AT_DebugPrint,				//1:		2:				3:				4:			5: Active time	6:
	AT_DebugWindow,				//1:		2:				3:				4:			5:				6: Text	

	AT_CollisionScan,			//1:		2:				3:				4:			5: Active time	6:

	/// Sprite stuff ///
	AT_LoadImage,				//1: Code	2: TransColor	3:				4:			5:				6: File name
	AT_SpriteBlueprint,			//0: $RefName, others empty	
	AT_Attach,					//0: $Target blueprint,		1: Attach type	2: 3: 4: 5: 6: Source component name
	AT_PlaceSprite,				//1: Type	2: ImgResource	3: Xpos			4: Ypos		5: Sprite time	6:

	// Sprite components //
	AT_OnPlayerCollide = 10000,	//1:		2: Player small circle hitbox? 3: 4: Comp	5: Active time  6:
	AT_OnPlayerDistance,		//1: Dist	2: far/close	3:				4: Comp		5: Active time  6:	
	AT_WaitForPlayer,			//1: Offset	2: Value		3: Comparison	4: Comp		5: Active time	6: Type (b, w, dw, f, qw/df)
	AT_PlayerHoldingSprite,		//1: Type	2:				3:				4: Comp		5: Active time  6:

	AT_RandomComponent,			//1: choice 2: choice		3: choice		4: choice	5: Active time	6:
	AT_RandomComponentRange,	//1: start	2: end			3:				4:			5: Active time	6:

	AT_SetSpriteVar,			//1: 		2: Op			3: Value		4:			5: Active time	6: 
	AT_IfSpriteVar,				//1:		2: CompareType	3: Value		4: Event	5: Active time	6:
	AT_IfLunaVar,				//1:		2: CompareType	3: Value		4: Event	5: Active time	6:

	AT_Die,						//1:		2:				3:				4:			5: Active time  6: 

	AT_Deccelerate,				//1: X rate	2: Y rate		3: Minimum		4:			5: Active time  6:
	//AT_Accelerate				//1: X rate	2: Y rate		3: Maximum		4:			5: Active time  6: Option
	AT_AccelToPlayer,			//1: X rate	2: Y rate		3: Maximum		4:			5: Active time  6:
	AT_ApplyVariableGravity,	//1:		2: 0=x 1=y		3:				4:			5: Active time	6: Name of lunadll variable

	AT_TeleportNearPlayer,		//1: Radius	2:				3:				4:			5: Active time  6:
	AT_TeleportTo,				//1: x		2: y			3:				4:			5: Active time  6:

	AT_PhaseMove,				//1:		2:				3:				4:			5: Active time  6:
	AT_BumpMove,				//1:		2: NRGLoss%		3:				4:			5: Active time  6:
	AT_CrashMove,				//1:		2:				3:				4:			5: Active time  6:

	AT_SetXSpeed,				//1: Speed	2:				3:				4:			5: Active time  6:
	AT_SetYSpeed,				//1: Speed	2:				3:				4:			5: Active time  6:
	AT_SetAlwaysProcess,		//1: Off/On
	AT_SetVisible,				//1: Off/On
	AT_SetHitbox,				//1: LeftOff2: Top offset	3: Width		4: Height	5: Active time	6: option

	AT_BasicAnimate,			//1: Height 2: Speed
	AT_Blink,					//1: Speed	2: Reverse		3:				4:			5: Active time  6:
	AT_AnimateFloat,			//1: Speed	2: X magnitude	3: Y magnitude

	AT_TriggerLunaEvent,		//1: Event	2:				3:				4:			5: Active time  6:
	AT_HarmPlayer,				//1:		2:				3:				4:			5: Active time  6:

	AT_GenerateInRadius,		//1:    	2: ImgResource	3: Radius		4: SprTime	5: Active time  6: Sprite blueprint name
	AT_GenerateAtAngle,			//1:		2: ImgResource	3: Speed		4: SprTime	5: Active time  6: Sprite blueprint name

	AT_SpriteTimer,				//1:		2:				3: Repeat		4: Comp		5: Active time  6:

	AT_SpriteDebug,				//1:		2:				3: Repeat		4: Comp		5: Active time  6:

	AT_StaticDraw,
	AT_RelativeDraw
};

DiamondPhoenix
Shy Guy
Shy Guy
Posts: 9
Joined: Wed Apr 02, 2014 9:24 pm

Re: LunaDLL - SMBX Extension Module

Postby DiamondPhoenix » Thu Jan 29, 2015 3:54 pm

Awesome! Thanks! :D

Also, is the latest version of LunaDLL 2014/09/16? That's the one i have downloaded from wohlnet.

EDIT: Is it possible to use custom fonts using an image for printing text?

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaDLL - SMBX Extension Module

Postby Kevsoft » Fri Jan 30, 2015 12:34 am

Please download LunaLua. The LunaLua-package also contains the latest version for Autocode.

If you want to do something like custom font, then you have to learn programming with LunaLua.

Onule
Koopa Troopa
Koopa Troopa
Posts: 27
Joined: Tue Mar 18, 2014 11:54 pm

Re: LunaDLL - SMBX Extension Module

Postby Onule » Sat Jan 31, 2015 5:43 pm

How does one make it so that killing a specific NPC would create and store a variable into LunaSavedVars, then read said variable in another level? Using LunaLua.

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaDLL - SMBX Extension Module

Postby Kevsoft » Sun Feb 01, 2015 5:51 am

For saving in the userbank see: LunaLua global functions (scroll down for the UserData API).

It only works for a specific type of npc:

Code: Select all

--Whatever type you want
killedAllGoombas = false

function countNPCID(id)
   local npcs = findnpcs(id, -1)
   local count = 0
   for k,v in pairs(npcs) do
      count = count + 1
   end
   return count
end


function onLoop()
  -- only execute when goombas not already killed
  if not killedAllGoombas then
    local goombasCount = countNPCID(1)
    if goombasCount == 0 then
      killedAllGoombas = true --To prevent to execute multiple times
      --Here you code what to do
    end
  end
end

Onule
Koopa Troopa
Koopa Troopa
Posts: 27
Joined: Tue Mar 18, 2014 11:54 pm

Re: LunaDLL - SMBX Extension Module

Postby Onule » Sat Feb 07, 2015 1:14 pm

Works perfectly, thanks.
One other thing, is it possible to do the ScreenEdgeBuffer with LunaLua?

EDIT: And I think onLoad() isn't working on my end.

User avatar
Kevsoft
Ripper II
Ripper II
Posts: 374
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaDLL - SMBX Extension Module

Postby Kevsoft » Sun Feb 08, 2015 1:22 am

onLoad has been fixed in the latest version.

Onule
Koopa Troopa
Koopa Troopa
Posts: 27
Joined: Tue Mar 18, 2014 11:54 pm

Re: LunaDLL - SMBX Extension Module

Postby Onule » Sun Feb 08, 2015 2:13 pm

Odd, could of sworn I had the latest version. Still, redownloading the files fixed it. Also there's no way to freeze the player's input? Can't use the classic events for some reason.

y479021776
Rex
Rex
Posts: 83
Joined: Sat Oct 11, 2014 10:07 pm

Re: LunaDLL - SMBX Extension Module

Postby y479021776 » Mon Feb 09, 2015 12:02 pm

Can it use custom SFX?

User avatar
DarkShadeX
Volcano Lotus
Volcano Lotus
Posts: 535
Joined: Sat Jan 18, 2014 11:34 am

Re: LunaDLL - SMBX Extension Module

Postby DarkShadeX » Mon Feb 09, 2015 12:22 pm

Yes you can.
Just make sure the sound files are in the same folder as the level graphics.

User avatar
lighthouse64
Mouser
Mouser
Posts: 1820
Joined: Sat Apr 26, 2014 6:28 am
Current Project: Soundtrack stuff

Re: LunaDLL - SMBX Extension Module

Postby lighthouse64 » Tue Feb 10, 2015 12:43 am

DarkShadeX wrote:Yes you can.
Just make sure the sound files are in the same folder as the level graphics.
But all u get is a ding sound if u do that.
Just your average user...

Oh, and sometimes I arrange stuff like this :P https://www.noteflight.com/scores/view/ ... 25261b1a11

User avatar
DarkShadeX
Volcano Lotus
Volcano Lotus
Posts: 535
Joined: Sat Jan 18, 2014 11:34 am

Re: LunaDLL - SMBX Extension Module

Postby DarkShadeX » Tue Feb 10, 2015 4:35 pm

Works fine for me.
(try getting wohlstands lunadll package.)

User avatar
lighthouse64
Mouser
Mouser
Posts: 1820
Joined: Sat Apr 26, 2014 6:28 am
Current Project: Soundtrack stuff

Re: LunaDLL - SMBX Extension Module

Postby lighthouse64 » Wed Feb 11, 2015 7:01 am

DarkShadeX wrote:Works fine for me.
(try getting wohlstands lunadll package.)
oh, I guess I should try that. Can u send me the link? :)
Just your average user...

Oh, and sometimes I arrange stuff like this :P https://www.noteflight.com/scores/view/ ... 25261b1a11

User avatar
Wohlstand
Boom Boom
Boom Boom
Posts: 1779
Joined: Tue Feb 11, 2014 4:44 pm
Flair: 狐エンジニア
Current Project: Moondust (PGE Project)
Chat Username: Wohlstand#4881
Contact:

Re: LunaDLL - SMBX Extension Module

Postby Wohlstand » Wed Feb 11, 2015 9:33 am

lighthouse64 wrote:
DarkShadeX wrote:Works fine for me.
(try getting wohlstands lunadll package.)
oh, I guess I should try that. Can u send me the link? :)
All SDL links (DarkShadeX means especially LunaLUA+SDL version) and readme's here:
http://www.supermariobrosx.org/forums/v ... =69&t=7427

Be careful:
- All musics should have 44100 sample rate or you will get noisy or "too speedy" playback.
- You need to get the special sound pack in OGG format (optional, you can get OGG musics too which have MUCH BETTER quality than presented in SMBX 1.3.0.1 package). More detail on than page
PGE Project, my Media and supported projects: show
Support me on the Patreon
Image

PGE Project
PGE Project SMBX Topic
PGE Project Official Site and forums
Download fresh experimental builds HERE!

I'm support:
Lowser's Conquest by Sednaiur

Image
P.S. I don't like huge signatures which would be annoying, therefore I put huge content into spoilers


Return to “Archives”

Who is online

Users browsing this forum: No registered users and 2 guests