This code only does anything if you are inside the block rather than touching the block, for example if you use block id 447 (cloud, go through from below)7NameSam wrote:Nothing happens if I touch the block,Hoeloe wrote:What's happening that's wrong? This should push the player up when they touch a block with ID 1.7NameSam wrote:I'm unsure what I'm doing wrong?
Do I not have the latest version of colliders?
Code: Select all
local colliders = loadAPI("colliders"); function onLoop() if (colliders.collideBlock(player,1)) then player.speedY = -10 end end
LunaDLL/LunaLUA help thread
Re: LunaDLL/LunaLUA help thread
Re: LunaDLL/LunaLUA help thread
Oh, okay. is there any good way to check if you are touching a not-cloud block?S1eth wrote: This code only does anything if you are inside the block rather than touching the block, for example if you use block id 447 (cloud, go through from below)
-
- Posts: 14
- Joined: 9 years ago
Re: LunaDLL/LunaLUA help thread
If you cbf trying to figure out how to get colliders to work, then just use the block collidesWith method.
You can see what collidesWith() returns here
http://wohlsoft.ru/pgewiki/Block_%28class%29
Checking ~= 0 checks all 4 sides of the block for collision.
Code: Select all
function onLoop()
for key, b in pairs(Block.get(1)) do
if (b:collidesWith(player) ~= 0) then
Text.print("FUCK", 0, 0)
break
end
end
end
http://wohlsoft.ru/pgewiki/Block_%28class%29
Checking ~= 0 checks all 4 sides of the block for collision.
- HenryRichard
- Not a licensed doctor or nurse.
- Posts: 31
- Joined: 8 years ago
- Location: ok
Re: LunaDLL/LunaLUA help thread
I can't seem to get paralX.lua to work. I'm using the demo level it comes with and the latest dev build of lua, and it doesn't do anything unless I add sections = {0} to the arguments list, and then I get this error:
What am I doing wrong?- Rednaxela
- Maker of Shenanigans
- Posts: 897
- Joined: 10 years ago
- Pronouns: they/them
- https://rednaxela.talkhaus.com
Re: LunaDLL/LunaLUA help thread
On a hunch... could you post the "function paralX.onCameraUpdate" line, from your paralX.lua in the version of paralX.lua that you're using?HenryRichard wrote:What am I doing wrong?
I have a hunch you're on an out of date version, with a very specific bug.
- HenryRichard
- Not a licensed doctor or nurse.
- Posts: 31
- Joined: 8 years ago
- Location: ok
Re: LunaDLL/LunaLUA help thread
Rednaxela wrote:On a hunch... could you post the "function paralX.onCameraUpdate" line, from your paralX.lua in the version of paralX.lua that you're using?HenryRichard wrote:What am I doing wrong?
I have a hunch you're on an out of date version, with a very specific bug.
Code: Select all
function paralX.onCameraUpdate (eventObj, cameraIndex)
updateCameraSections (cameraIndex)
currentCamera = cameraIndex
for k,v in pairs(indexedParallaxes) do
v:draw (cameraIndex)
end
end
- Rednaxela
- Maker of Shenanigans
- Posts: 897
- Joined: 10 years ago
- Pronouns: they/them
- https://rednaxela.talkhaus.com
Re: LunaDLL/LunaLUA help thread
No, that needs to be there.HenryRichard wrote:I don't think that eventObj should be there...
Hmm... not sure what's... uhless... you're on an out of date version of lunadll without thinking you are. Other than that, something for Rocky to look into.
Re: LunaDLL/LunaLUA help thread
I'm not sure where to put this, so I'm putting this here:
I downloaded the newest version of the A2XT base game off of the onedrive, and the raocow player character has some weird offset issues
I downloaded the newest version of the A2XT base game off of the onedrive, and the raocow player character has some weird offset issues
- Attachments
-
- WONTWORK3.gif (199.24 KiB) Viewed 7718 times
- ztarwuff
- What the heck is a flair and why am I being asked to write one for my profile?
- Posts: 550
- Joined: 10 years ago
- Location: Within 2 miles of the Imperial Crypt of Napoleon III
Re: LunaDLL/LunaLUA help thread
It's the ini files that maintain's raocow's sprite hitbox. They're located in the Episode 2 folder, which means you need to download at least the ini files from the Episode 2 folder off OneDrive.7NameSam wrote:I'm not sure where to put this, so I'm putting this here:
I downloaded the newest version of the A2XT base game off of the onedrive, and the raocow player character has some weird offset issues
What was the reason the ini files couldn't be in the top level folder again?SAJewers wrote:*ping*
- 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
So, that needed to add into lunaworld a loading of right INI-calibrations (even store Talkhaus specific lua libraries which are will work automatically)7NameSam wrote:I'm not sure where to put this, so I'm putting this here:
I downloaded the newest version of the A2XT base game off of the onedrive, and the raocow player character has some weird offset issues
- SAJewers
- ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
- Posts: 4200
- Joined: 11 years ago
- Location: Nova Scotia
Re: LunaDLL/LunaLUA help thread
because they're programmed like npc-xx.txt files where you need to place them in the episode folder, but then also require lunaworld.txt.ztarwuff wrote:It's the ini files that maintain's raocow's sprite hitbox. They're located in the Episode 2 folder, which means you need to download at least the ini files from the Episode 2 folder off OneDrive.7NameSam wrote:I'm not sure where to put this, so I'm putting this here:
I downloaded the newest version of the A2XT base game off of the onedrive, and the raocow player character has some weird offset issues
What was the reason the ini files couldn't be in the top level folder again?SAJewers wrote:*ping*
Honestly we should probably just re-do those sheets so we don't require those ini files, or create some global lua thing so that we can put them in the top level folder.
- 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
I mean playable character calibration file (which includes offsets and metrics of playable character)SAJewers wrote:because they're programmed like npc-xx.txt files where you need to place them in the episode folder, but then also require lunaworld.txt.ztarwuff wrote:It's the ini files that maintain's raocow's sprite hitbox. They're located in the Episode 2 folder, which means you need to download at least the ini files from the Episode 2 folder off OneDrive.7NameSam wrote:I'm not sure where to put this, so I'm putting this here:
I downloaded the newest version of the A2XT base game off of the onedrive, and the raocow player character has some weird offset issues
What was the reason the ini files couldn't be in the top level folder again?SAJewers wrote:*ping*
Honestly we should probably just re-do those sheets so we don't require those ini files, or create some global lua thing so that we can put them in the top level folder.
- Rednaxela
- Maker of Shenanigans
- Posts: 897
- Joined: 10 years ago
- Pronouns: they/them
- https://rednaxela.talkhaus.com
Re: LunaDLL/LunaLUA help thread
This is not really doable without changing large parts of the fundamental design of those sprites. Not only would the default hitbox size be odd with it, but many frames have significant features that rely on being able to draw above and left of the hitbox to a degree that is simply not possible with the default offset values.SAJewers wrote:just re-do those sheets so we don't require those ini files
This however is very easy/doable.SAJewers wrote:or create some global lua thing so that we can put them in the top level folder.
- SAJewers
- ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
- Posts: 4200
- Joined: 11 years ago
- Location: Nova Scotia
Re: LunaDLL/LunaLUA help thread
If you could make that work with the npc-xx.txt files, that would be great too. That way I also won't have to deal with people having moonwalking furbas and whatnot.Rednaxela wrote:This however is very easy/doable.SAJewers wrote:or create some global lua thing so that we can put them in the top level folder.
- 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
If you could make that work with the npc-xx.txt files, that would be great too. That way I also won't have to deal with people having moonwalking furbas and whatnot.[/quote]SAJewers wrote:This however is very easy/doable.SAJewers wrote:or create some global lua thing so that we can put them in the top level folder.
Anyway, a good idea to add support of GLOBAL npc.txts which are will declare default set, and I think, I'll add the automatical loading of playable calibrations INI files too and current way via lua will be used to customize them in real time. What about global NPC.txt's to re-declare global properties, I'll tell that to others
- SAJewers
- ASMBXT Level Wrangler/A2XT Project Coordinator /AAT Level Designer
- Posts: 4200
- Joined: 11 years ago
- Location: Nova Scotia
Re: LunaDLL/LunaLUA help thread
I'd still add a lunaglobal.lua file or whatever, since the code we we'll have in lunaworld.lua will be re-used in future episodes and backported to Ep1 and PTTS anyway, so you'd be eliminating redundancy a bit.
- 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
Anyway, I'll make calibrations for raocow now and I'll put them into onedrive, so, will be possible to use themSAJewers wrote:I'd still add a lunaglobal.lua file or whatever, since the code we we'll have in lunaworld.lua will be re-used in future episodes and backported to Ep1 and PTTS anyway, so you'd be eliminating redundancy a bit.
Re: LunaDLL/LunaLUA help thread
I need help,
The data class "bums" is always 1 when I load the level
The data class "bums" is always 1 when I load the level
Code: Select all
local encrypt = API.load("encrypt")
local myData = encrypt.Data(Data.DATA_LEVEL, true)
if myData:get("bums") == nil then
myData:set("bums",0)
myData:save()
end
function onLoad()
if myData:get("bums") == 1 and player.powerup == PLAYER_SMALL then
player.powerup = PLAYER_BIG
end
end
function onTick()
Text.print(Defines.jumpheight_bounce,0,0)
Text.print(myData:get("bums"),0,20)
if myData:get("bums") == 1 then
if player:mem(0x160,FIELD_WORD) > 20 then
player:mem(0x160,FIELD_WORD,20)
end
end
if myData:get("bums") == 1 then
if player:mem(0xFA,FIELD_WORD) == -1 or player:mem(0xFC,FIELD_WORD) == -1 then
Defines.gravity = 2
else
Defines.gravity = 12
end
else
Defines.gravity = 12
end
if myData:get("bums") == 1 then
Defines.jumpheight_bounce = 22
Defines.jumpheight = 22
else
Defines.jumpheight_bounce = 20
Defines.jumpheight = 20
end
if myData:get("bums") == 1 then
for k,v in pairs(NPC.get(13,player.section)) do
v:mem(0xF0,FIELD_DFLOAT,2)
end
end
if myData:get("bums") == 1 then
player:mem(0x12,FIELD_WORD,-1)
else
player:mem(0x12,FIELD_WORD,0)
end
end
function onNPCKill(eventObj, killedNPC, killReason)
if killedNPC.id == 13 and myData:get("bums") == 1 then
Misc.doBombExplosion(killedNPC.x + 8, killedNPC.y + 8, 0)
Misc.doBombExplosion(killedNPC.x + 8, killedNPC.y + 32, 0)
Misc.doBombExplosion(killedNPC.x + 8, killedNPC.y - 16, 0)
Misc.doBombExplosion(killedNPC.x + 32, killedNPC.y + 8, 0)
Misc.doBombExplosion(killedNPC.x - 16, killedNPC.y + 8, 0)
end
end
function onEvent(eventName)
if eventName == "hit" and myData:get("bums") == 1 then
myData:set("bums",0)
myData:save(0)
else
myData:set("bums",1)
myData:save(0)
end
end
Re: LunaDLL/LunaLUA help thread
Here's your problem7NameSam wrote:I need help,
The data class "bums" is always 1 when I load the level
Code: Select all
function onEvent(eventName) -- is called with the "Level - Start" parameter value when you load the level
if eventName == "hit" and myData:get("bums") == 1 then -- this evaluates to false
myData:set("bums",0)
myData:save(0)
else -- so then, "bums" is set to 1 whenever any event happens that is not "hit"
myData:set("bums",1)
myData:save(0)
end
end
Re: LunaDLL/LunaLUA help thread
Anything special I need to do when adjusting the music volume? I'm trying to do something kinda like this:
and I'm gettin nothin
Code: Select all
function onLoad()
Audio.SeizeStream(-1)
end
function onLoadSection0()
Audio.MusicOpen("beep.ogg")
Audio.MusicPlay()
end
function onLoopSection1()
Audio.MusicVolume = (40 + player.speedY)
end
- snoruntpyro
- cutest girl 2023
- Posts: 884
- Joined: 9 years ago
- Pronouns: she/her
- Contact:
Re: LunaDLL/LunaLUA help thread
Seems as if you're treating it like a variable, when Audio.MusicVolume is a function. Try Audio.MusicVolume(40+player.speedY).Holy wrote: function onLoopSection1()
Audio.MusicVolume = (40 + player.speedY)
end[/code]
and I'm gettin nothin
Re: LunaDLL/LunaLUA help thread
Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh.
Yup, that was it.
Yup, that was it.
- 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
Audio.MusicVolume is function, so, try this:Holy wrote:Anything special I need to do when adjusting the music volume? I'm trying to do something kinda like this:
Code: Select all
function onLoad()
Audio.SeizeStream(-1)
end
function onLoadSection0()
Audio.MusicOpen("beep.ogg")
Audio.MusicPlay()
end
function onLoopSection1()
Audio.MusicVolume = (40 + player.speedY)
end
and I'm gettin nothin
Code: Select all
Audio.MusicVolume(40 + player.speedY)
Also hints:
- Player's max fall speed is +12, but jump up is usually -6. I think, too small speed values for a volume manipulating (Volume range is 0 to 128), you would to multiple speed into 2 or another value to hear volume difference better.
- Before send value to MusicVolume, you would to round it into integer:
Code: Select all
function round(num) if num >= 0 then return math.floor(num+.5) else return math.ceil(num-.5) end end
- You also can don't seize music stream (if you want play a short looped sound effect, not a music or stream of long length, and you wanna keep background music and also play sound effect), you just can use chunks instead:
Code: Select all
-- Pointer to loaded audio chunk local myBeep = Audio.newMix_Chunk() -- A channel number where currently our audio chunk is playing (need to manipulate it!) local myBeep_chan = -2 function onLoad() myBeep = Audio.SfxOpen("beep.ogg"); end -- Mute looped stream on enter into section 0 function onLoadSection0() if(myBeep_chan ~= -2) then Audio.SfxStop(myBeep_chan) myBeep_chan = -2 end end -- When entered into section 1, start loop (take a channel number to control this sound!) function onLoadSection1() myBeep_chan = Audio.SfxPlayCh(-1, myBeep, -1) end function round(num) if num >= 0 then return math.floor(num+.5) else return math.ceil(num-.5) end end -- Manipulate with volume dependent to Y speed of player function onLoopSection1() Audio.SfxVolume(myBeep_chan, 40 + round(player.speedY*2) ) end
Re: LunaDLL/LunaLUA help thread
I need help, I'm using ParalX and the sections (sections = {2}) argument straight up doesn't work, the paralax graphics I only want to show
in a section section only show up in section 1. am I using an outdated version of ParalX?
in a section section only show up in section 1. am I using an outdated version of ParalX?
Code: Select all
local paralX = loadAPI("paralX");
local pnpc = loadSharedAPI("pnpc");
local multipoints = loadAPI("multipoints");
multipoints.addLuaCheckpoint(-190976, -200352, 0);
local clouds = Graphics.loadImage("cloud.png")
local clouds2 = Graphics.loadImage("cloud2.png")
local clouds3 = Graphics.loadImage("cloud3.png")
local clouds4 = Graphics.loadImage("cloud4.png")
local wrapcloud1 = Graphics.loadImage("wrapcloud1.png")
local wrapcloud2 = Graphics.loadImage("wrapcloud2.png")
local wrapcloud3 = Graphics.loadImage("wrapcloud3.png")
local wrapcloud4 = Graphics.loadImage("wrapcloud4.png")
function onStart ()
cld3 = paralX.create ({image=clouds3, y=-128, priority=-96, speedX=0.9, repeatY=false, parallaxX=0.9, sections={2}, parallaxY=1})
cld4 = paralX.create ({image=clouds4, y=-160, priority=-97, speedX=0.8, repeatY=false, parallaxX=0.8, sections={2}, parallaxY=1})
cld2 = paralX.create ({image=clouds2, y=-96, priority=-2, speedX=1.1, repeatY=false, parallaxX=1.1, sections={2}, parallaxY=1})
cld1 = paralX.create ({image=clouds, y=-64, priority=-1, speedX=1.2, repeatY=false, parallaxX=1.2, sections={2}, parallaxY=1})
-
- https://www.youtube.com/watch?v=BODxOghVmko
- Posts: 1812
- Joined: 10 years ago
- First name: Mack
- https://rixithechao.talkhaus.com/
Re: LunaDLL/LunaLUA help thread
Ah, sorry, I forgot to update the documentation. The former implementation wouldn't work no matter what I tried so in the latest version sections are based on index instead of value; as long as sections[2] is a non-nil value it'll work. iirc the proper syntax is {2:1}.
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)