Page 13 of 47

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Mon Aug 03, 2015 9:49 pm
by XerX
Text.print not printText

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Mon Aug 03, 2015 10:02 pm
by PersonNamedUser
XerX wrote:Text.print not printText
I have no idea why it won't Work!

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Tue Aug 04, 2015 12:17 am
by PersonNamedUser
Would this code work?

Code: Select all

function onLoop()
   --if player is holding glow
   if(player.holdingNPC == 158) then
     Text.print("Glow: Put me Down!", 0, 0)
   
  
   end
end

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Tue Aug 04, 2015 5:39 am
by cramps-man
So as you can see in the documentation here: http://engine.wohlnet.ru/pgewiki/Player_%28class%29

The "player.holdingNPC" returns the NPC class. And as you can see in the NPC class documentation here: http://engine.wohlnet.ru/pgewiki/NPC_%28class%29

To get the NPC id, you will need to type,

if (player.holdingNPC.id == 158) then
/* blah code here */

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Tue Aug 04, 2015 6:23 am
by XerX
cramps-man wrote:So as you can see in the documentation here: http://engine.wohlnet.ru/pgewiki/Player_%28class%29

The "player.holdingNPC" returns the NPC class. And as you can see in the NPC class documentation here: http://engine.wohlnet.ru/pgewiki/NPC_%28class%29

To get the NPC id, you will need to type,

if (player.holdingNPC.id == 158) then
/* blah code here */
This is actually right.

You would have to do something like this.

Code: Select all

local player = Player();

function onLoop()
	if(player.holdingNPC ~= nil) then
		if(player.holdingNPC.id == 158) then
			Text.print("Put me down!",0,0);
		end
	end
end

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Tue Aug 04, 2015 7:27 pm
by HenryRichard
XerX wrote:

Code: Select all

local player = Player();

function onLoop()
	if(player.holdingNPC ~= nil) then
		if(player.holdingNPC.id == 158) then
			Text.print("Put me down!",0,0);
		end
	end
end
Which could be simplified to

Code: Select all

function onLoop()
	if(player.holdingNPC) then
		if(player.holdingNPC.id == 158) then
			Text.print("Put me down!",0,0);
		end
	end
end
Also, I found a bug with the OpenGL rendering - a level that looked perfectly fine before now looks like this:
Image
It's got all these weird lines and lags a TON, whereas with the old rendering it looked fine.

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Tue Aug 04, 2015 7:33 pm
by PersonNamedUser
Great! It worked!

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Wed Aug 05, 2015 1:22 am
by Kevsoft
HenryRichard wrote:
XerX wrote:

Code: Select all

local player = Player();

function onLoop()
	if(player.holdingNPC ~= nil) then
		if(player.holdingNPC.id == 158) then
			Text.print("Put me down!",0,0);
		end
	end
end
Which could be simplified to

Code: Select all

function onLoop()
	if(player.holdingNPC) then
		if(player.holdingNPC.id == 158) then
			Text.print("Put me down!",0,0);
		end
	end
end
Also, I found a bug with the OpenGL rendering - a level that looked perfectly fine before now looks like this
Image
It's got all these weird lines and lags a TON, whereas with the old rendering it looked fine.
That render bug has been fixed. Wait for the next LunaLua version, which will come up soon.

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Wed Aug 05, 2015 8:51 pm
by HenryRichard
Kevsoft wrote:That render bug has been fixed. Wait for the next LunaLua version, which will come up soon.
That's good to know. I may have found another bug though - I'm getting an error with Graphics.drawImageToScene because it's apparently a nil value. This is my code:

Code: Select all

spritesheet = Graphics.loadImage("../spritesheet.png");

function onLoop()
Graphics.drawImageToScene(spritesheet, player.x, player.y, 0, 0, 100, 100);
end
Is this a problem with lunalua or with my code? I am using the latest version.

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Wed Aug 05, 2015 9:24 pm
by XerX
Is 'spritesheet.png' in the same directory as your code file? (lunadll.lua or lunaworld.lua)

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Wed Aug 05, 2015 10:56 pm
by HenryRichard
XerX wrote:Is 'spritesheet.png' in the same directory as your code file? (lunadll.lua or lunaworld.lua)
Yes, in fact I was able to make be placed in the level by using Graphics.placeSprite. I just need the extra arguments Graphics.drawImageToScene has.

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Thu Aug 06, 2015 12:59 am
by Kevsoft
For unreleased versions I add a version number to the description. LunaLua v0.7.1 has not been released yet. Just wait a few days and you will get it in your hands!

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Thu Aug 06, 2015 8:33 am
by Axiom
Kevsoft wrote:For unreleased versions I add a version number to the description. LunaLua v0.7.1 has not been released yet. Just wait a few days and you will get it in your hands!
And for those who use my Module Manager, it will update it for you :D

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Fri Aug 07, 2015 6:05 pm
by HenryRichard
Kevsoft wrote:For unreleased versions I add a version number to the description. LunaLua v0.7.1 has not been released yet. Just wait a few days and you will get it in your hands!
...How did I miss that? I should really read the entire description before I try something. Thanks!

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Mon Aug 10, 2015 11:47 am
by bigpotato
Does this require lunaDLL to work? Or is it included?

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Mon Aug 10, 2015 12:15 pm
by Axiom
bigpotato wrote:Does this require lunaDLL to work? Or is it included?
LunaDll is bundled for backwards compatibility reasons. So yes, you can download this and still run LunaDll's autocode and Lua ;)

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Tue Aug 18, 2015 2:14 pm
by Kevsoft
LunaLua v0.7.1 is out with following changes:
Spoiler: show
* Some various fixes for the opengl renderer.
* Added screenshot handling with the print-screen button.
* Working loops (intro sequence + main loop)

* Some new functions:
** Added various functions in the Misc-Namespace
** Added various functions in the Graphics-Namespace
** Added Audio.MusicTitle and Audio.MusicTitleTag to get the music title (saved as IDv3 metadata) of the current music file (works well with mp3 and ogg)

* New custom libraries:
** fade.lua - Easy and fast library for creating fade effects and color overlays
** sprite.lua - A library for creating custom animated sprites with movement abilities.
** vectR.lua - A vector library (used for colliders.lua)

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Tue Aug 18, 2015 4:59 pm
by HenryRichard
You forgot to include SDL2_mixer_ext.dll, so SMBX doesn't start.

Re: LunaLua Offical Thread [Streaming Question Poll]

Posted: Wed Aug 19, 2015 12:03 am
by Wohlstand
HenryRichard wrote:You forgot to include SDL2_mixer_ext.dll, so SMBX doesn't start.
I just fixed that and repacked everything, download the "Update only" and extract missed SDL2_mixer_ext.dll into your lunalua directory.

able to give characters a running animation With Lunalua?

Posted: Sat Aug 22, 2015 7:50 pm
by PersonNamedUser
I was just wondering with lunalua can you give characters extra animations?
If so then how?