Disable Rupees?

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?
fern
Bot
Bot
Posts: 56
Joined: Sat Dec 02, 2017 8:59 pm

Disable Rupees?

Postby fern » Wed Dec 06, 2017 9:48 pm

Is there any way at all to keep regular coins as Link? I could change his main block coin to red coins and change the sprites, but the coins would still come out instead of getting collected on the hit.

Is there a toggle for this? Toad and Peach use a similar system, so I thought there might be.

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

Re: Disable Rupees?

Postby PixelPest » Wed Dec 06, 2017 10:29 pm

There isn't, but I believe all that happens is that the coins are changed to rupees when the character switch is hit. You could just use LunaLua to iterate over all coin instances and revert them back by transforming into another ID (the original one of the coins)

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9891
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Disable Rupees?

Postby Emral » Thu Dec 07, 2017 4:16 am

Coins exploding out of blocks is a mechanic independent to the type of coin coming out. There are fields to change the ID for Link on this page, but nothing so far for Toad, Luigi and their respective block hit effects.

fern
Bot
Bot
Posts: 56
Joined: Sat Dec 02, 2017 8:59 pm

Re: Disable Rupees?

Postby fern » Thu Dec 07, 2017 11:03 pm

PixelPest wrote:There isn't, but I believe all that happens is that the coins are changed to rupees when the character switch is hit. You could just use LunaLua to iterate over all coin instances and revert them back by transforming into another ID (the original one of the coins)
I tried this, but they stay as rupees even if I try forcing an ID change.
Enjl wrote:Coins exploding out of blocks is a mechanic independent to the type of coin coming out. There are fields to change the ID for Link on this page, but nothing so far for Toad, Luigi and their respective block hit effects.
Yeah that's what I'm doing, but I'm using red coins because the game forces all coins to be rupees. I might just change the sprites of the rupees into coins and change the sound. Idk why I didn't do that in the first place. :lol:

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

Re: Disable Rupees?

Postby PixelPest » Fri Dec 08, 2017 6:54 am

Can you show your code?

fern
Bot
Bot
Posts: 56
Joined: Sat Dec 02, 2017 8:59 pm

Re: Disable Rupees?

Postby fern » Fri Dec 08, 2017 1:01 pm

PixelPest wrote:Can you show your code?
All I have now is this:

Code: Select all

local function coinDrops()	-- CHANGES THE TYPE OF COIN FROM KILLS AND BLOCKS
	defines.block_hit_link_rupeeID2 = 251
	defines.block_hit_link_rupeeID3 = 251
	defines.kill_drop_link_rupeeID2 = 251
	defines.kill_drop_link_rupeeID3 = 249
end
But, what I had before was this I think:

Code: Select all

local function changeRupees()
    for _, n in pairs(NPC.get(251, -1)) do
		n.id = 10;
    end
end
It worked when I tried changing it to other NPCs, but when I tried coins, they would remain as rupees.

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

Re: Disable Rupees?

Postby PixelPest » Fri Dec 08, 2017 2:08 pm

That can't be your whole code. Where are you calling those functions from? Also try NPC:transform(). In terms of Defines, they act just like variables; try setting them in onStart() and make sure the d in defines is capitalized

fern
Bot
Bot
Posts: 56
Joined: Sat Dec 02, 2017 8:59 pm

Re: Disable Rupees?

Postby fern » Fri Dec 08, 2017 5:15 pm

PixelPest wrote:That can't be your whole code. Where are you calling those functions from? Also try NPC:transform(). In terms of Defines, they act just like variables; try setting them in onStart() and make sure the d in defines is capitalized
That's not my whole code, I just felt like I'd just send the function and let you assume where it was called. The first code is called onStart(), the second is called onTick(). I tested it with the ID of a goomba and it worked, but when I tried coins, they stayed as rupees. The first code is working I just wasn't sure which one you were asking for.

Defines works without capitalization, but if that's more acceptable, I'll change it. I'll check out NPC:transform() even though I already changed the rupees sprites and the SFX.

EDIT: NPC:tranform() does not work either, my guess is the game actively forces the coins' IDs to be the rupees' IDs.

Code: Select all

function onTick()
	armorSet()
	correctJump()
    for _, n in pairs(NPC.get(251, -1)) do
      n:transform(10)
    end
end
If I try a different ID, such as 1 (Goomba), it works fine.

EDIT 2: Off-topic question, is there a remainder function in LunaLua?

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

Re: Disable Rupees?

Postby PixelPest » Fri Dec 08, 2017 10:12 pm

I assume this is another stupid Redigit thing where the rupees aren't actually rupees, but still SMB3 coins. There's probably a memory field somewhere (that hasn't been found yet) and I'll see if I can find it tomorrow, otherwise you might have to actually spawn a new NPC and kill the old one.

In terms of remainder, you can use modulo (%). So like 5%2 = 1 and 2%1= 0

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9891
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: Disable Rupees?

Postby Emral » Sat Dec 09, 2017 7:27 am

The rupees are definitely rupees. The flag is very likely to be something that will be added to the Defines table once found.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari