LunaDLL/LunaLUA help thread
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaDLL/LunaLUA help thread
The error says that the function does not exists. Either you have typo or a too old version of cinematX.
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaDLL/LunaLUA help thread
I update my copy of LunaLUA whenever an update is released, but I redownloaded/installed the most recent version just in case. I tried it out and still got the same error.
For reference, here's the current code:
For reference, here's the current 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()
end
-
- https://www.youtube.com/watch?v=BODxOghVmko
- Posts: 1862
- Joined: 10 years ago
- First name: Mack
- https://rixithechao.talkhaus.com/
Re: LunaDLL/LunaLUA help thread
Are you using the latest version of cinematX from the github repo (0.0.8l5) or the latest stable/devkit version (0.0.7)?
0.0.7 didn't have configExt () along with a ton of other features I've been adding to simplify things.
0.0.7 didn't have configExt () along with a ton of other features I've been adding to simplify things.
Delightful Adventure Enhanced is out now!
There's an official ASMT Discord server! Check it out to discuss Demo games and follow their 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)
There's an official ASMT Discord server! Check it out to discuss Demo games and follow their 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)
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaDLL/LunaLUA help thread
Ah, that must be the problem! I have the latest devkit version but not the github repo version. Where can I download that version of CinematX?
EDIT: I found the Github link and installed that version, so the error disappeared!
Though, I've run into some new problems. When trying to play my level I got this odd error that mentions the Multipoints LUA file. After this error, my level's LUA won't run either.
EDIT 2: Actually, it seems like this problem isn't specific to my level, as I get this error when I try to load any level using LUA but not using multipoints.
EDIT: I found the Github link and installed that version, so the error disappeared!
Though, I've run into some new problems. When trying to play my level I got this odd error that mentions the Multipoints LUA file. After this error, my level's LUA won't run either.
EDIT 2: Actually, it seems like this problem isn't specific to my level, as I get this error when I try to load any level using LUA but not using multipoints.
- Attachments
-
- multipoints.png (13.57 KiB) Viewed 7479 times
Re: LunaDLL/LunaLUA help thread
How do you use a PNG? I want to use one to make the screen darker in a section.
Re: LunaDLL/LunaLUA help thread
I think I may know what the problem is.Karatekid5 wrote: EDIT 2: Actually, it seems like this problem isn't specific to my level, as I get this error when I try to load any level using LUA but not using multipoints.
Could you find your multipoints.lua file in the LuaScriptsLib folder and check the version number? If it's not 3.0.11, then you'll need to download the newest version from the wiki.
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaDLL/LunaLUA help thread
There we go, that fixed it! ^_^ (I had version 3.0.6)Hoeloe wrote:I think I may know what the problem is.
Could you find your multipoints.lua file in the LuaScriptsLib folder and check the version number? If it's not 3.0.11, then you'll need to download the newest version from the wiki.
So, going back to CinematX, the NPC gives me the "press up to talk" message at the bottom of the screen when touching them, but pressing up does nothing.
The code is in an earlier post, and here are the NPC tags:
Code: Select all
{key=bellossom1, name=Bellossom, routine=function_scene1}
Re: LunaDLL/LunaLUA help thread
So I'm trying to save a number to the local data, and then I want to get that number back next time and add it to another number. But Mr. Lua keeps telling me I'm trying to add a string, and I've tried a buncha stuff but none of it seems to work. HELP MEEEEEE
edit: yeah no matter how many ways I shove it in tonumber() don't work none.
edit: yeah no matter how many ways I shove it in tonumber() don't work none.
- 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
For this case you don't need for PNG BGO's, you can apply fader library and set black screen with half alpha-channel. However you still can make some foreground BGO with semitransparency and save it into PNG format (LunaLUA-SMBX supports mask-less true-transparency PNG images)7NameSam wrote:How do you use a PNG? I want to use one to make the screen darker in a section.
Re: LunaDLL/LunaLUA help thread
Could you paste the code, which throws the error?Holy wrote:So I'm trying to save a number to the local data, and then I want to get that number back next time and add it to another number. But Mr. Lua keeps telling me I'm trying to add a string, and I've tried a buncha stuff but none of it seems to work. HELP MEEEEEE
edit: yeah no matter how many ways I shove it in tonumber() don't work none.
- gameguy888
- Man, I dunno.
- Posts: 28
- Joined: 9 years ago
Re: LunaDLL/LunaLUA help thread
Is there a way to trigger some code every time the player collects a powerup (even if they're already fully powered and it would thus "do nothing")?
Words go here sometimes.
Re: LunaDLL/LunaLUA help thread
You could probably use onNPCKill for that, I'll try it out once I get home from work.gameguy888 wrote:Is there a way to trigger some code every time the player collects a powerup (even if they're already fully powered and it would thus "do nothing")?
Right-o, I probably overcomplicated it but it seems to work at least:
Code: Select all
local Cam
function onLoad()
Cam = Camera.get()[1]
end
function onNPCKill(eventObj, killedNPC, killReason)
--killreason 9 = "Despawn or NPC eaten (ie powerups) = Vanish"
if (killReason == 9) then
--Check if the NPC is on screen, otherwise it must have despawned
if(killedNPC.x > Cam.x
and killedNPC.x < Cam.x+Cam.width
and killedNPC.y > Cam.y
and killedNPC.y < Cam.y+Cam.height)
then
--[[Code to run here]]
end
end
end
fart.
- Rednaxela
- Maker of Shenanigans
- Posts: 897
- Joined: 10 years ago
- Pronouns: they/them
- https://rednaxela.talkhaus.com
Re: LunaDLL/LunaLUA help thread
Less complicated and would probably work would be:Duker wrote:You could probably use onNPCKill for that, I'll try it out once I get home from work.gameguy888 wrote:Is there a way to trigger some code every time the player collects a powerup (even if they're already fully powered and it would thus "do nothing")?
Right-o, I probably overcomplicated it but it seems to work at least:
You might want to check the ID of the killedNPC too as 1-ups also "die" the same way as actual power-ups.[/spoiler]Code: Select all
local Cam function onLoad() Cam = Camera.get()[1] end function onNPCKill(eventObj, killedNPC, killReason) --killreason 9 = "Despawn or NPC eaten (ie powerups) = Vanish" if (killReason == 9) then --Check if the NPC is on screen, otherwise it must have despawned if(killedNPC.x > Cam.x and killedNPC.x < Cam.x+Cam.width and killedNPC.y > Cam.y and killedNPC.y < Cam.y+Cam.height) then --[[Code to run here]] end end end
Code: Select all
function onNPCKill(eventObj, killedNPC, killReason)
--killreason 9 = "Despawn or NPC eaten (ie powerups) = Vanish"
if (killReason == 9) then
--Check if the NPC is on screen, otherwise it must have despawned
if killedNPC:mem(0x12A, FIELD_WORD) > 0 then
--[[Code to run here]]
end
end
end
As a note, onNPCKill only works with very new versions of LunaLua.
Re: LunaDLL/LunaLUA help thread
It's new enough in the current devkit, though I did download it decently recently so worth checking yeah.Rednaxela wrote:Less complicated and would probably work would be:Duker wrote:You could probably use onNPCKill for that, I'll try it out once I get home from work.gameguy888 wrote:Is there a way to trigger some code every time the player collects a powerup (even if they're already fully powered and it would thus "do nothing")?
Right-o, I probably overcomplicated it but it seems to work at least:
You might want to check the ID of the killedNPC too as 1-ups also "die" the same way as actual power-ups.[/spoiler]Code: Select all
local Cam function onLoad() Cam = Camera.get()[1] end function onNPCKill(eventObj, killedNPC, killReason) --killreason 9 = "Despawn or NPC eaten (ie powerups) = Vanish" if (killReason == 9) then --Check if the NPC is on screen, otherwise it must have despawned if(killedNPC.x > Cam.x and killedNPC.x < Cam.x+Cam.width and killedNPC.y > Cam.y and killedNPC.y < Cam.y+Cam.height) then --[[Code to run here]] end end end
Don't need to be checking it's location, and that code you have to check that is slightly incorrect anyway due to the effect of height/width. Besides, at offset 0x12A there's a despawn countdown. Just check that hasn't triggered.Code: Select all
function onNPCKill(eventObj, killedNPC, killReason) --killreason 9 = "Despawn or NPC eaten (ie powerups) = Vanish" if (killReason == 9) then --Check if the NPC is on screen, otherwise it must have despawned if killedNPC:mem(0x12A, FIELD_WORD) > 0 then --[[Code to run here]] end end end
As a note, onNPCKill only works with very new versions of LunaLua.
Anyway, that is absolutely better (forgot to check mem offsets for relevant stuff) but for whatever reason enemies falling out of the level (but not powerups) gets through that check. Easily solved with an ID check though so it's still the better solution.
Curious though, what part of it is incorrect? What exactly do you mean with "the effect of height/width"? Just trying to learn from my mistakes.
Last edited by Duker 8 years ago, edited 1 time in total.
fart.
Re: LunaDLL/LunaLUA help thread
Here's the relevant parts, I thinkKevsoft wrote:Could you paste the code, which throws the error?Holy wrote:So I'm trying to save a number to the local data, and then I want to get that number back next time and add it to another number. But Mr. Lua keeps telling me I'm trying to add a string, and I've tried a buncha stuff but none of it seems to work. HELP MEEEEEE
edit: yeah no matter how many ways I shove it in tonumber() don't work none.
Code: Select all
local myLevelData = Data(Data.DATA_LEVEL, "myData")
coinCounted = 0
coinCounted2 = 0
coinAdd = 0
function onEvent(eventname)
if eventname == "logFirst" then
myLevelData:set("coyn",tostring(coinCount))
myLevelData:save()
end
end
function onLoadSection3()
coinCounted = myLevelData:get("coyn");
end
function onLoopSection3()
coinAdd = coinCounted2 + tonumber(coinCounted)
Text.print(coinAdd,200,360)
end
Re: LunaDLL/LunaLUA help thread
Could you also copy the error or make a screenshot of it? Currently this code seems to be right, so the error message and especially the line number, where the error happend is important.
Re: LunaDLL/LunaLUA help thread
Is that supposed to be countCounted? Because if it is, that would mean you're storing "nil" in the data class, and it's failing when trying to convert it back to a number.Holy wrote:Code: Select all
tostring(coinCount)
Re: LunaDLL/LunaLUA help thread
coinCount's a diff variable, from another part of the code. Anyway, it works now for some reason!! I think all my manual messing with the savefile was screwing with it or something.
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaDLL/LunaLUA help thread
An update on the CinematX issue I was having earlier, I tried a few things with the NPC's tags, and seems like the key was changing the NPC's routine tag to "routine=function scene_1". Now, when I press up to talk to the NPC, it seems to be running some code now, but instead of the intended message I just get this error. My LunaLUA is the most recent version and my version of CinematX is the most recent Github version.
- Attachments
-
- cinematxerror.png (13.87 KiB) Viewed 7321 times
-
- https://www.youtube.com/watch?v=BODxOghVmko
- Posts: 1862
- Joined: 10 years ago
- First name: Mack
- https://rixithechao.talkhaus.com/
Re: LunaDLL/LunaLUA help thread
It should be just the name of the function, so routine=scene_1, though if you want it to play as a cutscene, I suggest using scene=scene_1 instead.
Delightful Adventure Enhanced is out now!
There's an official ASMT Discord server! Check it out to discuss Demo games and follow their 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)
There's an official ASMT Discord server! Check it out to discuss Demo games and follow their 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)
Re: LunaDLL/LunaLUA help thread
I'm sorry, but I'm unfamiliar with Fader Libraries, and google doesn't give me any good results.Wohlstand wrote:For this case you don't need for PNG BGO's, you can apply fader library and set black screen with half alpha-channel. However you still can make some foreground BGO with semitransparency and save it into PNG format (LunaLUA-SMBX supports mask-less true-transparency PNG images)7NameSam wrote:How do you use a PNG? I want to use one to make the screen darker in a section.
- FrozenQuills
- hehe haha 2024
- Posts: 843
- Joined: 9 years ago
- Location: my skull
Re: LunaDLL/LunaLUA help thread
I just did something similar to this for one of my levels.7NameSam wrote:I'm sorry, but I'm unfamiliar with Fader Libraries, and google doesn't give me any good results.
If you want a simple way to do it, make an 800x800 PNG image that's all black, then have this in the lua file:
Code: Select all
local black = Graphics.loadImage("black.png");
function onLoop()
Graphics.drawImage(black,0,0,0.6);
end
avatar by crayonchewer!
- Karatekid5
- Welcome to the resort!
- Posts: 78
- Joined: 14 years ago
- Location: Pennsylvania
- Contact:
Re: LunaDLL/LunaLUA help thread
I want it to be regular NPC dialogue, so I kept the routine tag. I added a line to the routine to print text to the screen, and when I press up the printed text appears, so talking to the NPC seems to be triggering the routine. Though, when I press up the NPC's CinematX dialogue still doesn't appear/activate.Rockythechao wrote:It should be just the name of the function, so routine=scene_1, though if you want it to play as a cutscene, I suggest using scene=scene_1 instead.
Current code:
Code: Select all
cinematX = loadSharedAPI("cinematX")
cinematX.configExt ({hudBox=false, overrideNpcText=true, imageUi=false, textbloxSub=true})
function scene_1 ()
Text.print("The routine is running",12,12)
cinematX.startDialogExt (bellossom1, Bellossom, "Hello there! Welcome to the Starlight Resort!")
cinematX.waitForDialog()
end
-
- https://www.youtube.com/watch?v=BODxOghVmko
- Posts: 1862
- Joined: 10 years ago
- First name: Mack
- https://rixithechao.talkhaus.com/
Re: LunaDLL/LunaLUA help thread
startDialogExt is just the text and a table of named arguments. Try this:
Code: Select all
cinematX = loadSharedAPI("cinematX")
cinematX.configExt ({hudBox=false, overrideNpcText=true, imageUi=false, textbloxSub=true})
function scene_1 ()
local belActor1 = cinematX.getActorFromKey ("bellossom1")
Text.print("The routine is running",12,12)
cinematX.startDialogExt ("Hello there! Welcome to the Starlight Resort!", {actor=belActor1, name="Bellossom"})
cinematX.waitForDialog()
end
Delightful Adventure Enhanced is out now!
There's an official ASMT Discord server! Check it out to discuss Demo games and follow their 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)
There's an official ASMT Discord server! Check it out to discuss Demo games and follow their 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)