Page 1 of 1

Disable Rupees?

Posted: Wed Dec 06, 2017 9:48 pm
by fern
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.

Re: Disable Rupees?

Posted: Wed Dec 06, 2017 10:29 pm
by PixelPest
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)

Re: Disable Rupees?

Posted: Thu Dec 07, 2017 4:16 am
by Emral
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.

Re: Disable Rupees?

Posted: Thu Dec 07, 2017 11:03 pm
by fern
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:

Re: Disable Rupees?

Posted: Fri Dec 08, 2017 6:54 am
by PixelPest
Can you show your code?

Re: Disable Rupees?

Posted: Fri Dec 08, 2017 1:01 pm
by fern
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.

Re: Disable Rupees?

Posted: Fri Dec 08, 2017 2:08 pm
by PixelPest
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

Re: Disable Rupees?

Posted: Fri Dec 08, 2017 5:15 pm
by fern
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?

Re: Disable Rupees?

Posted: Fri Dec 08, 2017 10:12 pm
by PixelPest
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

Re: Disable Rupees?

Posted: Sat Dec 09, 2017 7:27 am
by Emral
The rupees are definitely rupees. The flag is very likely to be something that will be added to the Defines table once found.