Page 1 of 1

Wind effect using lunalua

Posted: Sat Mar 25, 2017 9:17 am
by ShaolinTrunks
Clips you through Walls! This is a wind effect I found using lunalua. Clips you through Walls! I know this is basic information to a lot of users. For a begginner like me, I have questions about these types of things. After some research here is what I had came up for anyone who wants the same in they're level. Kevsoft posted wind.lua on the wohlsoft forum. The post was here: http://wohlsoft.ru/forum/viewtopic.php?t=329 and the link is not working. It is possible to make a wind effect using lunalua. I contacted Kevsoft on Discord. He gave some friendly advice.

I am sure you can build an API around this. For me I Put this into my lunadll.lua file for the level with wind:
Spoiler: show
function onTick()
player.x = player.x + 2
end
^ This will move your character every tick to the right. Fast speeds around (3 to 5). Try (+ 1,+ 2 ) to get lower speeds and also negative values (- 1, - 2, ) to make your character go left.

You could possibly try using this for up and down as well by typing this:
Spoiler: show
function onTick()
player.y = player.y - 1
end
Which will push you up or down, same rules as above. I haven't found a use for it yet. When it pushes you down, you don't jump as high so it can be used in that case. The pushing me up doesn't make me float, just glitches the character on the ground. Maybe could be used for falling levels so maybe you don't fall as fast, I'd like to test. Obviously this is small amount of code using lunalua and is basic. There is more ways you could use this information with all the other lunalua code to maybe turn on and off the wind in your level. Or only have wind at certain spots etc. the possibilities only limited by lunalua which I am still learning. Thanks.

Re: Wind effect using lunalua

Posted: Sat Mar 25, 2017 6:30 pm
by PixelPest
This could quite possibly cause the player to clip into walls. Have you actually tested this out?

Re: Wind effect using lunalua

Posted: Sat Mar 25, 2017 6:41 pm
by ShaolinTrunks
I did not test it, I just didnt see any answers online on where to start making wind. Have been learning how waddlederp did it in this level...which i did not know existed until today :P viewtopic.php?f=36&t=17410

Yea i tested it, you clip through the blocks...i need to study how to do it better.

Re: Wind effect using lunalua

Posted: Sat Apr 15, 2017 5:21 pm
by HenryRichard
Why not modify the player's speed instead? There shouldn't be a problem with clipping through walls then, and it could potentially be more realistic (though why we would want Mario to be realistic I don't know)

Re: Wind effect using lunalua

Posted: Mon Apr 17, 2017 9:23 am
by ShaolinTrunks
Yea dude. I have found the right resources to make a wind level using lunalua now. I just need some time off work to do other work on my levels lol.

Re: Wind effect using lunalua

Posted: Sun Apr 23, 2017 4:24 pm
by Soronexle
HenryRichard wrote:Why not modify the player's speed instead? There shouldn't be a problem with clipping through walls then, and it could potentially be more realistic (though why we would want Mario to be realistic I don't know)
How can you pull that off? I don't remember a game code that can modify a character's movement speed. Can you give me a code that does that?

Re: Wind effect using lunalua

Posted: Sun Apr 23, 2017 4:32 pm
by loop
Something like playerspeed.x or something I dunno.

Re: Wind effect using lunalua

Posted: Sun Apr 23, 2017 5:53 pm
by PixelPest
Jayce 777 wrote:Something like playerspeed.x or something I dunno.
Really. You didn't even look that up. Guessing in this context usually doesn't work.

You'll want to modify player.speedX and player.speedY. (You can set them by putting one equals sign after and a number value)