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?
|
|
|
|
-
pal4
- Swooper

- Posts: 63
- Joined: Wed Dec 23, 2015 7:57 pm
Postby pal4 » Tue Apr 26, 2016 2:51 pm
Enjl wrote:pal4 wrote:S1eth wrote:
What's the problem? Your code works.
An issue I see with it is that it only works if there is only a single birdo egg in the world at one time.
You are selecting the last index from tableOfBirdoEggs, which does not guarantee that you will get the most recently spawned egg.
For example, if you pick up an egg, your code will turn that egg in your hand into a fireball.
If you want to keep track of bird eggs' livetime, I suggest using pnpc and giving them a tick counter or something.
Another issue is that you're playing two sound effects at the same time, but I haven't played with lua Sound functions enough to know if there is a way to disable the Birdo's sound effect, or swap it out for the fireball sound effect for that one tick only.
Try this:
http://hastebin.com/lujebotuku.lua
This code ignores birdos completely. It only checks if a new birdo egg has been spawned, and 33% of the time, it turns that egg into a Ludwig fireball.
In other words, it even works with multiple birdos at the same time.
Tried it. no luck.
I'm pretty sure that's not how you get an npc id.
npcID.lua includes a bunch of constants for easy use.
NPCID.BIRDOEGG = 40
I'm starting to think your lunadll.lua file is in the wrong directory. Is it one folder down from where the level file is located?
It is. Folder named 29. I'm naming levels by the order I made them (which is also the order I set them up to play in my world).
|
|
|
|
|
|
|
|
|
-
S1eth
- Bot

- Posts: 54
- Joined: Sat Apr 23, 2016 10:44 am
Postby S1eth » Tue Apr 26, 2016 2:53 pm
pal4 wrote:Enjl wrote:pal4 wrote:
Tried it. no luck.
I'm pretty sure that's not how you get an npc id.
npcID.lua includes a bunch of constants for easy use.
NPCID.BIRDOEGG = 40
I'm starting to think your lunadll.lua file is in the wrong directory. Is it one folder down from where the level file is located?
It is. Folder named 29. I'm naming levels by the order I made them (which is also the order I set them up to play in my world).
Can you post an image of your folder hierarchy? (episode, level, level folder, lunadll file)
What error are you getting? Can you also post an image of the error message?
|
|
|
|
|
|
|
|
|
-
pal4
- Swooper

- Posts: 63
- Joined: Wed Dec 23, 2015 7:57 pm
Postby pal4 » Tue Apr 26, 2016 3:08 pm
My world folder, as of this morning:

and folder 29:

No error messages. Birdo simply shoots nothing but eggs. Also, I'm having problems displaying the images without bringing them up.
|
|
|
|
|
|
|
|
|
-
pal4
- Swooper

- Posts: 63
- Joined: Wed Dec 23, 2015 7:57 pm
Postby pal4 » Tue Apr 26, 2016 3:15 pm
actually it came out lunadll.lua.lua. If I renamed it at any point is that bad? 'Cause that was my first attempt to show the file extension.
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9890
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Tue Apr 26, 2016 3:21 pm
pal4 wrote:
actually it came out lunadll.lua.lua. If I renamed it at any point is that bad? 'Cause that was my first attempt to show the file extension.
It absolutely needs to be called "lunadll.lua", where ".lua" is the file extension.
|
|
|
|
|
|
|
|
|
-
pal4
- Swooper

- Posts: 63
- Joined: Wed Dec 23, 2015 7:57 pm
Postby pal4 » Tue Apr 26, 2016 7:12 pm
Hey, thank you! after so long, it finally works! 
|
|
|
|
|
|
|
|
|
-
RhysOwens
- Nipper

- Posts: 423
- Joined: Fri Apr 22, 2016 2:53 am
Postby RhysOwens » Wed Apr 27, 2016 2:37 am
S1eth wrote:Mario_and_Luigi_55 wrote:RhysOwens wrote:Has anyone forgotten about me?
I'm not really making levels with LunaLua right now.
I'm messing around with it and experimenting with it so I can get used to it.
The NPCs all take more hits even when I've set the ID to 1 NPC with HealthPoint.lua.
I have same problem.
It's not you. HealthPoint is bugged.
First of all, when you load the API, it automatically sets all NPCs to 3 health. (the creator apparently thought that was a good idea...)
If you don't want that, you'd want to iterate over all NPC ids and call healthPoint.makeNPCNormal(id), but that doesn't work either.
healthPoint.makeNPCNormal is supposed to remove the entry for a specific NPC id from a table, but instead, it removes the value with the index of the npc id, and then pushes all other indexes in the table forward to fill in the gap.
It's pretty broken.
Here is a fix: http://hastebin.com/anerequxef.lua
Create a new text file inside your level folder. Copy and paste the hastebin text in there. Rename the file to HealthPoint.lua (remove the .txt extension)
Test it by having the following code in your lunadll.lua file for your level:
Code: Select all local healthPoint = API.load("HealthPoint");
--healthPoint.healthbar = true; -- optional, use to activate healthbars above NPCs
for _,id in pairs(healthPoint.allNPCs) do
healthPoint.makeNPCNormal(id);
end
healthPoint.setNPCHealth(1, 3);
This makes a goomba (ID 1) take 3 hits to kill. All other enemies are unaffected.
Your code doesn't work mate.
I tested it and I've edited it a few times and no hope.
|
|
|
|
|
|
|
|
|
-
Mario_and_Luigi_55
- Spike

- Posts: 270
- Joined: Sat Feb 27, 2016 12:01 pm
Postby Mario_and_Luigi_55 » Wed Apr 27, 2016 2:38 am
RhysOwens wrote:S1eth wrote:Mario_and_Luigi_55 wrote:
I have same problem.
It's not you. HealthPoint is bugged.
First of all, when you load the API, it automatically sets all NPCs to 3 health. (the creator apparently thought that was a good idea...)
If you don't want that, you'd want to iterate over all NPC ids and call healthPoint.makeNPCNormal(id), but that doesn't work either.
healthPoint.makeNPCNormal is supposed to remove the entry for a specific NPC id from a table, but instead, it removes the value with the index of the npc id, and then pushes all other indexes in the table forward to fill in the gap.
It's pretty broken.
Here is a fix: http://hastebin.com/anerequxef.lua
Create a new text file inside your level folder. Copy and paste the hastebin text in there. Rename the file to HealthPoint.lua (remove the .txt extension)
Test it by having the following code in your lunadll.lua file for your level:
Code: Select all local healthPoint = API.load("HealthPoint");
--healthPoint.healthbar = true; -- optional, use to activate healthbars above NPCs
for _,id in pairs(healthPoint.allNPCs) do
healthPoint.makeNPCNormal(id);
end
healthPoint.setNPCHealth(1, 3);
This makes a goomba (ID 1) take 3 hits to kill. All other enemies are unaffected.
Your code doesn't work mate.
I tested it and I've edited it a few times and no hope.
Because api has to be in a LuaScriptsLib folder
|
|
|
|
|
|
|
|
|
-
RhysOwens
- Nipper

- Posts: 423
- Joined: Fri Apr 22, 2016 2:53 am
Postby RhysOwens » Wed Apr 27, 2016 2:40 am
Mario_and_Luigi_55 wrote:RhysOwens wrote:S1eth wrote:
It's not you. HealthPoint is bugged.
First of all, when you load the API, it automatically sets all NPCs to 3 health. (the creator apparently thought that was a good idea...)
If you don't want that, you'd want to iterate over all NPC ids and call healthPoint.makeNPCNormal(id), but that doesn't work either.
healthPoint.makeNPCNormal is supposed to remove the entry for a specific NPC id from a table, but instead, it removes the value with the index of the npc id, and then pushes all other indexes in the table forward to fill in the gap.
It's pretty broken.
Here is a fix: http://hastebin.com/anerequxef.lua
Create a new text file inside your level folder. Copy and paste the hastebin text in there. Rename the file to HealthPoint.lua (remove the .txt extension)
Test it by having the following code in your lunadll.lua file for your level:
Code: Select all local healthPoint = API.load("HealthPoint");
--healthPoint.healthbar = true; -- optional, use to activate healthbars above NPCs
for _,id in pairs(healthPoint.allNPCs) do
healthPoint.makeNPCNormal(id);
end
healthPoint.setNPCHealth(1, 3);
This makes a goomba (ID 1) take 3 hits to kill. All other enemies are unaffected.
Your code doesn't work mate.
I tested it and I've edited it a few times and no hope.
Because api has to be in a LuaScriptsLib folder
It was in the LuaScriptsLib folder but the code he gave us still didn't work. 
|
|
|
|
|
|
|
|
|
-
S1eth
- Bot

- Posts: 54
- Joined: Sat Apr 23, 2016 10:44 am
Postby S1eth » Wed Apr 27, 2016 6:26 am
RhysOwens wrote:Mario_and_Luigi_55 wrote:RhysOwens wrote:
Your code doesn't work mate.
I tested it and I've edited it a few times and no hope.
Because api has to be in a LuaScriptsLib folder
It was in the LuaScriptsLib folder but the code he gave us still didn't work. 
It works for me. And I assume it works for Mario_and_Luigi_55 as well?
RhysOwens wrote:It was in the LuaScriptsLib folder but the code he gave us still didn't work. 
Why did you put it there? Those were not the instructions I gave you. If you didn't do that, how will I know if you followed all the other steps correctly?
You can put the file either in your level folder, or the LuaScriptsLib folder.
API.load will prioritize local files in the level folder, and if it doesn't find the API there, it'll look in the LuaScriptsLib folder.
It would be nice if you could tell me what error you're getting. I can't do much with "doesn't work".
Make sure the file is called "HealthPoint.lua".
Enable file extensions. Maybe your file is called "HealthPoint.lua.txt".
|
|
|
|
|
|
|
|
|
-
TurtleJosh52
- Hoopster

- Posts: 44
- Joined: Mon Nov 09, 2015 1:52 pm
- Flair: I regret this account.
Postby TurtleJosh52 » Wed Apr 27, 2016 12:14 pm
When I open it, it says
"The program can't start because MSVCP140.dll is missing from your
computer. Try reinstalling the program to fix this problem."
Help!
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9890
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Wed Apr 27, 2016 12:15 pm
run the vredist.exe in your smbx folder
|
|
|
|
|
|
|
|
|
-
RhysOwens
- Nipper

- Posts: 423
- Joined: Fri Apr 22, 2016 2:53 am
Postby RhysOwens » Wed Apr 27, 2016 1:33 pm
S1eth wrote:RhysOwens wrote:Mario_and_Luigi_55 wrote:
Because api has to be in a LuaScriptsLib folder
It was in the LuaScriptsLib folder but the code he gave us still didn't work. 
It works for me. And I assume it works for Mario_and_Luigi_55 as well?
RhysOwens wrote:It was in the LuaScriptsLib folder but the code he gave us still didn't work. 
Why did you put it there? Those were not the instructions I gave you. If you didn't do that, how will I know if you followed all the other steps correctly?
You can put the file either in your level folder, or the LuaScriptsLib folder.
API.load will prioritize local files in the level folder, and if it doesn't find the API there, it'll look in the LuaScriptsLib folder.
It would be nice if you could tell me what error you're getting. I can't do much with "doesn't work".
Make sure the file is called "HealthPoint.lua".
Enable file extensions. Maybe your file is called "HealthPoint.lua.txt".
I loaded HealthPoint.lua and my code worked
but your fixing code didn't.
The error I get is: bad argument #1 to 'pairs' (table expected, got nil)
|
|
|
|
|
|
|
|
|
-
S1eth
- Bot

- Posts: 54
- Joined: Sat Apr 23, 2016 10:44 am
Postby S1eth » Wed Apr 27, 2016 1:50 pm
RhysOwens wrote:
I loaded HealthPoint.lua and my code worked
but your fixing code didn't.
The error I get is: bad argument #1 to 'pairs' (table expected, got nil)
That means you are not using the updated HealthPoint.lua file I provided you with.
You have to load the api I uploaded or it's not going to work.
I am working on an API that requires starman.lua, and I noticed that starman saves the state "inStar" inside a global variable and only works for player 1. Both of these are rather inconvenient to say the least.
In regards to SMBX2.0, will I still be using starman.lua or will that be part of the global lua API functions. (or included in the game itself like in 1.4.x ?)
Or should I update starman.lua myself to work for 2-player mode (and maybe upload it somewhere?)
|
|
|
|
|
|
|
|
|
-
TurtleJosh52
- Hoopster

- Posts: 44
- Joined: Mon Nov 09, 2015 1:52 pm
- Flair: I regret this account.
Postby TurtleJosh52 » Thu Apr 28, 2016 2:52 pm
When I open up LunaLua this appears:
"Using GDI renderer. so some advanced LunaDLL effects may not be present in
some levels.
Could not use OpenGL Renderer because:
Missing EXT_framebuffer_object"
Halp
|
|
|
|
|
|
|
|
|
-
Kevsoft
- Ripper II

- Posts: 375
- Joined: Sun Jul 27, 2014 8:03 am
Postby Kevsoft » Thu Apr 28, 2016 3:41 pm
TurtleJosh52 wrote:When I open up LunaLua this appears:
"Using GDI renderer. so some advanced LunaDLL effects may not be present in
some levels.
Could not use OpenGL Renderer because:
Missing EXT_framebuffer_object"
Halp
This basically means that your graphics card is too old, or your graphics driver is not properly installed.
Try updating/repairing your graphics card driver installation.
|
|
|
|
|
|
|
|
|
-
pal4
- Swooper

- Posts: 63
- Joined: Wed Dec 23, 2015 7:57 pm
Postby pal4 » Fri Apr 29, 2016 12:18 pm
Not really a problem, just a quick question. If I wanted to make my own Lua file, how do I do so?
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9890
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Fri Apr 29, 2016 12:20 pm
You make a file with the extension .lua
|
|
|
|
|
|
|
|
|
-
Zant
- Volcano Lotus

- Posts: 570
- Joined: Sat Dec 21, 2013 2:58 pm
Postby Zant » Fri Apr 29, 2016 12:43 pm
Is it possible to create a portal system(like in Mari0)with LunaLua?
|
|
|
|
|
Return to “LunaLua”
Users browsing this forum: Ahrefs [Bot] and 1 guest
|