mario fan games galaxypge projectirc.cat.bio

happy birthday talkhaus!!!!

LunaLua Offical Thread

The second SMBX collab!

Shall I stream some LunaLua live development?

Yes
23
92%
No
2
8%
 
Total votes: 25

User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 2 years ago

Re: LunaLua Offical Thread

Postby Kevsoft » 1 year ago

A Hotfix which fixes the Autocode Module has just been uploaded!

User avatar
Sanct
I guess?
Posts: 15
Joined: 2 years ago
Pronouns: he/him/his
Location: exists

Re: LunaLua Offical Thread

Postby Sanct » 1 year ago

Does anyone have a lunalua script that can make it that if you hit a switch gravity flips and becomes upside down?

Also it'd be great if it worked for NPCs and not just for the player but that's isn't necessary.
v

User avatar
romajiQuadhash
typos "raocow" as "roacow" (and I TAS)
Posts: 12
Joined: 2 years ago
First name: Romaji Quadhash
Pronouns: ke/keh/ker
Location: ""Canada""

Re: LunaLua Offical Thread

Postby romajiQuadhash » 1 year ago

Little Boo wrote:Does anyone have a lunalua script that can make it that if you hit a switch gravity flips and becomes upside down?

Also it'd be great if it worked for NPCs and not just for the player but that's isn't necessary.
No, and knowing SMBX this is probably very, very hard
This is a sig

User avatar
Hoeloe
One of them Lua people
Posts: 826
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

romajiQuadhash wrote:
Little Boo wrote:Does anyone have a lunalua script that can make it that if you hit a switch gravity flips and becomes upside down?

Also it'd be great if it worked for NPCs and not just for the player but that's isn't necessary.
No, and knowing SMBX this is probably very, very hard
Hopefully in the near future it will be not quite so hard, though not as simple as "flip gravity backwards".

The way this would be done is in three parts:

1. Create two sections - one the right way up, one upside down.
2. When you want to flip gravity, calculate the coordinates in the other section, and transport the player and all NPCs to that section.
3. (Not currently possible) Using a post-process effect, flip the entire screen upside down.
Image
Image
Image
Image

User avatar
Sanct
I guess?
Posts: 15
Joined: 2 years ago
Pronouns: he/him/his
Location: exists

Re: LunaLua Offical Thread

Postby Sanct » 1 year ago

I guess i'll wait for the post-process thing to become possible (Hopefully soon i guess).
v

User avatar
SAJewers
A2XT Guy
Posts: 2046
Joined: 5 years ago
Location: Nova Scotia

Re: LunaLua Offical Thread

Postby SAJewers » 1 year ago

Hoeloe wrote: 3. (Not currently possible) Using a post-process effect, flip the entire screen upside down.
You should be able to fake the effect with an animated graphic, like that Super Mario Japan level. It would massively eat increase load times though, and wouldn't look as good.
DO NOT PM ME ABOUT A SECOND MARIO BROS X. THING. I WILL NOT RESPOND TO PMs.
Image
Head over to the ASMBXT Forums and join the discssion, or submit levels!
Image
Image
Image

User avatar
Sanct
I guess?
Posts: 15
Joined: 2 years ago
Pronouns: he/him/his
Location: exists

Re: LunaLua Offical Thread

Postby Sanct » 1 year ago

Well i mean also since i have low gravity in the same level, is it possible to make the NPCs also be affected by the low gravity?

also PGE lets me flip sections upside with one button so that isn't gonna be nearly as tedious as i thought it would be.
v

User avatar
Hoeloe
One of them Lua people
Posts: 826
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

Hotfix for multipoints! Somehow a persistent placeSprite had sneaked its way in there, so Lua checkpoints were causing lag and other weird behaviour. Fixed now.

http://engine.wohlnet.ru/pgewiki/Multipoints.lua

EDIT: Also slight update to raocoin2 to make text look a little neater. Would be good to have world-space text drawing as a thing in LunaLua without having to manually program it, though.
Image
Image
Image
Image

User avatar
WasabiJellyfish
Posts: 117
Joined: 2 years ago

Re: LunaLua Offical Thread

Postby WasabiJellyfish » 1 year ago




A little test for a something I'm working on, hope you guys like it.

User avatar
Hoeloe
One of them Lua people
Posts: 826
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

Wasabi pointed out that I'd done something stupid in HUD of Time, so it's patched up now and the magic bar will no longer look super weird if you change the graphic.
Image
Image
Image
Image

User avatar
Hoeloe
One of them Lua people
Posts: 826
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

Small raocoin2 update that just makes the worldToScreen function less stupid.

Edit: And another to make it even more less stupid.
Image
Image
Image
Image

User avatar
Mikkofier
A comma before dark is indefensible.
Posts: 634
Joined: 4 years ago
First name: Mikko J. Fuzzygrumbles
Pronouns: he/him/his
Location: Lots of miles from Vietnam
Contact:

Re: LunaLua Offical Thread

Postby Mikkofier » 1 year ago

I'd like to see the lunadll.lua file of a level that uses switch block saving, for learning purposes.
I never met a man so stupid I could not learn something from him.
-Galileo Galilei
Context-free Supper Mario Broth Roulette! NOTE: Potential Jumpscare warning!
Image
Avatar source (for most of them).
Image

User avatar
Hoeloe
One of them Lua people
Posts: 826
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

SAJewers pointed out yet another multipoints bug. 3.0.6 hotfix is up now that should fix it. Also updated raocoin2 to fix some sprite placements and added a per-currency onCollect event, as well as adding an "increment" variable for onCollect.
Image
Image
Image
Image

User avatar
Hoeloe
One of them Lua people
Posts: 826
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

Patch to raocoin2.lua. Pyro noted that using a P-switch counted as collecting raocoins, which is obviously incorrect. Using onNPCKill and colliders, this is now no longer the case, and raocoins can be properly collected in v2.0.6.

http://engine.wohlnet.ru/pgewiki/Raocoin2.lua

This should be added to the A2XT devkit.
Image
Image
Image
Image

User avatar
Rockythechao
Shapemorph the titlecard into the video, Hoeloe
Posts: 479
Joined: 3 years ago
First name: Michael
Pronouns: he/him/his
Location: Yes

Re: LunaLua Offical Thread

Postby Rockythechao » 1 year ago

Just added some tables for certain groups of NPCs to npcid.lua to help with a dumb side project I just started. Most of 'em are based on their current organization (NPCID.BOSSES, NPCID.FISHES, NPCID.GHOSTS, NPCID.SHROOMS, etc) but I threw in a few others for specific enemy groups and whatnot (NPCID.FOODSHROOMS, NPCID.SNIFITS, NPCID.BOMBS, NPCID.VINETOPS, etc).

There's a lot more I could probably do, like all NPCs of specific categories for specific game, but [reasons] and [excuses].

https://drive.google.com/file/d/0B-w323 ... sp=sharing
I am fairly involved in A2XT's development as a content creator, wiki contributor and programmer, but I am not the project lead nor am I responsible for half the things people keep attributing to me lol

Useful posts, discussions & resources for SMBX and A2XT

My art & audio thread
Tumblr, SoundCloud

Image

User avatar
Hoeloe
One of them Lua people
Posts: 826
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

Just wrote a bit of code that would probably be good to add to mainV2.lua.

Code: Select all

function registerCustomEvent(obj, eventName)
	local queue = {};
	local mt = getmetatable(obj);
	if(mt == nil) then
		mt = {__index = function(tbl,key) return rawget(tbl,key) end, __newindex = function(tbl,key,val) rawset(tbl,key,val) end}
	end
	local index_f = mt.__index;
	local newindex_f = mt.__newindex;
		
	mt.__index = function(tbl, key)
		if(key == eventName) then
			return function(...)
				for _,v in ipairs(queue) do
					v(...);
				end
			end
		else
			return index_f(tbl, key);
		end
	end
		
	mt.__newindex = function (tbl,key,val)
		if(key == eventName) then
			table.insert(queue, val);
		else
			newindex_f(tbl,key,val);
		end
	end
		
	setmetatable(obj,mt);
end
Essentially, this allows me to do something like this:

Code: Select all

registerCustomEvent(multipoints, "onCollected");
	registerCustomEvent(multipoints, "onLevelStart");
Which will register custom API events that can be defined in multiple places without overriding one another. So, for example, if I define:

Code: Select all

function multipoints:onCollected(id)
      windowDebug("lunaworld test");
end
inside lunaworld.lua, and:

Code: Select all

function multipoints:onCollected(id)
      windowDebug("lunadll test");
end
inside the level file's lunadll.lua, then I will get two debug windows, one for each event that was registered. Without this setup, only the lunadll.lua window would display, as it would overwrite the existing event when defining it.

This code relies on nested function calls, which shouldn't be an issue, but if you're worried about performance, I can write an alternative that uses tables instead without much issue.


On an only slightly related topic:

I'm looking into the multipoints bug where NPCs don't spawn when you load into a checkpoint. My suspicion is that SMBX is confused when warping the player because of the lack of a midpoint NPC, and is loading an unrelated set on NPCs. Now, the best way of fixing this would be to look into the warp code in SMBX and see how that sets the player location. By replicating that, I can ensure the NPCs are loaded properly.

In trying to fix this though, it's occurred to me that, though onLoad is useless 99% of the time, there are a very few occasions where it's actually useful, so, if nothing else but for the sake of consistency, can we make registerEvent work with onLoad please? At the moment APIs can't use it, and one of my attempted fixes required it.

EDIT: Also found a bug in raocoin2.lua. Should be fixed now.
Image
Image
Image
Image

User avatar
Hoeloe
One of them Lua people
Posts: 826
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

Okay, got a report that multipoints was causing some issues because of the latest patch. I've updated it now.

It seems the error was because multipoints teleports the player a frame late (to account for weirdness in the packaged game). I've not changed it so that it teleports the player on both the first and second frames, which should fix this issue. It seems to fix the the "NPCs don't spawn" error.

Also the multipoints events will now work even if you define them in multiple places. May use this in A2XT if we go with raocoins saving at checkpoints.

EDIT: Another update to multipoints, just fixes a bug where multipoints would fail if you used a hub that loaded the multipoints API.
EDIT EDIT: Turns out that fix was bogus and stupid and not necessary because there wasn't even a problem. New version fixes it.
EDIT EDIT EDIT: Turns out that multipoints didn't work with regular midpoints - if the library was loaded and only regular midpoints were used, things got a bit weird. 3.0.10 fixes that.
EDIT EDIT EDIT EDIT: Aaaand another hotfix. Multipoints 3.0.11 works with section music now. An earlier version broke that.
Image
Image
Image
Image

User avatar
Hoeloe
One of them Lua people
Posts: 826
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

So I'm working on a library called Xmem, designed to make mem calls a little less awkward.

It's still experimental at the moment, but it adds a number of new functions to NPCs and Players (these can be used just like the regular mem function, even on pnpc objects!)

NPC:memget - this gets the value at the given mem address. It is limited to the addresses on the wiki, but does not need a type argument. For example, npc:memget(0xF0) is equivalent to npc:mem(0xF0,FIELD_WORD).

Code: Select all

npc:memget(memaddress)
NPC:memset - similar to memget, but for setting variables instead of getting them. So npc:memset(0xF0,1) is equivalent to npc:mem(0xF0,FIELD_WORD,1).

Code: Select all

npc:memset(memaddress, value)
NPC:xmem - used the same way as the existing mem calls. Can be used for both getting and setting values. For example, npc:xmem(0xF0) is equivalent to npc:memget(0xF0), while npc:xmem(0xF0,1) is equivalent to npc:memset(0xF0,1).

Code: Select all

npc:xmem(memaddress, [optional]value)
There are also a couple of useful debug features:

NPC:memdump - prints the entire memory structure of the NPC to the screen. If textblox is installed, it will use it for better formatting, otherwise it will use the default font. Can be fed upper and lower limits to print only a section of the NPC memory.

Code: Select all

npc:memdump([optional]lowbound, [optional]highbound)
NPC:memlog - similar to memdump, but will write the value out to a file instead. Each new play session will generate a new log file the fire time memlog is called.

Code: Select all

npc:memlog([optional]lowbound, [optional]highbound)
These functions can also be used with players:

Code: Select all

player:memdump()
And can be used on global memory:

Code: Select all

xmem.memdump()
What do people think of this library? It's still experimental because the typing of a few values needs to be finalised, but in theory, it should help a lot with debugging.

Here's a screenshot of some "memdump" calls, with textblox active:

Image
Image
Image
Image
Image

User avatar
Ivy
Posts: 1989
Joined: 3 years ago
Contact:

Re: LunaLua Offical Thread

Postby Ivy » 1 year ago

neat!
3DS FC: 2793-0650-7690 | Switch: SW-2766-9108-9399 | Steam: ivysaur1996 (that ivy guy)
Many thanks to GlitchedGhost and Rockythechao for the amazing paper Demo animation!

User avatar
ohmato
skrrt skrrt
Posts: 789
Joined: 2 years ago
Location: location, location
Contact:

Re: LunaLua Offical Thread

Postby ohmato » 1 year ago


Image
Image
Image
Image

User avatar
Hoeloe
One of them Lua people
Posts: 826
Joined: 5 years ago
Location: Spaaace

Re: LunaLua Offical Thread

Postby Hoeloe » 1 year ago

So... I made a new library. Someone mentioned particle effects on Skype and.. well...

http://i.imgur.com/CATciUP.webm

Particles.lua can be downloaded here.
Image
Image
Image
Image

User avatar
ohmato
skrrt skrrt
Posts: 789
Joined: 2 years ago
Location: location, location
Contact:

Re: LunaLua Offical Thread

Postby ohmato » 1 year ago

I made a prototype plugin that implements the SMW camera in SMBX. You can get it here.

There are only three functions: activate/deactivate methods, and a get method for whether the camera is active. When you load the API, the camera is active by default.

As I mentioned, this is a prototype. L/R scrolling should be fairly close to the desired product, vertical camera locking is present but might need work. I'd like some feedback from people more familiar with the SMW feel to improve it. Some details might be iffy given how wildly different SMBX and SMW are in some places.
Image
Image
Image
Image

User avatar
ohmato
skrrt skrrt
Posts: 789
Joined: 2 years ago
Location: location, location
Contact:

Re: LunaLua Offical Thread

Postby ohmato » 1 year ago

SMW camera update. Tweaked vertical snapping, added U/D panning when you hold up or down.

L/R button panning soon to come, maybe.

Edit: Fixed how warping affects camera panning.
Edit 2: Fixed camera panning on slopes and when standing on NPCs.
Image
Image
Image
Image

User avatar
Rockythechao
Shapemorph the titlecard into the video, Hoeloe
Posts: 479
Joined: 3 years ago
First name: Michael
Pronouns: he/him/his
Location: Yes

Re: LunaLua Offical Thread

Postby Rockythechao » 1 year ago

Who here would be interested in contributing a level for the new cinematX sample episode in the coming months?
More info here.
I am fairly involved in A2XT's development as a content creator, wiki contributor and programmer, but I am not the project lead nor am I responsible for half the things people keep attributing to me lol

Useful posts, discussions & resources for SMBX and A2XT

My art & audio thread
Tumblr, SoundCloud

Image

User avatar
ohmato
skrrt skrrt
Posts: 789
Joined: 2 years ago
Location: location, location
Contact:

Re: LunaLua Offical Thread

Postby ohmato » 1 year ago

New SMW camera update here. Added horizontal panning, like when you press the L or R buttons in the actual game.

To pan left or right, hold the tanooki/alt run button and double tap left or right.
Image
Image
Image
Image


Return to “A2XT”

Who is online

Users browsing this forum: No registered users and 2 guests

cron