Effect help?

This is the place for discussion and support for LunaLua and related modifications and libraries.

Moderator: Userbase Moderators

Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
IAmPlayer
Volcano Lotus
Volcano Lotus
Posts: 560
Joined: Sun May 21, 2017 3:36 am
Flair: I'm a hellspawn.
Pronouns: he/him
Contact:

Effect help?

Postby IAmPlayer » Thu Feb 15, 2018 11:18 am

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

The Dwarven Digger
Lakitu
Lakitu
Posts: 484
Joined: Sun Oct 30, 2016 11:17 am
Pronouns: they/them

Re: Effect help?

Postby The Dwarven Digger » Thu Feb 15, 2018 11:30 am

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

IAmPlayer
Volcano Lotus
Volcano Lotus
Posts: 560
Joined: Sun May 21, 2017 3:36 am
Flair: I'm a hellspawn.
Pronouns: he/him
Contact:

Re: Effect help?

Postby IAmPlayer » Thu Feb 15, 2018 11:37 am

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!

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Effect help?

Postby The0x539 » Thu Feb 15, 2018 11:46 am

1AmPlayer wrote:Animation.get138
This isn't a thing.
Animation.get is a function, with one argument, the ID.

IAmPlayer
Volcano Lotus
Volcano Lotus
Posts: 560
Joined: Sun May 21, 2017 3:36 am
Flair: I'm a hellspawn.
Pronouns: he/him
Contact:

Re: Effect help?

Postby IAmPlayer » Thu Feb 15, 2018 6:57 pm

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

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Effect help?

Postby Hoeloe » Thu Feb 15, 2018 8:06 pm

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.

IAmPlayer
Volcano Lotus
Volcano Lotus
Posts: 560
Joined: Sun May 21, 2017 3:36 am
Flair: I'm a hellspawn.
Pronouns: he/him
Contact:

Re: Effect help?

Postby IAmPlayer » Thu Feb 15, 2018 8:27 pm

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

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Effect help?

Postby Hoeloe » Thu Feb 15, 2018 8:56 pm

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.

IAmPlayer
Volcano Lotus
Volcano Lotus
Posts: 560
Joined: Sun May 21, 2017 3:36 am
Flair: I'm a hellspawn.
Pronouns: he/him
Contact:

Re: Effect help?

Postby IAmPlayer » Fri Feb 16, 2018 10:14 am

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.

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Effect help?

Postby Hoeloe » Fri Feb 16, 2018 2:54 pm

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.

IAmPlayer
Volcano Lotus
Volcano Lotus
Posts: 560
Joined: Sun May 21, 2017 3:36 am
Flair: I'm a hellspawn.
Pronouns: he/him
Contact:

Re: Effect help?

Postby IAmPlayer » Fri Feb 16, 2018 7:12 pm

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.

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Effect help?

Postby Hoeloe » Fri Feb 16, 2018 7:46 pm

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?

IAmPlayer
Volcano Lotus
Volcano Lotus
Posts: 560
Joined: Sun May 21, 2017 3:36 am
Flair: I'm a hellspawn.
Pronouns: he/him
Contact:

Re: Effect help?

Postby IAmPlayer » Fri Feb 16, 2018 7:49 pm

Yes. I did use the LunaTester. Do i have to test it in SMBX launcher itself (as a world)?

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Effect help?

Postby Hoeloe » Fri Feb 16, 2018 8:51 pm

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?

IAmPlayer
Volcano Lotus
Volcano Lotus
Posts: 560
Joined: Sun May 21, 2017 3:36 am
Flair: I'm a hellspawn.
Pronouns: he/him
Contact:

Re: Effect help?

Postby IAmPlayer » Fri Feb 16, 2018 9:09 pm

ImageImageImage

If the codes doesn't work, can you, like, try it to make it work?

The0x539
Eerie
Eerie
Posts: 751
Joined: Fri Jan 22, 2016 8:02 pm

Re: Effect help?

Postby The0x539 » Fri Feb 16, 2018 10:34 pm

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.

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Effect help?

Postby PixelPest » Fri Feb 16, 2018 10:39 pm

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

IAmPlayer
Volcano Lotus
Volcano Lotus
Posts: 560
Joined: Sun May 21, 2017 3:36 am
Flair: I'm a hellspawn.
Pronouns: he/him
Contact:

Re: Effect help?

Postby IAmPlayer » Fri Feb 16, 2018 11:11 pm

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.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari