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?
|
|
|
|
-
PixelPest
- Link

- Posts: 7111
- Joined: Sun Jul 12, 2015 5:38 pm
- Flair: Tamer of Boom Booms
-
Contact:
Postby PixelPest » Sat Feb 13, 2016 9:04 pm
Okay, so how would I do that only for NPC 229 or how would I teleport it off of the screen?
|
|
|
|
|
|
|
|
|
-
snoruntpyro
- Snifit

- Posts: 226
- Joined: Sun Oct 11, 2015 9:36 am
- Pronouns: she/her
-
Contact:
Postby snoruntpyro » Sat Feb 13, 2016 9:19 pm
PixelPest wrote:Okay, so how would I do that only for NPC 229 or how would I teleport it off of the screen?
For teleporting it offscreen you could probably just do v.x = 0.
|
|
|
|
|
|
|
|
|
-
lotus006
- Spike

- Posts: 284
- Joined: Thu Sep 24, 2015 12:59 am
Postby lotus006 » Sat Feb 13, 2016 9:21 pm
Code: Select all function onLoop()
for _,v in pairs(NPC.get(229,player.section)) do
if #Block.getIntersecting(v.x,v.y,v.x + v.width,v.y + v.height) > 0 then
v:kill(7)
Audio.sounds[9].muted = true -- for muting the death song of the npc 229
end
end
end
|
|
|
|
|
|
|
|
|
-
PixelPest
- Link

- Posts: 7111
- Joined: Sun Jul 12, 2015 5:38 pm
- Flair: Tamer of Boom Booms
-
Contact:
Postby PixelPest » Sat Feb 13, 2016 9:30 pm
Code: Select all function onLoop()
for _,v in pairs(NPC.get(229,player.section)) do
if #Block.getIntersecting(v.x,v.y,v.x + v.width,v.y + v.height) > 0 then
v:x=0
end
end
end
Is it just as simple as that Pyro?
|
|
|
|
|
|
|
|
|
-
lotus006
- Spike

- Posts: 284
- Joined: Thu Sep 24, 2015 12:59 am
Postby lotus006 » Sat Feb 13, 2016 9:52 pm
PixelPest wrote:Code: Select all function onLoop()
for _,v in pairs(NPC.get(229,player.section)) do
if #Block.getIntersecting(v.x,v.y,v.x + v.width,v.y + v.height) > 0 then
v:x=0
end
end
end
Is it just as simple as that Pyro?
or this to mute the sound you wanted to do on first:
Code: Select all Audio.sounds[9].muted = true -- for muting the death song of the npc 229
|
|
|
|
|
|
|
|
|
-
PixelPest
- Link

- Posts: 7111
- Joined: Sun Jul 12, 2015 5:38 pm
- Flair: Tamer of Boom Booms
-
Contact:
Postby PixelPest » Sat Feb 13, 2016 9:56 pm
Okay. Thanks lotus006. The issue I'm wondering about with muting the audio there, is will it remove the death sound for all NPCs?
|
|
|
|
|
|
|
|
|
-
lotus006
- Spike

- Posts: 284
- Joined: Thu Sep 24, 2015 12:59 am
Postby lotus006 » Sat Feb 13, 2016 9:58 pm
PixelPest wrote:Okay. Thanks lotus006. The issue I'm wondering about with muting the audio there, is will it remove the death sound for all NPCs?
nope only for this command and this fish
|
|
|
|
|
|
|
|
|
-
PixelPest
- Link

- Posts: 7111
- Joined: Sun Jul 12, 2015 5:38 pm
- Flair: Tamer of Boom Booms
-
Contact:
Postby PixelPest » Sat Feb 13, 2016 10:00 pm
lotus006 wrote:PixelPest wrote:Okay. Thanks lotus006. The issue I'm wondering about with muting the audio there, is will it remove the death sound for all NPCs?
nope only for this command and this fish
Awesmazing; thanks.
|
|
|
|
|
|
|
|
|
-
Kevsoft
- Ripper II

- Posts: 375
- Joined: Sun Jul 27, 2014 8:03 am
Postby Kevsoft » Sun Feb 14, 2016 2:23 am
Some corrections here:
1.) If you mute sound id 9 you have to unmute it afterwards. Yes it is global.
2.) If you just want to "vanish" an npc (meaning no sound and no effects), then you can use npc:kill(9)
|
|
|
|
|
|
|
|
|
-
lotus006
- Spike

- Posts: 284
- Joined: Thu Sep 24, 2015 12:59 am
Postby lotus006 » Sun Feb 14, 2016 6:36 am
like this ?
Code: Select all function onLoop()
if (player.runKeyPressing) then
for _,v in pairs(NPC.get(229,player.section)) do
if #Block.getIntersecting(v.x,v.y,v.x + v.width,v.y + v.height) > 0 then
Audio.sounds[9].muted = true -- for muting the death song of the npc 229
end
end
else
Audio.sounds[9].muted = false -- for unmuting the death song of the npc 229
end
end
|
|
|
|
|
|
|
|
|
-
PixelPest
- Link

- Posts: 7111
- Joined: Sun Jul 12, 2015 5:38 pm
- Flair: Tamer of Boom Booms
-
Contact:
Postby PixelPest » Sun Feb 14, 2016 7:40 am
Kevsoft wrote:Some corrections here:
1.) If you mute sound id 9 you have to unmute it afterwards. Yes it is global.
2.) If you just want to "vanish" an npc (meaning no sound and no effects), then you can use npc:kill(9)
Thanks. npc:kill(9) will make things so much easier.
|
|
|
|
|
|
|
|
|
-
TDK
- Phanto

- Posts: 1440
- Joined: Wed Nov 11, 2015 12:26 pm
- Flair: Retired
Postby TDK » Sun Feb 14, 2016 8:01 am
When using the multipoints API, the checkpoint is still active even after the level is finished. Is there a way to deactive the checkpoint after finishing the level?
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Phanto

- Posts: 1465
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
Postby Hoeloe » Sun Feb 14, 2016 2:20 pm
TheDinoKing432 wrote:When using the multipoints API, the checkpoint is still active even after the level is finished. Is there a way to deactive the checkpoint after finishing the level?
This shouldn't be the case. The checkpoints are activated by the SMBX checkpoint code, so they should only activate if a regular SMBX midpoint would be active in that level.
Which version of the API are you using? (You can find this out by opening multipoints.lua and looking at the version number)
|
|
|
|
|
|
|
|
|
-
Nat The Porcupine
- Monty Mole

- Posts: 123
- Joined: Tue Nov 10, 2015 2:55 pm
Postby Nat The Porcupine » Sun Feb 14, 2016 6:01 pm
I am yet again having issues with this standing animation for Mario. It keeps saying something to the effect of 'sprites' is a nil value in the Graphics class.
source code:
Code: Select all loadHitboxes(1, 2, "mario-2.ini")
local imgSuperMarioStand = {}
function onLoad()
imgSuperMarioStand = Graphics.loadImage("SuperMarioStand.png")
end
function onLoop()
if player.speedX == 0 and player.speedY == 0 and player:mem(0x114,FIELD_WORD) == 1 then
Graphics.sprites.mario[2].img = imgSuperMarioStand
else
Graphics.sprites.mario[2].img = nil
end
end
help me out?
|
|
|
|
|
|
|
|
|
-
Hoeloe
- Phanto

- Posts: 1465
- Joined: Sat Oct 03, 2015 6:18 pm
- Flair: The Codehaus Girl
- Pronouns: she/her
Postby Hoeloe » Sun Feb 14, 2016 6:29 pm
Nat The Porcupine wrote:
help me out?
This sounds like you have an older version of LunaLua. The newest version is 0.7.3.
|
|
|
|
|
|
|
|
|
-
lotus006
- Spike

- Posts: 284
- Joined: Thu Sep 24, 2015 12:59 am
Postby lotus006 » Mon Feb 15, 2016 1:54 am
I have just a question if is possible to emulate with a value offsets like the player is pushing the shell and the shell will
do the normal way when collide on stuff ? (or just more simple like the click button in the animation intro of the hand ?)
Thanks
|
|
|
|
|
|
|
|
|
-
PixelPest
- Link

- Posts: 7111
- Joined: Sun Jul 12, 2015 5:38 pm
- Flair: Tamer of Boom Booms
-
Contact:
Postby PixelPest » Mon Feb 15, 2016 6:42 pm
How do I define variables in my lunaworld.lua, such as:
...and then use and redefine the value held in lunaworld.lua in my lunadll.lua file for a level in an episode:
Code: Select all function onLoad
if firsttime == true then
firsttime = false
player.Powerup = 2
end
end
|
|
|
|
|
|
|
|
|
-
Kevsoft
- Ripper II

- Posts: 375
- Joined: Sun Jul 27, 2014 8:03 am
Postby Kevsoft » Tue Feb 16, 2016 12:56 am
|
|
|
|
|
|
|
|
|
-
PixelPest
- Link

- Posts: 7111
- Joined: Sun Jul 12, 2015 5:38 pm
- Flair: Tamer of Boom Booms
-
Contact:
Postby PixelPest » Tue Feb 16, 2016 6:35 am
Kevsoft wrote:You can use _G variable:
Okay. Thank you. Where do I define this variable (lunadll.lua or lunaworld.lua)?
|
|
|
|
|
Return to “LunaLua”
Users browsing this forum: No registered users and 0 guests
|