(shouting)

LunaDLL/LunaLUA help thread

The second SMBX collab!
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

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: 10 years ago

Re: LunaDLL help thread

Post by Ittababy »

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: 14 years ago
Location: USA

Re: LunaDLL help thread

Post by KingTwelveSixteen »

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: 15 years ago

Re: LunaDLL help thread

Post by Kil »

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: 10 years ago

Re: LunaDLL help thread

Post by Ittababy »

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: 9 years ago

Re: LunaDLL help thread

Post by Darkchaox100 »

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: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

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: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

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: 15 years ago

Re: LunaDLL help thread

Post by Kil »

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: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

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: 1022
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

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: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

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: 110
Joined: 9 years ago
Pronouns: she/her
Location: Merry Old Europe

Re: LunaDLL help thread

Post by Oddwrath »

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 4932 times
:lesbian_pride: my avatar is from that obake game made in 2001 that you cannot play anymore unless you run it through a virtual machine and apply a locale patch
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

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: 9 years ago

Re: LunaDLL help thread

Post by Darkchaox100 »

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: 15 years ago

Re: LunaDLL help thread

Post by Kil »

sure
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Darkchaox100
Posts: 0
Joined: 9 years ago

Re: LunaDLL help thread

Post by Darkchaox100 »

Kil wrote:sure
Could you maybe do that with my SMBX exe if you don't mind?
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

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: 1022
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: LunaDLL help thread

Post by Hoeloe »

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: 9 years ago

Re: LunaDLL help thread

Post by Darkchaox100 »

Aww...
Well thats alright.
(I just asked btw,because i made my own launcher.)
TiKi
Posts: 709
Joined: 11 years ago

Re: LunaDLL help thread

Post by TiKi »

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: 15 years ago

Re: LunaDLL help thread

Post by Kil »

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: 110
Joined: 9 years ago
Pronouns: she/her
Location: Merry Old Europe

Re: LunaDLL help thread

Post by Oddwrath »

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.
:lesbian_pride: my avatar is from that obake game made in 2001 that you cannot play anymore unless you run it through a virtual machine and apply a locale patch
User avatar
Holy
Posts: 133
Joined: 13 years ago

Re: LunaDLL help thread

Post by Holy »

Is there a way to find out the sprite ID of the item you're holding, by printing it to the screen or something? Every time I add a new NPC it seems like the key changes IDs and the phanto stops working.
Kil
Posts: 13
Joined: 15 years ago

Re: LunaDLL help thread

Post by Kil »

I dunno what's going on with the keys. Maybe they get a semi-random ID for some reason, but then I have no idea how the game decides it's a key and not some other ID. I think thi'll print the ID of what demo's holding

Code: Select all

function onLoop()
  thenpc = npcs()[player:mem(0x154, FIELD_WORD)]
  printText(tostring(thenpc.id), 270, 250)
end
DON'T PM me. Ask your question in the help thread so everyone can be answered.
Post Reply