LunaLua Offical Thread

The second SMBX collab!
Post Reply

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: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Kevsoft »

LunaLua v0.2.7.1 is out
Changes:
* Fixed a bug where onLoadSection/onLoopSection doesn't work on lunaworld.lua. They now have the player-id as parameter. Please note when using it in the 2-player-mode this is called twice. (Once for player 1 and once for player 2)
* Added the missing consturctor for RECT and RECTd called ("newRECT()" and "newRECTd()")
NOTE: The documentary is not updated yet, because I am still working on moving the whole documetary to the wiki.
Darkchaox100
Posts: 0
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Darkchaox100 »

Hoeloe wrote:
Darkchaox100 wrote:
Hoeloe wrote:...
I mean if the text has finished drawing,then you are able to press x,and not while its still typing.
Yeah, that's what that does. It will prevent text from progressing unless it's finished typing.
But you can still skip the whole typing if you press X.What i basicaly want is that you can only press X if the last letter has been drawn.Your code doesnt quite work yet.
User avatar
Hoeloe
A2XT person
Posts: 962
Joined: 11 years ago
Pronouns: she/her
Location: Spaaace

Re: Presenting: Lunadll for Lua!

Post by Hoeloe »

Darkchaox100 wrote: But you can still skip the whole typing if you press X.What i basicaly want is that you can only press X if the last letter has been drawn.Your code doesnt quite work yet.
It shouldn't be particularly hard to work out how to do that. If you look at the code I posted again, you'll see that what it's doing is first checking if the X key is pressed while a cutscene is playing:

Code: Select all

		if(keycode == KEY_X  and  cinematX.dialogEndWithInput == true  and  (cinematX.dialogOn  or  cinematX.dialogSpeakerTime > 0)) then
And then does another check, to see if the text has finished drawing:

Code: Select all

                       if(cinematX.dialogNumCharsCurrent < string.len (cinematX.dialogTextFull)) then
The following line is then what should happen under these circumstances (that is, X key is pressed and the typewriter hasn't yet finished):

Code: Select all

  cinematX.dialogNumCharsCurrent = string.len(cinematX.dialogTextFull;
Which sets the current position of the typewriter to the end, skipping the typewriter effect (most game text systems work like this)

Then, you'll see an "else" clause - this contains events that should happen whenever the last condition is not met. In this case, we are still looking at when the X key is pressed, but now we're looking for the events when the typewriter effect has actually finished:

Code: Select all

 else
			 playSFX(23) -- 10 = skid, 14 = coin, 23 = shckwup
			 cinematX.endDialogLine()
These few lines are what progresses the text. So, in simpler terms, we have this structure:

Code: Select all

 
if x key is down then
    if typewriter is not finished then
        finish typewriter
    else
        progress text
    end
end
What you want is this structure, if I understand correctly:

Code: Select all

if x key is down then
    if typewriter is finished then
        progress text
    end
end
So, there are a few steps to get this. First of all, let's get rid of the bit that skips the typewriter:

Code: Select all

	function cinematX.onKeyDown (keycode)
		-- Skip dialog if allowed
		if(keycode == KEY_X  and  cinematX.dialogEndWithInput == true  and  (cinematX.dialogOn  or  cinematX.dialogSpeakerTime > 0)) then
                       if(cinematX.dialogNumCharsCurrent < string.len (cinematX.dialogTextFull)) then

                       else
			 playSFX(23) -- 10 = skid, 14 = coin, 23 = shckwup
			 cinematX.endDialogLine()
                       end
		end
	end
Now we have an empty condition clause, which is terrible. Instead, let's just invert the condition and move the else back to the front. The condition checks if one value is smaller than the other, so the opposite of that is checking if that value is greater than or equal to the other, like so:

Code: Select all

	function cinematX.onKeyDown (keycode)
		-- Skip dialog if allowed
		if(keycode == KEY_X  and  cinematX.dialogEndWithInput == true  and  (cinematX.dialogOn  or  cinematX.dialogSpeakerTime > 0)) then
                       if(cinematX.dialogNumCharsCurrent >= string.len (cinematX.dialogTextFull)) then
			 playSFX(23) -- 10 = skid, 14 = coin, 23 = shckwup
			 cinematX.endDialogLine()
                       end
		end
	end
That will now work and do what you want, but we can go one better. Now there are two conditionals that start and end immediately after another. Previously, the second condition was there because we wanted the first condition to be true regardless (the "you pressed x condition"), but that's not the case any more. Instead, we can use the "and" operator to combine them together. This is neater and more performance friendly:

Code: Select all

	function cinematX.onKeyDown (keycode)
		-- Skip dialog if allowed
		if(keycode == KEY_X  and  cinematX.dialogEndWithInput == true  and  (cinematX.dialogOn  or  cinematX.dialogSpeakerTime > 0) and cinematX.dialogNumCharsCurrent >= string.len (cinematX.dialogTextFull)) then
			 playSFX(23) -- 10 = skid, 14 = coin, 23 = shckwup
			 cinematX.endDialogLine()
		end
	end
And there is the final code, which has this structure:

Code: Select all

if x key is down and typewriter is finished then
        progress text
end
Hopefully you can see how I got there, and why it works. I strongly recommend you read through this post and try to understand what I've done. It will help you a lot in the long run.
Image
Image
Image
Image
Image
Darkchaox100
Posts: 0
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Darkchaox100 »

Thats just what i needed! Thank you.
User avatar
Hoeloe
A2XT person
Posts: 962
Joined: 11 years ago
Pronouns: she/her
Location: Spaaace

Re: Presenting: Lunadll for Lua!

Post by Hoeloe »

Want to add that the new documentation for "placeSprite" is still completely useless. What does "type" do? What do the other arguments do, for that matter. You only address the resource number and position, which is a total of 3 of a potential 6 arguments.
Image
Image
Image
Image
Image
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Kevsoft »

As I already said, I am still working on this getting a decent documentary together. If you need the arguments for all of them you just need to ask kil. I only ported it from Autocode to Lua without getting to actual context. Or in other words: I didn't test it. I just copied the arguments Kil was given to me.
User avatar
Hoeloe
A2XT person
Posts: 962
Joined: 11 years ago
Pronouns: she/her
Location: Spaaace

Re: Presenting: Lunadll for Lua!

Post by Hoeloe »

Kevsoft wrote:As I already said, I am still working on this getting a decent documentary together. If you need the arguments for all of them you just need to ask kil. I only ported it from Autocode to Lua without getting to actual context. Or in other words: I didn't test it. I just copied the arguments Kil was given to me.
Right, okay. I only point it out because I'm having trouble with placeSprite, as it's placing the sprites on the scene permanently, which is awkward if I want them to move (it causes a big ugly trail).
Image
Image
Image
Image
Image
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Kevsoft »

Small update to v0.2.7.2

I just made some crash fixes. It shouldn't crash after a error message display anymore. I did made some test with error spamming, and it did crash. But as long you don't overreact with errors, it should be all fine ;)
Rixithechao
https://www.youtube.com/watch?v=IwLdM6ejGAM
Posts: 1608
Joined: 8 years ago
First name: Mack
https://rixithechao.talkhaus.com/

Re: Presenting: Lunadll for Lua!

Post by Rixithechao »

I can fill in some details, but I can't sign up to the wiki and I don't know if you're ready for others to contribute just yet (haven't checked since yesterday, gonna do that now.)
Delightful Adventure Enhanced is out now!

Image

There's an official ASMT Discord server! Check it out to follow and/or contribute to A2XT Episode 2's development! thread, invite link

(Entry requires verification, either with a connected Youtube/Twitter/Twitch/etc account or manually by the server staff.)


Itch.io (albums and eventually games), Youtube (dofur pass and I guess other videos)
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Kevsoft »

Make a account here. It is bound to the wiki.
User avatar
Hoeloe
A2XT person
Posts: 962
Joined: 11 years ago
Pronouns: she/her
Location: Spaaace

Re: Presenting: Lunadll for Lua!

Post by Hoeloe »

I'm having real trouble with the UserData commands. UserData.isValueSet doesn't seem to work. It always returns false during onLoad, which, annoyingly, is when it's most often useful.
Image
Image
Image
Image
Image
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Kevsoft »

I see the point. It is because the lua code is loaded before the var-bank is loaded, which result that this API is useless. I just shifted the load code after the var-bank load code and if it is fine I will release it.
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Kevsoft »

Small update to v0.2.7.3

By request by Hoeloe I've moved the lua code, so the userbank is loaded before the onLoad-code. I also tested it... it works!
User avatar
Hoeloe
A2XT person
Posts: 962
Joined: 11 years ago
Pronouns: she/her
Location: Spaaace

Re: Presenting: Lunadll for Lua!

Post by Hoeloe »

I made a shop library! I posted it in the theme/town thread, but I'll put it here, too:

https://dl.dropboxusercontent.com/u/308 ... ibrary.zip

It still uses the old version of LunaLua, because I didn't update to the latest one while I was developing it, but it should still work fine.
Image
Image
Image
Image
Image
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Kevsoft »

I am currently working on a custom API-Enviroment, so all events are running independetly for each loaded API. I try to make the usage of custom APIs easier. If I get the first draft out, I will let you guys know.
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Kevsoft »

Small update about the upcoming LunaLua version.

With the new version you can write APIs running parallel to the main code file.
For example here I have 'framecounter.lua' (which counts the frames).

Code: Select all

local framecounter = {}
local myCounter = 0


function framecounter.onInitAPI()
	--init vars
	myCounter = 0
	--register event handler
	--registerEvent(string apiName, string internalEventName, string functionToCall, boolean callBeforeMain)
	registerEvent("framecounter", "onLoop", "onCountFrame", true)
end

function framecounter.onCountFrame()
	myCounter = myCounter + 1
end

function framecounter.getCurrentFrame()
	return myCounter
end

return framecounter
with the registerEvent-function I can handle specific events before or after the event is executed by the main file.

And in the main code file I just write:

Code: Select all

function onLoad()
	--Load API
	loadAPI("framecounter")
end

function onLoop()
	printText("Current Frame: "..tostring(framecounter.getCurrentFrame()), 30, 220)	
end
The loadAPI-function is based on the require function, but in addition does add the api to the event-table and makes the registerEvent-function possible.

Also the new shared API folder is located in "{Main Game Path}/LuaScriptsLib/" containing all API files. Like: "{Main Game Path}/LuaScriptsLib/framecounter.lua"
The main host-lua file will be located in "{Main Game Path}/LuaScriptsLib/main.lua" and is required to run LunaLua.

Note that this isn't released yet. I still have to tweak a bit on that, but what do you think, guys?
Any suggestions to that?
Rixithechao
https://www.youtube.com/watch?v=IwLdM6ejGAM
Posts: 1608
Joined: 8 years ago
First name: Mack
https://rixithechao.talkhaus.com/

Re: Presenting: Lunadll for Lua!

Post by Rixithechao »

Oooh, nice timing, I was just about to ask! (began writing this post like a couple hours ago...)

Sounds good for the most part. The only things I can think to add would be registerEventBefore and registerEventAfter functions for readability. But that's just nitpicking, really.
Delightful Adventure Enhanced is out now!

Image

There's an official ASMT Discord server! Check it out to follow and/or contribute to A2XT Episode 2's development! thread, invite link

(Entry requires verification, either with a connected Youtube/Twitter/Twitch/etc account or manually by the server staff.)


Itch.io (albums and eventually games), Youtube (dofur pass and I guess other videos)
User avatar
Hoeloe
A2XT person
Posts: 962
Joined: 11 years ago
Pronouns: she/her
Location: Spaaace

Re: Presenting: Lunadll for Lua!

Post by Hoeloe »

It should be warned that this is not suitable for all APIs (if it is what I think it is). Parallel processing can be very awkward, so if you need a lot of communication aside from just updating, then it might be best to avoid it.
Image
Image
Image
Image
Image
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Kevsoft »

Of course it isn't directly "parallel".

The event loop is going like that:
  • Lunadll passes the event to main.lua
  • main.lua checks for APIs registered the given event before the main event function and calls them
  • Now the main event function is called
  • main.lua checks for APIs registered the given event after the main event function and calls them
  • Do the same things with the other events.
So you see, simple methods can be then used parallel. I mean you would save (now at framecounter) the function framecounter.update() in onLoop in the main code file.
Rockythechao wrote:Oooh, nice timing, I was just about to ask! (began writing this post like a couple hours ago...)

Sounds good for the most part. The only things I can think to add would be registerEventBefore and registerEventAfter functions for readability. But that's just nitpicking, really.
Good point, actually it would clean up the arguments a bit. I probably take over that.

Anyways, I also implemented a stack trace for errors. Can be useful at some point.
User avatar
Hoeloe
A2XT person
Posts: 962
Joined: 11 years ago
Pronouns: she/her
Location: Spaaace

Re: Presenting: Lunadll for Lua!

Post by Hoeloe »

Kevsoft wrote:Of course it isn't directly "parallel".
Ah, I see. That makes a lot more sense and is super useful! Can I ask, though, is there a way to determine (or define) the order in which the APIs will be run, with respect to the main thread and the other APIs? It could potentially be important to be able to tweak this.
Image
Image
Image
Image
Image
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Kevsoft »

Well like I already you can register your function before or after the main call. The api calls are orderd like the registeration order. So if the api is the first, which register its functions it gets the first event call in the event loop.
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Kevsoft »

Big update to v0.3.

Basically this update adds the new "Custom API"-Support. The wiki is already up to date with all necessary data.
I would love to see cinematX working with this new API. It makes probably some tasks for the user way easier. Also I would like to add it as a offical API when it is working together properly.
User avatar
Hoeloe
A2XT person
Posts: 962
Joined: 11 years ago
Pronouns: she/her
Location: Spaaace

Re: Presenting: Lunadll for Lua!

Post by Hoeloe »

Kevsoft wrote:Big update to v0.3.

Basically this update adds the new "Custom API"-Support. The wiki is already up to date with all necessary data.
I would love to see cinematX working with this new API. It makes probably some tasks for the user way easier. Also I would like to add it as a offical API when it is working together properly.
I'll update my trigger and shop APIs with it too, when I get the chance.
Image
Image
Image
Image
Image
Rixithechao
https://www.youtube.com/watch?v=IwLdM6ejGAM
Posts: 1608
Joined: 8 years ago
First name: Mack
https://rixithechao.talkhaus.com/

Re: Presenting: Lunadll for Lua!

Post by Rixithechao »

Today is officially an awesome day.
I'll have cinematX working with the new API system sometime this weekend. For now, I finally have all of the NPC constants ready to copy & paste into LunaLuaMain.cpp.
// BOSSES
_G["NPCID_BOWSER_SMB"] = 200
_G["NPCID_BOWSER_SMB3"] = 86
_G["NPCID_BOOMBOOM"] = 15
_G["NPCID_LARRY"] = 267
_G["NPCID_LARRYSHELL"] = 269
_G["NPCID_LUDWIG"] =236
_G["NPCID_LUDWIGSHELL"] = 281
_G["NPCID_BIRDO"] = 39
_G["NPCID_WART"] = 201
_G["NPCID_MOUSER"] = 262
_G["NPCID_BOSSGLASS"] = 208
_G["NPCID_MOTHERBRAIN"] = 209


// PLATFORMS & VEHICLES
_G["NPCID_PLATFORM_SMB"] = 106
_G["NPCID_PLATFORM_SMB3"] = 104
_G["NPCID_CONVEYER"] = 57
_G["NPCID_YELBLOCKS"] = 60
_G["NPCID_BLUBLOCKS"] = 62
_G["NPCID_GRNBLOCKS"] = 64
_G["NPCID_REDBLOCKS"] = 66
_G["NPCID_CHECKERPLATFORM"] = 105
_G["NPCID_SKULL"] =190
_G["NPCID_REDDONUT"] = 46
_G["NPCID_BLUDONUT"] = 212
_G["NPCID_CLOWNCAR"] = 56
_G["NPCID_COCKPIT"] = 290


// TANK/AIRSHIP PIECES
_G["NPCID_ROCKETWOOD"] = 160
_G["NPCID_TANKTREADS"] = 78
_G["NPCID_METALBARREL"] = 58
_G["NPCID_VPIPE_SHORT"] = 69
_G["NPCID_VPIPE_LONG"] = 70
_G["NPCID_SLANTWOOD_L"] = 81
_G["NPCID_SLANTWOOD_M"] = 83
_G["NPCID_SLANTWOOD_R"] = 82
_G["NPCID_HPIPE_SHORT"] = 67
_G["NPCID_HPIPE_LONG"] = 68
_G["NPCID_LONGWOOD"] = 80
_G["NPCID_SHORTWOOD"] = 79


// VINES
_G["NPCID_BLUVINE"] = 217
_G["NPCID_BLUVINEBOTTOM"] = 220
_G["NPCID_YELVINE"] = 216
_G["NPCID_YELVINEBOTTOM"] = 219
_G["NPCID_GRNVINE_SMB"] = 222
_G["NPCID_GRNVINE_SMB2"] = 215
_G["NPCID_GRNVINE_SMB3"] = 213
_G["NPCID_GRNVINE_SMW"] =224
_G["NPCID_GRNVINETOP_SMB"] = 223
_G["NPCID_GRNVINETOP_SMB3"] = 226
_G["NPCID_GRNVINETOP_SMW"] =227
_G["NPCID_GRNVINEBOTTOM"] = 218
_G["NPCID_REDVINE_SMB3"] = 214
_G["NPCID_REDVINETOP_SMB3"] = 225


// COINS
_G["NPCID_COIN_SMB"] = 88
_G["NPCID_COIN_SMB2"] = 138
_G["NPCID_COIN_SMB3"] = 10
_G["NPCID_COIN_SMW"] = 33
_G["NPCID_REDCOIN"] = 207
_G["NPCID_BLUECOIN"] = 258
_G["NPCID_DRAGONCOIN"] =274


// MUSHROOMS
_G["NPCID_SHROOM_SMB"] = 184
_G["NPCID_SHROOM_SMB2"] = 249
_G["NPCID_SHROOM_SMB3"] = 9
_G["NPCID_SHROOM_SMW"] = 185
_G["NPCID_SHROOMBLOCK_A"] = 154
_G["NPCID_SHROOMBLOCK_B"] = 155
_G["NPCID_SHROOMBLOCK_C"] = 156
_G["NPCID_SHROOMBLOCK_D"] = 157
_G["NPCID_QSHROOM"] = 263
_G["NPCID_PSHROOM"] = 159


// FLOWERS
_G["NPCID_FIREFLOWER_SMB"] = 182
_G["NPCID_FIREFLOWER_SMB3"] = 14
_G["NPCID_FIREFLOWER_SMW"] = 183
_G["NPCID_ICEFLOWER_SMB3"] = 264
_G["NPCID_ICEFLOWER_SMW"] =277


// OTHER POWERUPS
_G["NPCID_LEAF"] = 34
_G["NPCID_TANOOKISUIT"] = 169
_G["NPCID_HAMMERSUIT"] = 170
_G["NPCID_RANDOMPOWERUP"] = 287


// LIVES
_G["NPCID_1UP_SMB"] = 186
_G["NPCID_1UP_SMB3"] = 90
_G["NPCID_1UP_SMW"] = 187
_G["NPCID_3UP"] = 188


// SHELLS
_G["NPCID_BIGSHELL"] = 73
_G["NPCID_GRNSHELL_SMB"] = 172
_G["NPCID_GRNSHELL_SMB3"] = 5
_G["NPCID_GRNSHELL_SMW"] = 113
_G["NPCID_REDSHELL_SMB"] = 174
_G["NPCID_REDSHELL_SMB3"] = 7
_G["NPCID_REDSHELL_SMW"] = 114
_G["NPCID_BLUSHELL"] = 115
_G["NPCID_YELSHELL"] = 116
_G["NPCID_BUZZYSHELL"] = 24
_G["NPCID_DISCOSHELL"] = 194
_G["NPCID_FLIPPEDDISCO"] = 195


// OTHER ITEMS
_G["NPCID_BOMB"] = 134
_G["NPCID_POW"] = 241
_G["NPCID_TIMER_SMB2"] = 240
_G["NPCID_TIMER_SMB3"] = 248
_G["NPCID_POTION"] = 288
_G["NPCID_GRNBOOT"] = 35
_G["NPCID_REDBOOT"] = 191
_G["NPCID_BLUBOOT"] = 193
_G["NPCID_YOSHIEGG"] = 96
_G["NPCID_PROPELLERBLOCK"] =278
_G["NPCID_SPRING"] = 26
_G["NPCID_PIRHANAITEM"] = 49
_G["NPCID_THROWBLOCK"] = 45
_G["NPCID_RING_MISC"] = 152
_G["NPCID_HEART"] = 250
_G["NPCID_BLURUPEE"] = 252
_G["NPCID_GRNRUPEE"] = 251
_G["NPCID_REDRUPEE"] = 253
_G["NPCID_SATURN"] = 158
_G["NPCID_AMULET"] = 254
_G["NPCID_CANNONITEM"] = 22
_G["NPCID_PROPELLERCANNON"] =279


// DOORS
_G["NPCID_POTIONDOOR"] = 289
_G["NPCID_LOCKDOOR"] = 255


// PARATROOPAS
_G["NPCID_GRNPARA_SMB"] = 176
_G["NPCID_GRNPARA_SMB3"] = 76
_G["NPCID_GRNPARA_SMW"] = 121
_G["NPCID_REDPARA_SMB"] = 177
_G["NPCID_REDPARA_SMB3"] = 161
_G["NPCID_REDPARA_SMW"] = 122
_G["NPCID_BLUPARA"] = 123
_G["NPCID_YELPARA"] = 124


// KOOPA TROOPAS
_G["NPCID_GRNTROOPA_SMB"] = 173
_G["NPCID_GRNTROOPA_SMB3"] = 4
_G["NPCID_GRNTROOPA_SMW"] = 109
_G["NPCID_REDTROOPA_SMB"] = 175
_G["NPCID_REDTROOPA_SMB3"] = 6
_G["NPCID_REDTROOPA_SMW"] = 110
_G["NPCID_BLUTROOPA"] = 111
_G["NPCID_YELTROOPA"] = 112
_G["NPCID_BIGTROOPA"] = 72


// SHELL-LESS KOOPAS
_G["NPCID_GRNKOOPA"] = 117
_G["NPCID_REDKOOPA"] = 118
_G["NPCID_BLUKOOPA"] = 119
_G["NPCID_YELKOOPA"] = 120
_G["NPCID_EXTKOOPA"] = 55


// GOOMBAS
_G["NPCID_GOOMBA_SMB"] = 89
_G["NPCID_GOOMBA_SMB3"] = 1
_G["NPCID_GOOMBA_SMW"] = 165
_G["NPCID_GOOMBA_SMW_HELD"] = 166
_G["NPCID_GOOMBA_MISC"] = 242
_G["NPCID_PARAGOOMBA_SMB3"] = 244
_G["NPCID_PARAGOOMBA_SMW"] = 167
_G["NPCID_PARAGOOMBA_MISC"] = 243
_G["NPCID_REDGOOMBA"] = 2
_G["NPCID_REDPARAGOOMBA"] = 3
_G["NPCID_UNDERGOOMBA"] = 27
_G["NPCID_BIGGOOMBA"] = 71


// PIRHANA PLANTS
_G["NPCID_PIRHANAHEAD"] = 270
_G["NPCID_PIRHANA_SMB"] = 93
_G["NPCID_PIRHANA_SMB3"] = 8
_G["NPCID_BLUPIRHANA"] = 50
_G["NPCID_BIGPIRHANA"] = 74
_G["NPCID_SIDEPIRHANA"] = 52
_G["NPCID_BOTTOMPIRHANA"] = 51
_G["NPCID_FIREPIRHANA"] = 245
_G["NPCID_LONGPIRHANA_UP"] = 256
_G["NPCID_LONGPIRHANA_DOWN"] = 257


// THWOMPS
_G["NPCID_THWOMP_SMB3"] = 37
_G["NPCID_THWOMP_SMW"] = 180


// FISH
_G["NPCID_BLOOPER"] = 235
_G["NPCID_REDCHEEP"] = 233
_G["NPCID_GRNCHEEP"] = 28
_G["NPCID_SMWCHEEP"] =236
_G["NPCID_BONEFISH"] =234
_G["NPCID_GOGGLEFISH"] =232


// GHOSTS
_G["NPCID_BIGBOO"] = 44
_G["NPCID_BOO_SMW"] = 43
_G["NPCID_BOO_SMB3"] = 38
_G["NPCID_EERIE"] = 42


// BOB-OMBS
_G["NPCID_BOBOMB_SMB2"] = 135
_G["NPCID_BOBOMB_SMB3"] = 136
_G["NPCID_ACTIVEBOBOMB_SMB3"] = 137


// BEETLES
_G["NPCID_SPIKEBEETLE"] = 207
_G["NPCID_BUZZYBEETLE"] = 23
_G["NPCID_SPINY_SMB3"] = 36
_G["NPCID_SPINY_SMW"] = 286
_G["NPCID_SPINYBALL_SMB3"] = 48
_G["NPCID_SPINYBALL_SMW"] = 286


// CANNON-RELATED ENEMIES
_G["NPCID_CANNONENEMY"] = 21
_G["NPCID_CANNONBALL"] = 133
_G["NPCID_BULLET_SMB3"] = 17
_G["NPCID_BULLET_SMW"] = 18


// LAKITU
_G["NPCID_LAKITU_SMB3"] = 47
_G["NPCID_LAKITU_SMW"] = 284


// OTHER ENEMIES
_G["NPCID_HAMBRO"] = 29
_G["NPCID_REDSHYGUY"] = 20
_G["NPCID_BLUSHYGUY"] = 19
_G["NPCID_NINJI_SMB2"] = 25
_G["NPCID_NINJI_SMW"] = 77
_G["NPCID_TWEETER"] = 129
_G["NPCID_BLUSNIFIT"] = 131
_G["NPCID_REDSNIFIT"] = 130
_G["NPCID_GRYSNIFIT"] = 132
_G["NPCID_SPARK"] = 206
_G["NPCID_POKEY"] = 247
_G["NPCID_HOOPSTER"] = 272
_G["NPCID_CRAB"] = 53
_G["NPCID_FLY"] = 54
_G["NPCID_REX_A"] = 162
_G["NPCID_REX_B"] = 163
_G["NPCID_BIGMOLE"] = 164
_G["NPCID_SAW"] = 179
_G["NPCID_DRYBONES"] = 189
_G["NPCID_BLARGG"] = 199
_G["NPCID_LAVALOTUS"] = 275
_G["NPCID_BAT"] = 271
_G["NPCID_PODOBOO"] = 12
_G["NPCID_MUNCHER"] = 261
_G["NPCID_SLIME_A"] = 127
_G["NPCID_SLIME_B"] = 126
_G["NPCID_SLIME_C"] = 128
_G["NPCID_KNIGHT"] = 125
_G["NPCID_METROID_A"] = 203
_G["NPCID_METROID_B"] = 204
_G["NPCID_METROID_C"] = 205
_G["NPCID_BULLY"] = 168


// HAZARDS
_G["NPCID_FIREBAR"] = 260
_G["NPCID_RINKAGEN"] = 211
_G["NPCID_STATUE_SMB3"] = 84
_G["NPCID_STATUE_SMW"] = 181
_G["NPCID_ROTODISK"] = 259


// YOSHIS
_G["NPCID_YOSHI_GREEN"] = 95
_G["NPCID_YOSHI_BLUE"] = 98
_G["NPCID_YOSHI_YELLOW"] = 99
_G["NPCID_YOSHI_RED"] = 100
_G["NPCID_YOSHI_BLACK"] = 148
_G["NPCID_YOSHI_PURPLE"] = 149
_G["NPCID_YOSHI_PINK"] = 150
_G["NPCID_YOSHI_CYAN"] = 228


// ALLIES
_G["NPCID_TOAD_A"] = 75
_G["NPCID_TOAD_B"] = 94
_G["NPCID_PRINCESS"] = 198
_G["NPCID_LUIGI"] = 101
_G["NPCID_LINK"] = 102
_G["NPCID_PINKBOBOMB"] = 107


// SWITCHES
_G["NPCID_PSWITCH_SMB3"] = 238
_G["NPCID_PSWITCH_SMW"] =32
_G["NPCID_TNT"] = 239
_G["NPCID_AXE"] = 178
_G["NPCID_YELSWITCHGOOMBA"] = 59
_G["NPCID_BLUSWITCHGOOMBA"] = 61
_G["NPCID_GRNSWITCHGOOMBA"] = 63
_G["NPCID_REDSWITCHGOOMBA"] = 65


// GOALS
_G["NPCID_CHECKPOINT"] =192
_G["NPCID_KEY"] =31
_G["NPCID_GOALTAPE"] =197
_G["NPCID_GOALORB_SMB2"] = 41
_G["NPCID_GOALORB_SMB3"] = 16
_G["NPCID_ITEMGOAL"] = 11
_G["NPCID_STAR_SMW"] =196
_G["NPCID_STAR_SMB3"] = 97


// OTHER
_G["NPCID_SIGN"] =151


// MISC PROJECTILES
// "Lakitus are throwing Lakitus" NPCs
_G["NPCID_PLAYERFIREBALL"] = 13
_G["NPCID_PLAYERICEBALL"] = 235
_G["NPCID_SWORDBEAM"] = 266
_G["NPCID_PLAYERHAMMER"] = 171
_G["NPCID_PEACHBOMB"] = 291
_G["NPCID_BOOMERANG"] = 292
_G["NPCID_ICEBLOCK"] = 237
_G["NPCID_YOSHIFIRE"] = 108
_G["NPCID_STATIC"] = 263
_G["NPCID_BIRDOEGG"] = 40
_G["NPCID_BUBBLE"] = 283
_G["NPCID_BURIEDPLANT"] = 91
_G["NPCID_QUICKSAND"] = 159
_G["NPCID_EXT_FIRE_A"] = 87
_G["NPCID_EXT_FIRE_B"] = 85
_G["NPCID_EXT_FIRE_C"] = 282
_G["NPCID_EXT_FIRE_D"] = 246
_G["NPCID_EXT_FIRE_E"] = 276
_G["NPCID_RINKA"] = 210
_G["NPCID_RING_EXT"] = 269
_G["NPCID_WARTBUBBLE"] = 202
_G["NPCID_ENEMYHAMMER"] = 30
And here's just the constant names for the documentation (could probably just go in a separate page like the player raw variables):
// BOSSES
NPCID_BOWSER_SMB
NPCID_BOWSER_SMB3
NPCID_BOOMBOOM
NPCID_LARRY
NPCID_LARRYSHELL
NPCID_LUDWIG
NPCID_LUDWIGSHELL
NPCID_BIRDO
NPCID_WART
NPCID_MOUSER
NPCID_BOSSGLASS
NPCID_MOTHERBRAIN


// PLATFORMS & VEHICLES
NPCID_PLATFORM_SMB
NPCID_PLATFORM_SMB3
NPCID_CONVEYER
NPCID_YELBLOCKS
NPCID_BLUBLOCKS
NPCID_GRNBLOCKS
NPCID_REDBLOCKS
NPCID_CHECKERPLATFORM
NPCID_SKULL
NPCID_REDDONUT
NPCID_BLUDONUT
NPCID_CLOWNCAR
NPCID_COCKPIT


// TANK/AIRSHIP PIECES
NPCID_ROCKETWOOD
NPCID_TANKTREADS
NPCID_METALBARREL
NPCID_VPIPE_SHORT
NPCID_VPIPE_LONG
NPCID_SLANTWOOD_L
NPCID_SLANTWOOD_M
NPCID_SLANTWOOD_R
NPCID_HPIPE_SHORT
NPCID_HPIPE_LONG
NPCID_LONGWOOD
NPCID_SHORTWOOD


// VINES
NPCID_BLUVINE
NPCID_BLUVINEBOTTOM
NPCID_YELVINE
NPCID_YELVINEBOTTOM
NPCID_GRNVINE_SMB
NPCID_GRNVINE_SMB2
NPCID_GRNVINE_SMB3
NPCID_GRNVINE_SMW
NPCID_GRNVINETOP_SMB
NPCID_GRNVINETOP_SMB3
NPCID_GRNVINETOP_SMW
NPCID_GRNVINEBOTTOM
NPCID_REDVINE_SMB3
NPCID_REDVINETOP_SMB3


// COINS
NPCID_COIN_SMB
NPCID_COIN_SMB2
NPCID_COIN_SMB3
NPCID_COIN_SMW
NPCID_REDCOIN
NPCID_BLUECOIN
NPCID_DRAGONCOIN


// MUSHROOMS
NPCID_SHROOM_SMB
NPCID_SHROOM_SMB2
NPCID_SHROOM_SMB3
NPCID_SHROOM_SMW
NPCID_SHROOMBLOCK_A
NPCID_SHROOMBLOCK_B
NPCID_SHROOMBLOCK_C
NPCID_SHROOMBLOCK_D
NPCID_QSHROOM
NPCID_PSHROOM


// FLOWERS
NPCID_FIREFLOWER_SMB
NPCID_FIREFLOWER_SMB3
NPCID_FIREFLOWER_SMW
NPCID_ICEFLOWER_SMB3
NPCID_ICEFLOWER_SMW


// OTHER POWERUPS
NPCID_LEAF
NPCID_TANOOKISUIT
NPCID_HAMMERSUIT
NPCID_RANDOMPOWERUP


// LIVES
NPCID_1UP_SMB
NPCID_1UP_SMB3
NPCID_1UP_SMW
NPCID_3UP


// SHELLS
NPCID_BIGSHELL
NPCID_GRNSHELL_SMB
NPCID_GRNSHELL_SMB3
NPCID_GRNSHELL_SMW
NPCID_REDSHELL_SMB
NPCID_REDSHELL_SMB3
NPCID_REDSHELL_SMW
NPCID_BLUSHELL
NPCID_YELSHELL
NPCID_BUZZYSHELL
NPCID_DISCOSHELL
NPCID_FLIPPEDDISCO


// OTHER ITEMS
NPCID_BOMB
NPCID_POW
NPCID_TIMER_SMB2
NPCID_TIMER_SMB3
NPCID_POTION
NPCID_GRNBOOT
NPCID_REDBOOT
NPCID_BLUBOOT
NPCID_YOSHIEGG
NPCID_PROPELLERBLOCK
NPCID_SPRING
NPCID_PIRHANAITEM
NPCID_THROWBLOCK
NPCID_RING_MISC
NPCID_HEART
NPCID_BLURUPEE
NPCID_GRNRUPEE
NPCID_REDRUPEE
NPCID_SATURN
NPCID_AMULET
NPCID_CANNONITEM
NPCID_PROPELLERCANNON


// DOORS
NPCID_POTIONDOOR
NPCID_LOCKDOOR


// PARATROOPAS
NPCID_GRNPARA_SMB
NPCID_GRNPARA_SMB3
NPCID_GRNPARA_SMW
NPCID_REDPARA_SMB
NPCID_REDPARA_SMB3
NPCID_REDPARA_SMW
NPCID_BLUPARA
NPCID_YELPARA


// KOOPA TROOPAS
NPCID_GRNTROOPA_SMB
NPCID_GRNTROOPA_SMB3
NPCID_GRNTROOPA_SMW
NPCID_REDTROOPA_SMB
NPCID_REDTROOPA_SMB3
NPCID_REDTROOPA_SMW
NPCID_BLUTROOPA
NPCID_YELTROOPA
NPCID_BIGTROOPA


// SHELL-LESS KOOPAS
NPCID_GRNKOOPA
NPCID_REDKOOPA
NPCID_BLUKOOPA
NPCID_YELKOOPA
NPCID_EXTKOOPA


// GOOMBAS
NPCID_GOOMBA_SMB
NPCID_GOOMBA_SMB3
NPCID_GOOMBA_SMW
NPCID_GOOMBA_SMW_HELD
NPCID_GOOMBA_MISC
NPCID_PARAGOOMBA_SMB3
NPCID_PARAGOOMBA_SMW
NPCID_PARAGOOMBA_MISC
NPCID_REDGOOMBA
NPCID_REDPARAGOOMBA
NPCID_UNDERGOOMBA
NPCID_BIGGOOMBA


// PIRHANA PLANTS
NPCID_PIRHANAHEAD
NPCID_PIRHANA_SMB
NPCID_PIRHANA_SMB3
NPCID_BLUPIRHANA
NPCID_BIGPIRHANA
NPCID_SIDEPIRHANA
NPCID_BOTTOMPIRHANA
NPCID_FIREPIRHANA
NPCID_LONGPIRHANA_UP
NPCID_LONGPIRHANA_DOWN


// THWOMPS
NPCID_THWOMP_SMB3
NPCID_THWOMP_SMW


// FISH
NPCID_BLOOPER
NPCID_REDCHEEP
NPCID_GRNCHEEP
NPCID_SMWCHEEP
NPCID_BONEFISH
NPCID_GOGGLEFISH


// GHOSTS
NPCID_BIGBOO
NPCID_BOO_SMW
NPCID_BOO_SMB3
NPCID_EERIE


// BOB-OMBS
NPCID_BOBOMB_SMB2
NPCID_BOBOMB_SMB3
NPCID_ACTIVEBOBOMB_SMB3


// BEETLES
NPCID_SPIKEBEETLE
NPCID_BUZZYBEETLE
NPCID_SPINY_SMB3
NPCID_SPINY_SMW
NPCID_SPINYBALL_SMB3
NPCID_SPINYBALL_SMW


// CANNON-RELATED ENEMIES
NPCID_CANNONENEMY
NPCID_CANNONBALL
NPCID_BULLET_SMB3
NPCID_BULLET_SMW


// LAKITU
NPCID_LAKITU_SMB3
NPCID_LAKITU_SMW


// OTHER ENEMIES
NPCID_HAMBRO
NPCID_REDSHYGUY
NPCID_BLUSHYGUY
NPCID_NINJI_SMB2
NPCID_NINJI_SMW
NPCID_TWEETER
NPCID_BLUSNIFIT
NPCID_REDSNIFIT
NPCID_GRYSNIFIT
NPCID_SPARK
NPCID_POKEY
NPCID_HOOPSTER
NPCID_CRAB
NPCID_FLY
NPCID_REX_A
NPCID_REX_B
NPCID_BIGMOLE
NPCID_SAW
NPCID_DRYBONES
NPCID_BLARGG
NPCID_LAVALOTUS
NPCID_BAT
NPCID_PODOBOO
NPCID_MUNCHER
NPCID_SLIME_A
NPCID_SLIME_B
NPCID_SLIME_C
NPCID_KNIGHT
NPCID_METROID_A
NPCID_METROID_B
NPCID_METROID_C
NPCID_BULLY


// HAZARDS
NPCID_FIREBAR
NPCID_RINKAGEN
NPCID_STATUE_SMB3
NPCID_STATUE_SMW
NPCID_ROTODISK


// YOSHIS
NPCID_YOSHI_GREEN
NPCID_YOSHI_BLUE
NPCID_YOSHI_YELLOW
NPCID_YOSHI_RED
NPCID_YOSHI_BLACK
NPCID_YOSHI_PURPLE
NPCID_YOSHI_PINK
NPCID_YOSHI_CYAN


// ALLIES
NPCID_TOAD_A
NPCID_TOAD_B
NPCID_PRINCESS
NPCID_LUIGI
NPCID_LINK
NPCID_PINKBOBOMB


// SWITCHES
NPCID_PSWITCH_SMB3
NPCID_PSWITCH_SMW
NPCID_TNT
NPCID_AXE
NPCID_YELSWITCHGOOMBA
NPCID_BLUSWITCHGOOMBA
NPCID_GRNSWITCHGOOMBA
NPCID_REDSWITCHGOOMBA


// GOALS
NPCID_CHECKPOINT
NPCID_KEY
NPCID_GOALTAPE
NPCID_GOALORB_SMB2
NPCID_GOALORB_SMB3
NPCID_ITEMGOAL
NPCID_STAR_SMW
NPCID_STAR_SMB3


// OTHER
NPCID_SIGN



// MISC PROJECTILES
NPCID_PLAYERFIREBALL
NPCID_PLAYERICEBALL
NPCID_SWORDBEAM
NPCID_PLAYERHAMMER
NPCID_PEACHBOMB
NPCID_BOOMERANG
NPCID_ICEBLOCK
NPCID_YOSHIFIRE
NPCID_STATIC
NPCID_BIRDOEGG
NPCID_BUBBLE
NPCID_BURIEDPLANT
NPCID_QUICKSAND
NPCID_EXTFIRE_A
NPCID_EXTFIRE_B
NPCID_EXTFIRE_C
NPCID_EXTFIRE_D
NPCID_EXTFIRE_E
NPCID_RINKA
NPCID_RING_EXT
NPCID_WARTBUBBLE
NPCID_ENEMYHAMMER
Last edited by Rixithechao 8 years ago, edited 1 time in total.
Delightful Adventure Enhanced is out now!

Image

There's an official ASMT Discord server! Check it out to follow and/or contribute to A2XT Episode 2's development! thread, invite link

(Entry requires verification, either with a connected Youtube/Twitter/Twitch/etc account or manually by the server staff.)


Itch.io (albums and eventually games), Youtube (dofur pass and I guess other videos)
User avatar
Kevsoft
LunaLua Master Developer
Posts: 83
Joined: 8 years ago

Re: Presenting: Lunadll for Lua!

Post by Kevsoft »

I just fixed a small error in uservar.lua. I just overwrote the pack, no need to make a own version of it :P.

Also I nearly completed the documentary of the current version. The only thing which is missing are the constants.
Post Reply