Page 42 of 76

Re: Need help with lua? - LunaLua General Help

Posted: Sun Dec 25, 2016 2:01 pm
by darkhog
What about my speed issue?

Re: Need help with lua? - LunaLua General Help

Posted: Sun Dec 25, 2016 3:21 pm
by Emral
darkhog wrote:What about my speed issue?
Check the posts in the thread more carefully.

Re: Need help with lua? - LunaLua General Help

Posted: Sun Dec 25, 2016 4:47 pm
by darkhog
Kinda hard for 40+ pages long thread, now is It? And smbx and lunalua isn't nearly popular enough for me to be easily able to google the answer, which I usually do for other frameworks/libraries/languages. Also you've completely missed the point. The walking right is already done, but player is walking too fast (at the normal speed, which is fine for gameplay, but not for the "cutscene mode" where it should be about 50% slower). Your code is about locking player movement so it will walk right, not about setting the speeds/restoring it. Re-read my question and the code I've provided.

Re: Need help with lua? - LunaLua General Help

Posted: Sun Dec 25, 2016 9:30 pm
by PixelPest
You really don't need to be so rude to Enjl; he's just trying to help and he doesn't have to, but does anyway. He never said read all of the pages in the thread and he hasn't missed the point, you just haven't explained yourself very well. And he answered your question if you read one of the posts on the last page:
it sets the speed for one frame.
You want to set player.speedX to a certain value onTick(), not onLoad()

Re: Need help with lua? - LunaLua General Help

Posted: Sun Dec 25, 2016 9:45 pm
by Emral
darkhog wrote:Kinda hard for 40+ pages long thread, now is It? And smbx and lunalua isn't nearly popular enough for me to be easily able to google the answer, which I usually do for other frameworks/libraries/languages. Also you've completely missed the point. The walking right is already done, but player is walking too fast (at the normal speed, which is fine for gameplay, but not for the "cutscene mode" where it should be about 50% slower). Your code is about locking player movement so it will walk right, not about setting the speeds/restoring it. Re-read my question and the code I've provided.
First off, my reply is literally the post below the one where you asked the question.
Secondly, sorry for misreading your post but you could've maybe addressed that directly rather than asking into the open "oh what about my issue".
Thirdly, Defines.player_walkspeed.
http://wohlsoft.ru/pgewiki/SMBX_Fields

Re: Need help with lua? - LunaLua General Help

Posted: Sun Dec 25, 2016 10:45 pm
by darkhog
I see. Though IMO stuff like walkspeed should be inside Player class. Would make more sense than if it is in defines (and you could make it so players 1 and 2 have different speed, e.g. as part of a powerup).

Re: Need help with lua? - LunaLua General Help

Posted: Sun Dec 25, 2016 10:48 pm
by PixelPest
It makes perfect sense where it is; defines objects are set once and act as a setting that lasts until it is modified at a later time or the process is restarted (level, episode, etc.) while the Player class manages things during a single tick during runtime. As I mentioned before though, you can always just modify speedX as player1.speedX and player2.speedX

Re: Need help with lua? - LunaLua General Help

Posted: Mon Dec 26, 2016 7:18 pm
by Fuyu
Is it possible to use arabsalmon's SMWcamera.lua to resize the screen width and height to that of the original SMW? If not, is there a way to do this?

Re: Need help with lua? - LunaLua General Help

Posted: Tue Dec 27, 2016 9:27 am
by Emral
Intuition wrote:Is it possible to use arabsalmon's SMWcamera.lua to resize the screen width and height to that of the original SMW? If not, is there a way to do this?
SMWcamera.lua is for the movements of the camera. You CAN draw a black box around the SMW camera's resolution, but the issue with that is NPC spawn range. I don't know if there's a way to modify that yet.

Re: Need help with lua? - LunaLua General Help

Posted: Tue Dec 27, 2016 9:33 am
by PixelPest
You could try checking if an NPC is fully underneath the black box and if so set its mem value for offscreen to (-1) and also set the player's speedX to 0 if they are touching it

Re: Need help with lua? - LunaLua General Help

Posted: Tue Dec 27, 2016 9:34 am
by Emral
PixelPest wrote:You could try checking if an NPC is fully underneath the black box and if so set its mem value for offscreen to (-1) and also set the player's speedX to 0 if they are touching it
3 second despawn rule though?

Re: Need help with lua? - LunaLua General Help

Posted: Tue Dec 27, 2016 9:36 am
by PixelPest
You could use pnpc.lua to set a despawn timer

Re: Need help with lua? - LunaLua General Help

Posted: Tue Dec 27, 2016 9:40 am
by Emral
PixelPest wrote:You could use pnpc.lua to set a despawn timer
And then you have to account for npcs that enter the old screen but are still despawning on the newer one... should be doable, but it looks like a big pile of spaghetticode in my mind :p

Re: Need help with lua? - LunaLua General Help

Posted: Tue Dec 27, 2016 10:35 am
by Fuyu
That seems to be kind of a lame way to execute it, and zoom wouldn't work properly either. I might as well just give up then. :V

Re: Need help with lua? - LunaLua General Help

Posted: Fri Dec 30, 2016 4:29 pm
by Fuyu
So I have a question, do onTick functions work in the overworld? If so, is it possible to print text in the overworld? Because I'm trying display some simple text in the overworld and I can't.

EDIT: Nevermind, found the stupid problem, me.

Re: Need help with lua? - LunaLua General Help

Posted: Mon Jan 02, 2017 7:21 pm
by Angelus
Is there any way of disabling the climbing without having to disable the Up key? Or, maybe, to turn a climbable NPC into something that the player can't interact with, while NPCs such as Hoopsters still can? Similar to the SMB2 trees, which a Hoopster can climb but not the player.

Re: Need help with lua? - LunaLua General Help

Posted: Mon Jan 02, 2017 9:59 pm
by PixelPest
http://wohlsoft.ru/pgewiki/SMBX_Player_Offsets

0x40 is climbing state. You should be able to force it to a certain value to prevent the player from ever climbing

Re: Need help with lua? - LunaLua General Help

Posted: Tue Jan 03, 2017 1:50 am
by King of GETs
So I was diving into LunaLua, and I got it to work in the editor, but it only works with "Test -> LunaTest -> Run testing" and NOT "Test Level <Alpha>" or "Test a saved file".

Is this normal?

Re: Need help with lua? - LunaLua General Help

Posted: Tue Jan 03, 2017 3:04 am
by Hoeloe
King of GETs wrote:So I was diving into LunaLua, and I got it to work in the editor, but it only works with "Test -> LunaTest -> Run testing" and NOT "Test Level <Alpha>" or "Test a saved file".

Is this normal?
Yes. "Test Level <Alpha>" is the alpha PGE engine, not SMBX.

You can also hit F5 as a shortcut, though, so I suggest trying that.

Re: Need help with lua? - LunaLua General Help

Posted: Thu Jan 05, 2017 3:45 am
by King of GETs
Hoeloe wrote:
King of GETs wrote:So I was diving into LunaLua, and I got it to work in the editor, but it only works with "Test -> LunaTest -> Run testing" and NOT "Test Level <Alpha>" or "Test a saved file".

Is this normal?
Yes. "Test Level <Alpha>" is the alpha PGE engine, not SMBX.

You can also hit F5 as a shortcut, though, so I suggest trying that.
Thanks, will do.