Page 51 of 76
Re: Need help with lua? - LunaLua General Help
Posted: Sat Mar 18, 2017 11:05 am
by HeroLinik
Devan2002 wrote:HeroLinik wrote:Devan2002 wrote:Can someone use lua to replace a Super Metroid sound effect with the sound from Lttp (when a closed door opens because all of the enemies are defeated)?
You don't need LunaLua. Provided you have 2.0, all you can do is make a sounds.ini file and replace the sound effect through there.
I'm using 1.3.0.1. Btw, is it possible to change sound effects on 1.3.0.1?
No, it's not.
Re: Need help with lua? - LunaLua General Help
Posted: Sat Mar 18, 2017 7:27 pm
by Devan2002
HeroLinik wrote:Devan2002 wrote:HeroLinik wrote:
You don't need LunaLua. Provided you have 2.0, all you can do is make a sounds.ini file and replace the sound effect through there.
I'm using 1.3.0.1. Btw, is it possible to change sound effects on 1.3.0.1?
No, it's not.
I don't know how even when replacing the sound effect and renaming it to what the replaced sound was, it's still the same sound effect...
Re: Need help with lua? - LunaLua General Help
Posted: Sat Mar 18, 2017 8:23 pm
by underFlo
He literally just said it doesn't work with the version you're using so what exactly are you trying to say?
Re: Need help with lua? - LunaLua General Help
Posted: Sat Mar 18, 2017 8:43 pm
by Devan2002
Spinda wrote:He literally just said it doesn't work with the version you're using so what exactly are you trying to say?
I'm trying to say, that if you replaced a sound effect with a different one, and renamed the different one to the one you just replaced, it will still play the original sound.
Re: Need help with lua? - LunaLua General Help
Posted: Sun Mar 19, 2017 7:09 am
by PixelPest
Devan2002 wrote:Spinda wrote:He literally just said it doesn't work with the version you're using so what exactly are you trying to say?
I'm trying to say, that if you replaced a sound effect with a different one, and renamed the different one to the one you just replaced, it will still play the original sound.
Where are you putting these new files?
Re: Need help with lua? - LunaLua General Help
Posted: Sun Mar 19, 2017 6:08 pm
by Quantumenace
I think that what Devan2002 is saying is that replacing the game's sound files should work. It does work, but doing that replaces the sound in every level. HeroLinik means that in 1.3 you can't replace the sound on a per-level or per-episode basis.
Re: Need help with lua? - LunaLua General Help
Posted: Fri Mar 24, 2017 10:46 am
by mariogeek2
So, just curious, is it possible to adjust the player's hitbox using LunaLua? If so, how would you do that?
Re: Need help with lua? - LunaLua General Help
Posted: Fri Mar 24, 2017 10:51 am
by Emral
mariogeek2 wrote:So, just curious, is it possible to adjust the player's hitbox using LunaLua? If so, how would you do that?
Use the PGE Player calibrator tool.
Re: Need help with lua? - LunaLua General Help
Posted: Tue Mar 28, 2017 11:42 am
by TDK
Quick question, how to temporarily speed up music?
Re: Need help with lua? - LunaLua General Help
Posted: Wed Mar 29, 2017 4:10 pm
by Quantumenace
I don't think there's currently a way to do that.
Re: Need help with lua? - LunaLua General Help
Posted: Wed Mar 29, 2017 5:27 pm
by TDK
Quantumenace wrote:I don't think there's currently a way to do that.
Oh, that's a shame.
At least I got a backup plan.
Also, how to make a mushroom have no effect?
Re: Need help with lua? - LunaLua General Help
Posted: Wed Mar 29, 2017 6:30 pm
by PixelPest
As in not do anything when the player touches it?
Re: Need help with lua? - LunaLua General Help
Posted: Wed Mar 29, 2017 6:31 pm
by TDK
PixelPest wrote:As in not do anything when the player touches it?
Yes.
Re: Need help with lua? - LunaLua General Help
Posted: Thu Mar 30, 2017 5:36 pm
by Quantumenace
I guess that depends on what exactly you intend to do. Either set its "friendly" flag to true, or use the axe and make it look like a mushroom.
Re: Need help with lua? - LunaLua General Help
Posted: Thu Mar 30, 2017 7:50 pm
by TDK
I just want to change the effects of the mushroom.
Re: Need help with lua? - LunaLua General Help
Posted: Thu Mar 30, 2017 10:23 pm
by FanofSMBX
You can just use the ? mushroom if you're not in 2 player, because it swaps player positions but does nothing in 1 player mode.
Re: Need help with lua? - LunaLua General Help
Posted: Sat Apr 01, 2017 9:02 pm
by PersonNamedUser
Okay, i wrote a new code for the boost dash ability, but i have a few questions
1. NOW is it almost correct?
2. How do you fix this error? I tried putting ends down in certain places but to no avail.
3. and pixelpest, don't be too blunt about me not know this
Code: Select all
local dashsound = Audio.playSFX("dash.wav")
local haveBoosted = false;
local haveBoostedDown = false;
function onLoop()
if player:mem(0x146, FIELD_WORD) == 2 then
HaveBoosted = false;
HaveBoostedDown = false;
end
end
function onStart()
for i = 1, 7 do
Level.loadPlayerHitboxes(4, i, "toad-"..tostring(i)..".ini");
end
end
function OnLoop()
if player.jumpKeyPressing == true then
if (player:mem(0xF8, FIELD_WORD) == -1)then
if player.rightKeyPressing == true then
if haveBoosted == false then
player.speedX = -5
Audio.playSFX("dash.wav")
do haveBoosted = true;
end
elseif player.leftKeyPressing == true then
if haveBoosted == false then
player.speedX = 5
Audio.playSFX("dash.wav")
do haveBoosted = true;
end
elseif player.downKeyPressing == true then
if haveBoostedDown == false then
player.speedY = 5
Audio.playSFX("dash.wav")
do haveBoostedDown = true;
do haveBoosted = true;
end
end
end
end
Re: Need help with lua? - LunaLua General Help
Posted: Sun Apr 02, 2017 8:39 am
by PixelPest
MosaicMario wrote:Okay, i wrote a new code for the boost dash ability, but i have a few questions
1. NOW is it almost correct?
2. How do you fix this error? I tried putting ends down in certain places but to no avail.
3. and pixelpest, don't be too blunt about me not know this
Code: Select all
local dashsound = Audio.playSFX("dash.wav")
local haveBoosted = false;
local haveBoostedDown = false;
function onLoop()
if player:mem(0x146, FIELD_WORD) == 2 then
HaveBoosted = false;
HaveBoostedDown = false;
end
end
function onStart()
for i = 1, 7 do
Level.loadPlayerHitboxes(4, i, "toad-"..tostring(i)..".ini");
end
end
function OnLoop()
if player.jumpKeyPressing == true then
if (player:mem(0xF8, FIELD_WORD) == -1)then
if player.rightKeyPressing == true then
if haveBoosted == false then
player.speedX = -5
Audio.playSFX("dash.wav")
do haveBoosted = true;
end
elseif player.leftKeyPressing == true then
if haveBoosted == false then
player.speedX = 5
Audio.playSFX("dash.wav")
do haveBoosted = true;
end
elseif player.downKeyPressing == true then
if haveBoostedDown == false then
player.speedY = 5
Audio.playSFX("dash.wav")
do haveBoostedDown = true;
do haveBoosted = true;
end
end
end
end
You're missing a lot of ends. You need one for each if, elseif, etc. even if they're consecutive. Also, instead of dong something like this:
Code: Select all
if a == 2 then
if b then
if c == "foo" then
end
end
end
Do this instead:
Code: Select all
if (a == 2) and (b) and (c == "foo") then
end
I've mentioned this before too and also told you to use onTick()
Re: Need help with lua? - LunaLua General Help
Posted: Sun Apr 02, 2017 11:06 am
by Devan2002
How would I make it so that if I wanted enemies to have a change of dropping a bomb or a key when Link kills it, how would you it?
Re: Need help with lua? - LunaLua General Help
Posted: Sun Apr 02, 2017 10:45 pm
by PersonNamedUser
Of course when i fix one problem i run into another one.
Basically, no error message comes up when i run the level, but the code literally isn't doing crap, do you
know why?
This is it by the way:
Code: Select all
local haveBoosted = false;
local haveBoostedDown = false;
function onTick()
if player:mem(0x146, FIELD_WORD) == 2 then
HaveBoosted = false;
HaveBoostedDown = false;
end
end
function onStart()
Level.loadPlayerHitBoxes(4, 1, "toad-1.ini")
Level.loadPlayerHitBoxes(4, 2, "toad-2.ini")
Level.loadPlayerHitBoxes(4, 3, "toad-3.ini")
Level.loadPlayerHitBoxes(4, 4, "toad-4.ini")
Level.loadPlayerHitBoxes(4, 5, "toad-5.ini")
Level.loadPlayerHitBoxes(4, 6, "toad-6.ini")
Level.loadPlayerHitBoxes(4, 7, "toad-7.ini")
end
function OnTick()
if player:mem(0x146, FIELD_WORD == 0) and (player:mem(0xF4, FIELD_WORD) == true) and player.rightKeyPressing then
if haveBoosted == false then
player.speedX = -5
Audio.playSFX("dash.wav")
do haveBoosted = true;
end
elseif player:mem(0x146, FIELD_WORD == 0) and (player:mem(0xF4, FIELD_WORD) == true) and player.leftKeyPressing then
if haveBoosted == false then
player.speedX = 5
Audio.playSFX("dash.wav")
do haveBoosted = true;
end
elseif player:mem(0x146, FIELD_WORD == 0) and (player:mem(0xF4, FIELD_WORD) == true) and player.downKeyPressing then
if haveBoostedDown == false then
player.speedY = 5
Audio.playSFX("dash.wav")
do haveBoostedDown = true;
do haveBoosted = true;
end
end
end
end
end
end
end
btw, i know i changed back the hitbox code, but the other didn't work for me for some reason.