Need help with lua? - LunaLua General Help

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?
Reign
Chain Chomp
Chain Chomp
Posts: 327
Joined: Tue Jan 21, 2014 4:22 am

Re: Need help with lua? - LunaLua General Help

Postby Reign » Tue Oct 04, 2016 12:12 pm

I might have been a bit unclear in my previous message. The fact that there are no updates is fine, as long as nothing else breaks in the future. Since even the generators worked with healthpoint.lua in an earlier versio of Lunalua.

I don't want somebody to download my episode in 2018 and encounter errors that were not there in the 2016 LunaLua. ;)

SpoonyBardOL
Bot
Bot
Posts: 57
Joined: Thu Aug 04, 2016 5:56 pm

Re: Need help with lua? - LunaLua General Help

Postby SpoonyBardOL » Tue Oct 04, 2016 3:36 pm

Enjl wrote:If that doesn't work, there's a bug I noticed with LunaTester in PGE regarding episode-wide sounds.ini
For some reason sounds.ini sometimes does not work unless a level-wise sounds.ini was loaded before (I don't know if this was fixed yet). Try sounds/smw-exit.ogg (or your new filename format) once more, but test it from the main game if possible. Though not being able to properly hear the sound when testing is a nuisance, you can confirm that it works this way.
Ok, this worked. I probably should have tried this first, but it's good to know. Thanks.

Ness-Wednesday
Purple Yoshi Egg
Purple Yoshi Egg
Posts: 1663
Joined: Sun Jun 28, 2015 3:50 pm
Flair: Diverse Scouts
Pronouns: He/Him

Re: Need help with lua? - LunaLua General Help

Postby Ness-Wednesday » Mon Oct 10, 2016 10:19 am

Where would be a good place to learn about the npc's animation timer?

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Mon Oct 10, 2016 10:41 am

Ness-Wednesday wrote:Where would be a good place to learn about the npc's animation timer?
http://wohlsoft.ru/pgewiki/NPC_(class)

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Need help with lua? - LunaLua General Help

Postby loop » Mon Oct 10, 2016 8:35 pm

I can't get customLotus.lua to load for some reason. Here is the code:

Code: Select all

local npcParse = API.load("npcParse");
local customLotus = API.load("NPCs\\customLotus")
What am I doing wrong or missing?? :?

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Mon Oct 10, 2016 8:38 pm

Jayce 777 wrote:I can't get customLotus.lua to load for some reason. Here is the code:

Code: Select all

local npcParse = API.load("npcParse");
local customLotus = API.load("NPCs\\customLotus")
What am I doing wrong or missing?? :?
I don't think "NPCs" is the name of the folder, if I remember correctly? I also always use "/" instead of "\\", however I'm not sure that'll make a difference

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Need help with lua? - LunaLua General Help

Postby loop » Mon Oct 10, 2016 8:45 pm

PixelPest wrote:
Jayce 777 wrote:I can't get customLotus.lua to load for some reason. Here is the code:

Code: Select all

local npcParse = API.load("npcParse");
local customLotus = API.load("NPCs\\customLotus")
What am I doing wrong or missing?? :?
I don't think "NPCs" is the name of the folder, if I remember correctly? I also always use "/" instead of "\\", however I'm not sure that'll make a difference
I got it from the level Shogun from the demo stages, and that was what was in it. :?

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Mon Oct 10, 2016 8:49 pm

Well, do you have any other code that could be the issue?

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Need help with lua? - LunaLua General Help

Postby loop » Mon Oct 10, 2016 9:05 pm

Don't worry, PixelPest. I solved the issue.

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Mon Oct 10, 2016 9:07 pm

Jayce 777 wrote:Don't worry, PixelPest. I solved the issue.
Just wondering, what was the issue?

loop
Ninji
Ninji
Posts: 984
Joined: Sun Apr 17, 2016 5:56 pm
Flair: i may be dumb but im not stupid!
Pronouns: he/him/they

Re: Need help with lua? - LunaLua General Help

Postby loop » Tue Oct 11, 2016 6:17 am

PixelPest wrote:
Jayce 777 wrote:Don't worry, PixelPest. I solved the issue.
Just wondering, what was the issue?
customLotus.Lua not loading. I was a little vague.

Ghostly_Guy
Bot
Bot
Posts: 55
Joined: Thu Jun 11, 2015 10:46 pm

Re: Need help with lua? - LunaLua General Help

Postby Ghostly_Guy » Sun Oct 16, 2016 9:21 pm

Can I set an event to permanently trigger once I get a certain number of stars?

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Sun Oct 16, 2016 9:33 pm

Ghostly_Guy wrote:Can I set an event to permanently trigger once I get a certain number of stars?
You'll need to refer to the global memory value 0x00B251E0 for stars. You could use triggerEvent(), although there's a good chance there's a more efficient way to do what you're trying to do with the event. What does it do?

Ghostly_Guy
Bot
Bot
Posts: 55
Joined: Thu Jun 11, 2015 10:46 pm

Re: Need help with lua? - LunaLua General Help

Postby Ghostly_Guy » Sun Oct 16, 2016 9:52 pm

PixelPest wrote:
Ghostly_Guy wrote:Can I set an event to permanently trigger once I get a certain number of stars?
You'll need to refer to the global memory value 0x00B251E0 for stars. You could use triggerEvent(), although there's a good chance there's a more efficient way to do what you're trying to do with the event. What does it do?
The event would create a generator where there wasn't one earlier. I'm trying to make it so that anytime that you enter the level with "X" or more stars, the generator is active.

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Sun Oct 16, 2016 9:54 pm

Then don't worry about events. Use Layer:show() instead: http://wohlsoft.ru/pgewiki/Layer_(class)

DeMuZ
Fighter Fly
Fighter Fly
Posts: 37
Joined: Thu Aug 18, 2016 2:35 pm

Re: Need help with lua? - LunaLua General Help

Postby DeMuZ » Mon Oct 17, 2016 5:06 pm

I'm looking for a CinematX.lua tutorial (I'd like to make a boss fight). Could you give me a link to it? (Don't even try to link a pgewiki page about it :v)

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: Need help with lua? - LunaLua General Help

Postby Hoeloe » Mon Oct 17, 2016 5:31 pm

DeMuZ wrote:I'm looking for a CinematX.lua tutorial (I'd like to make a boss fight). Could you give me a link to it? (Don't even try to link a pgewiki page about it :v)
It's not at all recommended to use CinematX. It's very outdated, and actually mostly broken.

It's best to use these three libraries, which are more stable, and have some of the things you need:

http://wohlsoft.ru/pgewiki/Pnpc.lua
http://wohlsoft.ru/pgewiki/Colliders.lua
http://wohlsoft.ru/pgewiki/Eventu.lua

DeMuZ
Fighter Fly
Fighter Fly
Posts: 37
Joined: Thu Aug 18, 2016 2:35 pm

Re: Need help with lua? - LunaLua General Help

Postby DeMuZ » Tue Oct 18, 2016 5:38 am

Thank you very much! :)

Ghostly_Guy
Bot
Bot
Posts: 55
Joined: Thu Jun 11, 2015 10:46 pm

Re: Need help with lua? - LunaLua General Help

Postby Ghostly_Guy » Tue Oct 18, 2016 9:37 pm

PixelPest wrote:Then don't worry about events. Use Layer:show() instead: http://wohlsoft.ru/pgewiki/Layer_(class)
Thanks! This worked!

Anyways, how do you set a player offset? I tried this:

Code: Select all

function onLoop()
	if player:mem(PC+0x154, FIELD_WORD) == 87 then
		player:mem(PC+0x154,FIELD_WORD) = 17;
	end
end
And I got this:
Image
(I blacked out parts of the location because I'm going to use this for a contest.)

PixelPest
Link
Link
Posts: 7111
Joined: Sun Jul 12, 2015 5:38 pm
Flair: Tamer of Boom Booms
Contact:

Re: Need help with lua? - LunaLua General Help

Postby PixelPest » Tue Oct 18, 2016 9:48 pm

It's not PC+0x154, just 0x154. Also use onTick() instead of onLoop(); the latter is deprecated


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari