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.

Moderator: Userbase Moderators

Forum rules
Read at your own risk.
Anyone98
Cheep-Cheep
Cheep-Cheep
Posts: 10
Joined: Mon Dec 29, 2014 10:25 am

Re: LunaDLL - SMBX Extension Module

Postby Anyone98 » Fri Jan 02, 2015 8:47 am

Wohlstand wrote:
DiamondPhoenix wrote:Well...
http://www.gamearchaeology.com is down, that means i cannot get the latest complete command reference.
Don't worry, I collected some stuff here:
http://engine.wohlnet.ru/docs/Collected/LunaDLL/
All that files must get?And how can I run this system.I made a level with lunadll coded NPC.I'm only putted the lunadll text file and npc but it's not working.And I'm downloaded all files...

Wohlstand
Chargin' Chuck
Chargin' Chuck
Posts: 2008
Joined: Tue Feb 11, 2014 4:44 pm
Flair: [ˈvoːlˌʃtant], 狐エンジニア
Pronouns: he/him
Contact:

Re: LunaDLL - SMBX Extension Module

Postby Wohlstand » Fri Jan 02, 2015 8:57 am

Anyone98 wrote:
Wohlstand wrote:
DiamondPhoenix wrote:Well...
http://www.gamearchaeology.com is down, that means i cannot get the latest complete command reference.
Don't worry, I collected some stuff here:
http://engine.wohlnet.ru/docs/Collected/LunaDLL/
All that files must get?
No, you need only references, tutorial and build:
http://www.smbxgame.com/forums/v ... =69&t=6973
(LunaDLL and modded exe to get able run SMBX with LunaDLL)

Also you can try this expertmental thing which also add support of OGG, FLAC, MOD, XM, IT, etc. music's (and latest thing - solution of decimals bug, with this build you will never get type mismatch crash because used decimal value in the npc.txt)
http://www.smbxgame.com/forums/v ... =69&t=7427

litchh
Eerie
Eerie
Posts: 719
Joined: Sun Dec 29, 2013 6:10 am

Re: LunaDLL - SMBX Extension Module

Postby litchh » Fri Jan 09, 2015 2:27 pm

When I try to use [img]ForceFacing[/img] command I have result only for NPCs I place while playing, but not placed before test. How it works?!

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

Re: LunaDLL - SMBX Extension Module

Postby DarkShadeX » Fri Jan 09, 2015 2:29 pm

do you use #0 for that code?

litchh
Eerie
Eerie
Posts: 719
Joined: Sun Dec 29, 2013 6:10 am

Re: LunaDLL - SMBX Extension Module

Postby litchh » Fri Jan 09, 2015 2:36 pm

DarkShadeX wrote:do you use #0 for that code?
Yes, I did.

Kevsoft
Ripper II
Ripper II
Posts: 375
Joined: Sun Jul 27, 2014 8:03 am

Re: LunaDLL - SMBX Extension Module

Postby Kevsoft » Fri Jan 09, 2015 4:25 pm

You need to set the x speed of the npc to 0 to see a effect in facing.

litchh
Eerie
Eerie
Posts: 719
Joined: Sun Dec 29, 2013 6:10 am

Re: LunaDLL - SMBX Extension Module

Postby litchh » Sat Jan 10, 2015 2:00 am

Kevsoft wrote:You need to set the x speed of the npc to 0 to see a effect in facing.
It doesn't work

Code: Select all

#0
ForceFacing,89,0,0,0,0,0
#END

lighthouse64
Charged Spiny
Charged Spiny
Posts: 1804
Joined: Sat Apr 26, 2014 6:28 am

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".

Kevsoft
Ripper II
Ripper II
Posts: 375
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.

lighthouse64
Charged Spiny
Charged Spiny
Posts: 1804
Joined: Sat Apr 26, 2014 6:28 am

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?

Kevsoft
Ripper II
Ripper II
Posts: 375
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

lighthouse64
Charged Spiny
Charged Spiny
Posts: 1804
Joined: Sat Apr 26, 2014 6:28 am

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.

DiamondPhoenix
Guest

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.smbxgame.com/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.

Kevsoft
Ripper II
Ripper II
Posts: 375
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
Guest

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?

Kevsoft
Ripper II
Ripper II
Posts: 375
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
Spiny
Spiny
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.

Kevsoft
Ripper II
Ripper II
Posts: 375
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
Spiny
Spiny
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.

Kevsoft
Ripper II
Ripper II
Posts: 375
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.


Return to “Archives”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari