gravinpc.lua(GNPC)- holding an item alters your gravity!

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

MarioChallengerX2
Buster Beetle
Buster Beetle
Posts: 88
Joined: Sat Dec 31, 2022 4:34 pm
Pronouns: he/him

gravinpc.lua(GNPC)- holding an item alters your gravity!

Postby MarioChallengerX2 » Sat Sep 30, 2023 5:56 pm

https://imgur.com/a/ncQAgkf

Another SMW custom mechanic. It's used in JUMP, JUMP 1/2 and potentially YUMP 2.

Essentially, what it originally does is that when holding a block, it makes you jump much higher. However, this library messes with the player's gravity instead(because i didn't notice Defines.jumpheight lol) 

Anyway, what you can do with the library:
  • gnpc.gravitytable {} -- A lookup table that lets you register an NPC to alter Mario's gravity.
Example:

Code: Select all

gnpc.gravitytable[45] = true -- can be set to false if you want to disable specific npcs.
  • gnpc.activation -- a boolean to enable the script at will. True by default


gnpc.gravitable -- A table of values that set Defines.gravity and Defines.player_grav respectively. This value applies upon grabbing an item.

gnpc.gravitabledefault -- Same concept but uses the default values for the settings above. (As in, when you start the level) This value applies upon letting go of an item.

And that's all you need to know about the script! Hopefully you have fun using this!

Download link:
https://drive.google.com/file/d/1RN3A4B ... sp=sharing


























also yes, this is a joke on pnpc

Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari