Page 1 of 1

Change Projectiles?

Posted: 25 Jul 2016, 20:14
by Jayce 777
I am trying to change Birdo eggs into Rinkas, but I can't get the right code. Is this correct?

Code: Select all

function onTick()
      for _, n in pairs(NPC.get(40, -1)) do --for all Birdo Eggs in all sections
            n.id = 210 --turn Birdo Eggs into Rinkas
      end
end
:crazy: :wacko: :SOS: !SOS!

Posted: 25 Jul 2016, 21:30
by Sambo
That looks like it should turn Birdo's eggs into Rinkas. It may be a bit buggy though, since it doesn't change the size of the NPC or the number of frames it has.
Have you tested this?

Re : Change Projectiles?

Posted: 25 Jul 2016, 22:20
by Jayce 777
My laptop is broken, so I cannot. I may tweak it.

Will this fix width and height?

Code: Select all

function onTick()
      for _, n in pairs(NPC.get(40, -1)) do --for all Birdo Eggs in all sections
            n.id = 210 --turn Birdo Eggs into Rinkas
n.width = 32
n.height = 32
n.collidesBlockLeft = false
n.collidesBlockRight = false
n.collidesBlockUp = false
n.collidesBlockDown = false
      end
      end

EDIT : My laptop may get fixed soon, so I can test it later. :crazy: :)

Posted: 22 Aug 2016, 21:20
by Sambo
This looks like it should work. You don't need to change the collision fields, though. Those fields are collision flags, meaning they would only be true if the NPC was colliding with a block. Setting them to false for one frame is really pointless. In fact, messing with the collision flags at all is pointless, since Rinkas don't interact with blocks anyway.

Dirty Rinka lover. :blum:

Change Bomb to Boomerang (both player items)

Posted: 5 Jun 2017, 19:32
by yoshiegg
Hello Guys.
I want to have a boomerang suit for Mario, Luigi, Peach and Toad.
Toad's no problem as he throws boomerangs by default.Mario and Luigi aren't either as I've found some code for them that works fine.
But for Peach, I tried it with the same script, with the same script with the conditional if player.character == CHARACTER_PEACH then added and with the following code that fits this topic:

Code: Select all

if player.character == CHARACTER_PEACH then
           function onTick()
      for _, n in pairs(NPC.get(291, -1)) do --for all PlayerBombs in all sections
            n.id = 292 --turn PlayerBombs into boomerangs
n.height = 32
n.width = 32
end
end

So can anyone say me why it doesn't work or if player objects just can't be modified with that script (which is imo unlogic as they're NPCs like any other NPC.)
Btw, it didn't throw an error so the syntax is correct in my code even if the amount of ends issn't correct in this extract.

Posted: 6 Jun 2017, 1:18
by Yoshi021
function onTick() must be outside the if statement like this:

Code: Select all

function onTick()
  if player.character == CHARACTER_PEACH then
    for _, n in pairs(NPC.get(291, -1)) do --for all PlayerBombs in all sections
      n.id = 292 --turn PlayerBombs into boomerangs
      n.height = 32
      n.width = 32
    end
  end
end

Peach Boomerang code

Posted: 6 Jun 2017, 14:50
by yoshiegg
Thanks for your help but somehow Peach still throws bombs.
Could someone please help me out as I don't have the slightest idea of what the problem is.