Page 26 of 76
Re: Need help with lua? - LunaLua General Help
Posted: Tue May 31, 2016 12:50 pm
by zlaker
Is there a way I can set the direction of an NPC like left or right?
Re: Need help with lua? - LunaLua General Help
Posted: Tue May 31, 2016 12:55 pm
by Emral
zlakergirl357 wrote:Is there a way I can set the direction of an NPC like left or right?
NPC.direction = (-1 for left, 1 for right)
Re: Need help with lua? - LunaLua General Help
Posted: Sat Jun 11, 2016 4:28 am
by RhysOwens
How do I change the projectile that an NPC throws. You could do something like that easily in LunaDLL.
Re: Need help with lua? - LunaLua General Help
Posted: Sat Jun 11, 2016 5:38 am
by Emral
RhysOwens wrote:How do I change the projectile that an NPC throws. You could do something like that easily in LunaDLL.
The easy and lazy way to turn all NPC A into NPC B is:
Code: Select all
function onTick()
local transform = NPC.get(npcID, section)
for k,v in pairs(transform) do
v.id = otherNPCID
end
end
Re: Need help with lua? - LunaLua General Help
Posted: Sat Jun 11, 2016 1:33 pm
by RhysOwens
This was my code:
Code: Select all
function onTick()
local transform = NPC.get(87, 1)
for k,v in pairs(transform) do
v.id = 1
end
end
I tried to make Bowser shoot Goombas instead of flames but he still shoots flames.
Re: Need help with lua? - LunaLua General Help
Posted: Sat Jun 11, 2016 1:41 pm
by HenryRichard
Change the 1 to -1.
Re: Need help with lua? - LunaLua General Help
Posted: Sat Jun 11, 2016 2:00 pm
by underFlo
(That's the first 1 he's talking about btw)
Re: Need help with lua? - LunaLua General Help
Posted: Sat Jun 11, 2016 4:38 pm
by RhysOwens
Spinda wrote:(That's the first 1 he's talking about btw)
Thanks dude, it now works. Now I made Bowser shoot Rinkas. Has anyone done that?
Update = How do you fix the fact that the sprites look wrong when they are thrown as a replacement?
And how can you make SMB1 Bowser not shoot flames at all? When I set NPC-87 replacement to 0 the flame appears for only a split-second.
Re: Need help with lua? - LunaLua General Help
Posted: Sun Jun 12, 2016 9:49 am
by h2643
Re: Need help with lua? - LunaLua General Help
Posted: Tue Jun 14, 2016 7:49 am
by Xirix
Out of curiousity, has anyone made Horizontal moving Thwomps, or the ability to have Diagonal projectiles (Aka Mario 3 Cannons)? If not, where should I start about trying to code these myself?
Re: Need help with lua? - LunaLua General Help
Posted: Tue Jun 14, 2016 8:27 am
by PixelPest
Xirix wrote:Out of curiousity, has anyone made Horizontal moving Thwomps, or the ability to have Diagonal projectiles (Aka Mario 3 Cannons)? If not, where should I start about trying to code these myself?
Rednaxela used horizontal-moving "Maverick" Thwomps in a MaGLx2 level. Diagonal projectiles are much simpler and only involve making the values for NPC.speedX and NPC.speedY have the same absolute values
Re: Need help with lua? - LunaLua General Help
Posted: Wed Jun 15, 2016 9:41 am
by S1eth
What is the undocumented glDraw argument "sceneCoords" and how do I use it?
Re: Need help with lua? - LunaLua General Help
Posted: Wed Jun 15, 2016 10:49 am
by Emral
S1eth wrote:What is the undocumented glDraw argument "sceneCoords" and how do I use it?
"sceneCoords = true" will set the coordinates for the verteces to be scene coordinates, rather than screen coordinates.
Re: Need help with lua? - LunaLua General Help
Posted: Wed Jun 15, 2016 11:00 pm
by Alagirez
Is that possible to make the player fly (with leaf, tanooki, etc (not a blue shoe lol)) without limit? (aka Infinite flying)
Re: Need help with lua? - LunaLua General Help
Posted: Wed Jun 15, 2016 11:18 pm
by TheUNICORNTrap
Hey I need to know if I can install this game for the mac. I am a new player and am interested in starting this out.
PLEASE reply thank you.
Re: Need help with lua? - LunaLua General Help
Posted: Wed Jun 15, 2016 11:25 pm
by S1eth
Camacho wrote:Is that possible to make the player fly (with leaf, tanooki, etc (not a blue shoe lol)) without limit? (aka Infinite flying)
http://www.wohlsoft.ru/pgewiki/SMBX_Player_Offsets
This page has some helpful memory addresses. Scroll down to flight related adresses.
You can use "Flight time remaining" to make sure that it does not count down while you are flying. Set it with Player:mem()
http://www.wohlsoft.ru/pgewiki/Player_(class)
You probably want to check for "isFlying" first, and if true, set the "flight time remaining" to a certain value.
.
Re: Need help with lua? - LunaLua General Help
Posted: Sat Jun 18, 2016 4:44 am
by Lukas Old Account
So ehm, anyone here knows how to make a code that there is red fog that becomes less transparent each time the player walks one screen further?
Re: Need help with lua? - LunaLua General Help
Posted: Sat Jun 18, 2016 6:42 am
by S1eth
Lukas wrote:So ehm, anyone here knows how to make a code that there is red fog that becomes less transparent each time the player walks one screen further?
You will have two x coordinates in your level. The first one for when you want to start drawing fog, and the second one for when you want your fog to reach full opacity. (let's call them A and B)
So, you want to take the player's x (player.x) coordinate, or the player camera's x coordinate ( Camera.get()[1]x+Camera.get(){1].width ) and check if they are within your points A and B.
If you draw a single fog image, you can use Graphics.drawImageWP and set your opacity depending on the x coordinate difference of the player and point A/B.
http://wohlsoft.ru/pgewiki/LunaLua_glob ... _functions
If you want to use fog particles, look for:
http://wohlsoft.ru/pgewiki/Particles.lua
Re: Need help with lua? - LunaLua General Help
Posted: Sat Jun 18, 2016 7:13 am
by RhysOwens
Okay, I've loaded the Level Timer API into my level but the new UI graphics don't appear. I've tried putting those graphics into my level's folder but nothing happened.
Re: Need help with lua? - LunaLua General Help
Posted: Sat Jun 18, 2016 7:31 am
by PixelPest
RhysOwens wrote:Okay, I've loaded the Level Timer API into my level but the new UI graphics don't appear. I've tried putting those graphics into my level's folder but nothing happened.
Have you actually set the timer using setSecondsLeft() and setTimerState() ?