Page 1 of 1
Effect help?
Posted: Thu Feb 15, 2018 11:18 am
by IAmPlayer
So, i did everything from PixelPest on my thread in Help and Support. But, it happened again. I tried the code but it doesn't work. What's left? (effect-89 is Wiggler's, effect-138 is Lemmy's)
Code: Select all
function onDraw()
for _, anim in ipairs(Animation.get89) do
anim.width = 96;
anim.height = 36;
for _, anim in ipairs(Animation.get138) do
anim.width = 32;
anim.height = 64;
end
end
end
end
Re: Effect help?
Posted: Thu Feb 15, 2018 11:30 am
by The Dwarven Digger
You're ends are in the wrong places. It should go like this:
Code: Select all
function onDraw()
for _, anim in ipairs(Animation.get89) do
anim.width = 96;
anim.height = 36;
end
for _, anim in ipairs(Animation.get138) do
anim.width = 32;
anim.height = 64;
end
end
Re: Effect help?
Posted: Thu Feb 15, 2018 11:37 am
by IAmPlayer
The Dwarven Digger wrote:You're ends are in the wrong places. It should go like this:
Code: Select all
function onDraw()
for _, anim in ipairs(Animation.get89) do
anim.width = 96;
anim.height = 36;
end
for _, anim in ipairs(Animation.get138) do
anim.width = 32;
anim.height = 64;
end
end
Oh. Well, at least i know what to do when i have to do this again, then. Thanks!
Re: Effect help?
Posted: Thu Feb 15, 2018 11:46 am
by The0x539
1AmPlayer wrote:Animation.get138
This isn't a thing.
Animation.get is a
function, with one
argument, the ID.
Re: Effect help?
Posted: Thu Feb 15, 2018 6:57 pm
by IAmPlayer
So, now like this? because the Animation.get is the ID?
Code: Select all
function onDraw()
for _, anim in ipairs(89) do
anim.width = 96;
anim.height = 36;
end
for _, anim in ipairs(138) do
anim.width = 32;
anim.height = 64;
end
end
Re: Effect help?
Posted: Thu Feb 15, 2018 8:06 pm
by Hoeloe
What do those numbers refer to now? How does the program know you're talking about animation objects, and not NPCs?
You still need Animation.get, you were just not using it correctly, syntax-wise.
Re: Effect help?
Posted: Thu Feb 15, 2018 8:27 pm
by IAmPlayer
I'm terribly confused. the number is the NPC id's effect, but you can't resize them with txt. So, i don't get it. the number is (id) so, does with brackets work?
Code: Select all
function onDraw()
for _, anim in ipairs(Animation.get(89)) do
anim.width = 96;
anim.height = 36;
end
for _, anim in ipairs(Animation.get(138)) do
anim.width = 32;
anim.height = 64;
end
end
Re: Effect help?
Posted: Thu Feb 15, 2018 8:56 pm
by Hoeloe
I'd suggest you actually test some of these to see for yourself.
Also, you may want to take some basic Lua tutorials to get a grasp of what you're doing, at the moment you're sort of floundering and the correct code you have written is a result of guesswork rather than understanding.
Re: Effect help?
Posted: Fri Feb 16, 2018 10:14 am
by IAmPlayer
Screw it. I'm just going to recreate the effects. I don't get anything, and this is my first time on LUA, so i'm stuck af.
Also, i tested the codes tons of times, it didn't work. Sometimes it even glitched the UI.
Re: Effect help?
Posted: Fri Feb 16, 2018 2:54 pm
by Hoeloe
1AmPlayer wrote:Screw it. I'm just going to recreate the effects. I don't get anything, and this is my first time on LUA, so i'm stuck af.
Also, i tested the codes tons of times, it didn't work. Sometimes it even glitched the UI.
Your previous code was correct. It didn't "glitch the UI", it errored, and you didn't give the error messages.
Re: Effect help?
Posted: Fri Feb 16, 2018 7:12 pm
by IAmPlayer
Hoeloe wrote:Your previous code was correct. It didn't "glitch the UI", it errored, and you didn't give the error messages.
It didn't crash the game. Just the UI is glitched when starting the level, like the 1UP sprite is replaced with the wiggler's death effect, then goes back to normal.
Re: Effect help?
Posted: Fri Feb 16, 2018 7:46 pm
by Hoeloe
1AmPlayer wrote:Hoeloe wrote:Your previous code was correct. It didn't "glitch the UI", it errored, and you didn't give the error messages.
It didn't crash the game. Just the UI is glitched when starting the level, like the 1UP sprite is replaced with the wiggler's death effect, then goes back to normal.
That is... not possible with the code you've posted.
You are using SMBX2, and testing with LunaTester (not PGE Alpha tester) right?
Re: Effect help?
Posted: Fri Feb 16, 2018 7:49 pm
by IAmPlayer
Yes. I did use the LunaTester. Do i have to test it in SMBX launcher itself (as a world)?
Re: Effect help?
Posted: Fri Feb 16, 2018 8:51 pm
by Hoeloe
No, LunaTester is exactly the same thing, but the PGE Alpha Tester is not, and won't work correctly. I find it very hard to believe the effect you're stating is caused by that code.
Could you please take a screenshot of your level folder, and post the entire contents of the code file you're using here?
Re: Effect help?
Posted: Fri Feb 16, 2018 9:09 pm
by IAmPlayer
Re: Effect help?
Posted: Fri Feb 16, 2018 10:34 pm
by The0x539
Your file is named either luna.txt or luna.lua (impossible to tell from screenshots) instead of lunadll.lua, so the code isn't even running. Something else is causing your bizarre issue.
Re: Effect help?
Posted: Fri Feb 16, 2018 10:39 pm
by PixelPest
Also which 1-up sprite is replaced with the Wiggler's death effect? Are you sure you chose the right effect number to replace? Also as 0x said, that has nothing to do with LunaLua as your code isn't even running
Re: Effect help?
Posted: Fri Feb 16, 2018 11:11 pm
by IAmPlayer
PixelPest wrote:Also which 1-up sprite is replaced with the Wiggler's death effect?
The 1UP hardcoded text one. Also, it worked now. No errors, nothing. It worked.