Don't do that. It makes no difference and is less readable.Axon wrote:Try replacing the two "player" with two "Player(1)", maybe.Louiejub wrote: This was the code that SAJewers gave me:
Code: Select all
function onLoad() if (player.isValid) then player.character = CHARACTER_TOAD; end end
LunaDLL/LunaLUA help thread
Re: LunaDLL/LunaLUA help thread
- GenesisJames
- Music reviewer and drawer of cute girls.
- Posts: 529
- Joined: 11 years ago
- Location: United States
Re: LunaDLL/LunaLUA help thread
Alrighty, I'll try a few of these things out. Thanks for the help, guys!
- docopoper
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non pharetra enim, nec maximus odio.
- Posts: 78
- Joined: 12 years ago
- First name: Shane Farrell
- Pronouns: they/he
- Location: Ireland
Re: LunaDLL/LunaLUA help thread
Is it possible to do simple networking? I want to see if it's possible to store a replay of everyone playing on a server and have players race ghosts of each other.
The first thing I would do with infinite power would be to make myself a cave where I could look at my shadow forever.
<- Go team Yeah Doctor Shemp.!
<- That's everyone being nice to me. ^^
I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
<- Go team Yeah Doctor Shemp.!
<- That's everyone being nice to me. ^^
I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
Re: LunaDLL/LunaLUA help thread
I could add simple networking... It depends on what kind of networking you need. For simple HTTP GET request, I already have a system but it is not bound to lua yet.docopoper wrote:Is it possible to do simple networking? I want to see if it's possible to store a replay of everyone playing on a server and have players race ghosts of each other.
- docopoper
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non pharetra enim, nec maximus odio.
- Posts: 78
- Joined: 12 years ago
- First name: Shane Farrell
- Pronouns: they/he
- Location: Ireland
Re: LunaDLL/LunaLUA help thread
Yeah, that could work. Ideally both GET and POST for retrieving and submitting replays, if there is some way of me sending large amounts of data through the GET request then it will work. I think I recall something about a character limit on GET requests though, so that would make submitting a bit more awkward if it existed. That limit might just have been in a specific API I was using though.
Either way though, no need for sockets or anything like that.
Either way though, no need for sockets or anything like that.
The first thing I would do with infinite power would be to make myself a cave where I could look at my shadow forever.
<- Go team Yeah Doctor Shemp.!
<- That's everyone being nice to me. ^^
I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
<- Go team Yeah Doctor Shemp.!
<- That's everyone being nice to me. ^^
I made a game called Utter Confusion! Play it! :D
It's a lot of fun and has been incredibly popular at every indie game dev party I've brought it to.
Re: LunaDLL/LunaLUA help thread
Okay, I added that request to the LunaLua Whishlist
- GenesisJames
- Music reviewer and drawer of cute girls.
- Posts: 529
- Joined: 11 years ago
- Location: United States
Re: LunaDLL/LunaLUA help thread
Sooo, notepad is only letting me save my code as a txt file, and there's no other options. Anything that I'm doing wrong? This lua stuff is confusing, haha~
- Wohlstand
- Moondust and TheXTech developer
- Posts: 186
- Joined: 10 years ago
- First name: Vitaly
- Pronouns: he/him/his
- Location: Moscow, Russia
Re: LunaDLL/LunaLUA help thread
While you "saving as" youe file, type your filename in quities:Louiejub wrote:Sooo, notepad is only letting me save my code as a txt file, and there's no other options. Anything that I'm doing wrong? This lua stuff is confusing, haha~
you typed
Code: Select all
meow.lua
Code: Select all
"meow.lua"
Note: in the file type combo-box choice "All files"
- GenesisJames
- Music reviewer and drawer of cute girls.
- Posts: 529
- Joined: 11 years ago
- Location: United States
Re: LunaDLL/LunaLUA help thread
Ahhh, thank you! That worked! :DWohlstand wrote:While you "saving as" youe file, type your filename in quities:Louiejub wrote:Sooo, notepad is only letting me save my code as a txt file, and there's no other options. Anything that I'm doing wrong? This lua stuff is confusing, haha~
you typedbut type this:Code: Select all
meow.lua
instead of previousCode: Select all
"meow.lua"
Note: in the file type combo-box choice "All files"
Re: LunaDLL/LunaLUA help thread
Arright, what's the best way to do top/bottom wraparound? I'm guessing there's no way to link it up so the player can have like, half their body on top and half on the bottom at the same time.
- snoruntpyro
- cutest girl 2023
- Posts: 884
- Joined: 9 years ago
- Pronouns: she/her
- Contact:
Re: LunaDLL/LunaLUA help thread
The half and half thing, pretty sure it's not possible. But, funny story - a level I'm making did vertical wraparound as well. The way I did it was to do BGO.getIntersecting and if the player touched the background object (in my case, the square glass smb3 bgo), they would be warped to a Y-coordinate defined by the section. So like this:Holy wrote:Arright, what's the best way to do top/bottom wraparound? I'm guessing there's no way to link it up so the player can have like, half their body on top and half on the bottom at the same time.
Code: Select all
for _, b in pairs(BGO.getIntersecting(player.x, player.y, player.x + player.width, player.y + player.height)) do
if b.id == 99 then
player.y = wrapTable[player.section]-64;
end
end
You don't have to have the -64 but it looks way smoother if you respawn the player offscreen.
Re: LunaDLL/LunaLUA help thread
Collisions may not be possible (didn't someone do a collisions library though?) but the visual part should be at least just by placing an image with an offset of the screen size from the player's position according to the player's current sprite.Pyro wrote:The half and half thing, pretty sure it's not possible.
Re: LunaDLL/LunaLUA help thread
Huh, I'll have to try this out in a sec. Here's what I came up with after messing with some of red's code from a ways back in the threadPyro wrote:Code: Select all
for _, b in pairs(BGO.getIntersecting(player.x, player.y, player.x + player.width, player.y + player.height)) do if b.id == 99 then player.y = wrapTable[player.section]-64; end end
Code: Select all
function onLoop()
local sectBottom = player.sectionObj.boundary.bottom
local sectTop = player.sectionObj.boundary.top
if (player.speedY > 0) then
if (player.y > sectBottom) then
--bottom to top
player.y = sectTop - 48
end
elseif (player.speedY < 0) then
if (player.y < sectTop - 48) then
--top to bottom
player.y = sectBottom
end
end
end
HMMM, yeah, and if you made sure no enemies could get to you along the screen boundary it might actually work really good. I might mess with that.Alice wrote:Collisions may not be possible (didn't someone do a collisions library though?) but the visual part should be at least just by placing an image with an offset of the screen size from the player's position according to the player's current sprite.Pyro wrote:The half and half thing, pretty sure it's not possible.
Re: LunaDLL/LunaLUA help thread
Edit: Mistake found, hiding in spoiler tags to remove the bloat.
But the debug error says:
What the hell? Where do I even get a lua_State pointer from?
Edit: Figured out another easier way, I'll just take the spritesheet for a powerup I'm not gonna use and empty it and force that powerup for the duration I need the effect. Still wondering what's up with the mismatch though.[/spoiler]
In other news, Misc.doBombExplosion doesn't seem to exist. It's a 7.2.3 thing apparently, the dev kit is 7.2.2.
Code: Select all
PlayerSettings:setSpriteOffsetX(number indexX, number indexY, number value)
What the hell? Where do I even get a lua_State pointer from?
Edit: Figured out another easier way, I'll just take the spritesheet for a powerup I'm not gonna use and empty it and force that powerup for the duration I need the effect. Still wondering what's up with the mismatch though.[/spoiler]
In other news, Misc.doBombExplosion doesn't seem to exist. It's a 7.2.3 thing apparently, the dev kit is 7.2.2.
Last edited by Duker 8 years ago, edited 2 times in total.
fart.
- Rednaxela
- Maker of Shenanigans
- Posts: 897
- Joined: 10 years ago
- Pronouns: they/them
- https://rednaxela.talkhaus.com
Re: LunaDLL/LunaLUA help thread
Could you post your code? You don't need lua_State, that's automatic, and I'm pretty sure the documentation is correct. There's some other mistake you're making.Duker wrote:But the debug error says:Code: Select all
PlayerSettings:setSpriteOffsetX(number indexX, number indexY, number value)
What the hell? Where do I even get a lua_State pointer from?.[/spoiler]
Re: LunaDLL/LunaLUA help thread
Rednaxela wrote:Could you post your code? You don't need lua_State, that's automatic, and I'm pretty sure the documentation is correct. There's some other mistake you're making.Duker wrote:But the debug error says:Code: Select all
PlayerSettings:setSpriteOffsetX(number indexX, number indexY, number value)
What the hell? Where do I even get a lua_State pointer from?.[/spoiler]
Code: Select all
local PlrSet = PlayerSettings.get(CHARACTER_TOAD, PLAYER_BIG)
PlrSet.setSpriteOffsetX(0, 0, 0)
Last edited by Duker 8 years ago, edited 1 time in total.
fart.
Re: LunaDLL/LunaLUA help thread
There is a difference between . and :Duker wrote:Rednaxela wrote:Could you post your code? You don't need lua_State, that's automatic, and I'm pretty sure the documentation is correct. There's some other mistake you're making.Duker wrote:But the debug error says:Code: Select all
PlayerSettings:setSpriteOffsetX(number indexX, number indexY, number value)
What the hell? Where do I even get a lua_State pointer from?.[/spoiler]Not much room for mistakes when it's only two short and simple lines...Code: Select all
local PlrSet = PlayerSettings.get(CHARACTER_TOAD, PLAYER_BIG) PlrSet.setSpriteOffsetX(0, 0, 0)
: fills the first argument automatically, so
Code: Select all
obj:func(args)
Code: Select all
obj.func(obj, args)
Re: LunaDLL/LunaLUA help thread
Yeah I noticed that I had misread : for . and edited my post seconds before you posted. I thought for sure I tested PlrSet.setSpriteOffsetX(PlrSet, 0, 0, 0) which would have worked too but apparently I didn't.Hoeloe wrote:There is a difference between . and :Duker wrote:Rednaxela wrote:Could you post your code? You don't need lua_State, that's automatic, and I'm pretty sure the documentation is correct. There's some other mistake you're making.Not much room for mistakes when it's only two short and simple lines...Code: Select all
local PlrSet = PlayerSettings.get(CHARACTER_TOAD, PLAYER_BIG) PlrSet.setSpriteOffsetX(0, 0, 0)
: fills the first argument automatically, soIs the same asCode: Select all
obj:func(args)
[/spoiler]Code: Select all
obj.func(obj, args)
fart.
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaDLL/LunaLUA help thread
This is my first time working with CinematX, and since my level uses a lot of friendly NPCs I thought it'd be cool to use CinematX NPC dialogue, since it looks more fluid than the default NPC dialogue. I'm not trying to do any fancy cutscenes or actor manipulation, I just want to do some simple dialogue like this. I have some code here but I have no idea how to connect the NPC to the routine I want it to run.
Code:
NPC Tags:
Code:
Code: Select all
cinematX = loadSharedAPI("cinematX")
cinematX.configExt ({"hudBox"=false, "overrideNpcText"=true, "imageUi"=false, "textbloxSub"=true})
function scene_1 ()
cinematX.startDialogExt (bellossom1, Bellossom, "Hello there! Welcome to the Starlight Resort!")
cinematX.waitForDialog()
cinematX.endCutscene ()
end
Code: Select all
{key=bellossom1, name=Bellossom, routine=function_scene1}
-
- Posts: 117
- Joined: 9 years ago
Re: LunaDLL/LunaLUA help thread
Routine = should just be scene1Karatekid5 wrote:This is my first time working with CinematX, and since my level uses a lot of friendly NPCs I thought it'd be cool to use CinematX NPC dialogue, since it looks more fluid than the default NPC dialogue. I'm not trying to do any fancy cutscenes or actor manipulation, I just want to do some simple dialogue like this. I have some code here but I have no idea how to connect the NPC to the routine I want it to run.
Code:NPC Tags:Code: Select all
cinematX = loadSharedAPI("cinematX") cinematX.configExt ({"hudBox"=false, "overrideNpcText"=true, "imageUi"=false, "textbloxSub"=true}) function scene_1 () cinematX.startDialogExt (bellossom1, Bellossom, "Hello there! Welcome to the Starlight Resort!") cinematX.waitForDialog() cinematX.endCutscene () end
Code: Select all
{key=bellossom1, name=Bellossom, routine=function_scene1}
Also don't use end cutscene for a coroutine
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaDLL/LunaLUA help thread
I fixed the mistakes, but I now get an error upon loading the level. What exactly does this mean?
- Attachments
-
- lunaerror.png (3.75 KiB) Viewed 5725 times
-
- Posts: 117
- Joined: 9 years ago
Re: LunaDLL/LunaLUA help thread
I think you can just write cinematX.configExt(false,true,false,true) I mean you can just get rid of the config line completely too cause you aren't changing anything as far as I can see.
Re: LunaDLL/LunaLUA help thread
Try to remove the "
Code: Select all
cinematX.configExt ({hudBox=false, overrideNpcText=true, imageUi=false, textbloxSub=true})
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaDLL/LunaLUA help thread
I tried removing the quotation marks and I ended up getting another error. Also, I do want to set a few things so removing the config line wouldn't be an option.
- Attachments
-
- lunaerror2.png (5.12 KiB) Viewed 7136 times
-
- Posts: 117
- Joined: 9 years ago
Re: LunaDLL/LunaLUA help thread
Okay what you have there is the basic true false thing that is prepackaged anyway but okay. Did you get rid of the cinematX before .configExt? Idk why that would happen otherwise