[NPC Pack] Polflip

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

Moderator: Userbase Moderators

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

[NPC Pack] Polflip

Postby Emral » Sat Jul 27, 2019 7:18 pm

Flip! Flop! He will never stop!
He tries to move in one direction until he figures out it's impossible. A direction change happens after 2 unsuccessful flips. They can phase through rightside-up slopes from below. Thanks Redigit!

If you set them to "Don't Move", they operate on a timer instead.

A download link can be found here:
https://drive.google.com/file/d/12vILc5 ... sp=sharing

Demo:
https://www.youtube.com/watch?v=3yZSJNPa7u8
0:51

Installation instructions can be found in the handbook or in my thread.

Modifications and adaptations of the code is permitted. If you use this particular code as a basis for an enhanced version of these NPCs, please give credit.

Wiimeiser
Snifit
Snifit
Posts: 215
Joined: Mon Jun 24, 2019 4:36 am
Flair: What?

Re: [NPC Pack] Polflip

Postby Wiimeiser » Sat Jul 27, 2019 10:48 pm

Appears to be incompatible with custom blocks (IDs 751-1000) and will flip immediately if it's standing on one or walks onto one. Other than that it works right.

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

Re: [NPC Pack] Polflip

Postby Emral » Sun Jul 28, 2019 4:31 am

Wiimeiser wrote:
Sat Jul 27, 2019 10:48 pm
Appears to be incompatible with custom blocks (IDs 751-1000) and will flip immediately if it's standing on one or walks onto one. Other than that it works right.
You have to register your block to the expandeddefines block lists. Polflip can't know what the collision is like from the sprite alone!

Wiimeiser
Snifit
Snifit
Posts: 215
Joined: Mon Jun 24, 2019 4:36 am
Flair: What?

Re: [NPC Pack] Polflip

Postby Wiimeiser » Sun Jul 28, 2019 10:17 am

I don't know how to do that. Is it in the Polflip files or somewhere else?

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

Re: [NPC Pack] Polflip

Postby Emral » Sun Jul 28, 2019 10:24 am

Wiimeiser wrote:
Sun Jul 28, 2019 10:17 am
I don't know how to do that. Is it in the Polflip files or somewhere else?
Expandeddefines...
expandedDefines.registerBlock(id, typeList)
Typelist is something like expandedDefines.BLOCK_SOLID or expandedDefines.BLOCK_SEMISOLID (I think Block.SOLID and Block.SEMISOLID work too but I'm not sure).
A list of typelists can be found in expandedDefines.lua

Wiimeiser
Snifit
Snifit
Posts: 215
Joined: Mon Jun 24, 2019 4:36 am
Flair: What?

Re: [NPC Pack] Polflip

Postby Wiimeiser » Sun Jul 28, 2019 9:35 pm

So I guess I add {751, 752, 753, 756, 757, 812, 822, 832, 842} (Not sure how it would work with the Exclusive Blocks states) to expandedDefines.BLOCK_SOLID then? I assume I just do that in the luna.lua somehow?


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 4 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari