How do I setup customization of NPCs, Blocks & BGOs?

Post here for help and support regarding LunaLua and SMBX2's libraries and features.
Animebryan
Snifit
Snifit
Posts: 249
Joined: Fri Jun 03, 2016 5:40 pm
Flair: Need help!
Contact:

How do I setup customization of NPCs, Blocks & BGOs?

Postby Animebryan » Sun Aug 18, 2019 9:56 pm

I trying to create some custom blocks & I'm not sure what the options refer to. Here's the dummy.ini template:

[block]
image = "Dummy.png"
name = "Dummy Block"
group = "Dummy blocks"
category = "Dummy block"
sizable = 0
danger = 0
collision = 1
slope-slide = 0
shape-type = 0
lava = 0
destroyable = 0
destroyable-by-bomb = 0
destroyable-by-fireball = 0
spawn-on-destroy = 0
destroy-effect = 1
bounce = 0
hitable = 0
transform-onhit-into = 0
algorithm = 0
animated = 0
frames = 1
frame-delay = 125

While some are obvious, there's a few that I'm not so sure of. Can I get a list of what each of these options mean, including ones for NPCs & BGOs?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9491
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: How do I setup customization of NPCs, Blocks & BGOs?

Postby Enjl » Sun Aug 18, 2019 10:02 pm

Most of these options are exclusive to the PGE engine.
For SMBX2's purposes, INI files only affect the editor and only the visual/display fields are interesting.
Documentation is here:
https://wohlsoft.ru/pgewiki/Category:Config_pack

For actual in-game customization, you need to use NPC config. There's a template in the npc-n.lua in the _templates folder, and a list of NPC codes here
https://docs.google.com/spreadsheets/d/ ... 1557876631

Animebryan
Snifit
Snifit
Posts: 249
Joined: Fri Jun 03, 2016 5:40 pm
Flair: Need help!
Contact:

Re: How do I setup customization of NPCs, Blocks & BGOs?

Postby Animebryan » Thu Aug 22, 2019 11:25 pm

It won't stop giving me the finger! I set up 4 custom blocks to act as layer switches when hit, set the Hitable setting to 1, but when I try to hit it, it acts like a used solid block. It doesn't bump up like a hitable block should. How do I fix this?

One of the ini files:
Spoiler: show
[block]
image = "block-757.png"
name = "Right Arrow Block"
group = "Custom blocks"
category = "Switch block"
sizable = 0
danger = 0
collision = 1
slope-slide = 0
shape-type = 0
lava = 0
destroyable = 0
destroyable-by-bomb = 0
destroyable-by-fireball = 0
spawn-on-destroy = 0
destroy-effect = 0
bounce = 0
hitable = 1
transform-onhit-into = 0
algorithm = 0
animated = 0
frames = 1
frame-delay = 0

ElectriKong
Posts: 4646
Joined: Mon Jun 06, 2016 4:32 pm
Flair: I have NO idea what to put here
Pronouns: he/him
Contact:

Re: How do I setup customization of NPCs, Blocks & BGOs?

Postby ElectriKong » Fri Aug 23, 2019 3:49 am

Animebryan wrote:
Thu Aug 22, 2019 11:25 pm
It won't stop giving me the finger! I set up 4 custom blocks to act as layer switches when hit, set the Hitable setting to 1, but when I try to hit it, it acts like a used solid block. It doesn't bump up like a hitable block should. How do I fix this?

One of the ini files:
Spoiler: show
[block]
image = "block-757.png"
name = "Right Arrow Block"
group = "Custom blocks"
category = "Switch block"
sizable = 0
danger = 0
collision = 1
slope-slide = 0
shape-type = 0
lava = 0
destroyable = 0
destroyable-by-bomb = 0
destroyable-by-fireball = 0
spawn-on-destroy = 0
destroy-effect = 0
bounce = 0
hitable = 1
transform-onhit-into = 0
algorithm = 0
animated = 0
frames = 1
frame-delay = 0
.ini files only affect the PGE editor, so don't expect it to work in game.

If you want to make a block hitable, then try adding 'Block.config[n].hitable = true' to your level's/episode's luna.lua file, replacing the n with the block ID.

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9491
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: How do I setup customization of NPCs, Blocks & BGOs?

Postby Enjl » Fri Aug 23, 2019 6:19 am

Electriking wrote:
Fri Aug 23, 2019 3:49 am
If you want to make a block hitable, then try adding 'Block.config[n].hitable = true' to your level's/episode's luna.lua file, replacing the n with the block ID.
bumpable, not hitable

Animebryan
Snifit
Snifit
Posts: 249
Joined: Fri Jun 03, 2016 5:40 pm
Flair: Need help!
Contact:

Re: How do I setup customization of NPCs, Blocks & BGOs?

Postby Animebryan » Fri Aug 23, 2019 8:21 am

What?

Hoeloe
Foo
Foo
Posts: 1442
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: How do I setup customization of NPCs, Blocks & BGOs?

Postby Hoeloe » Fri Aug 23, 2019 9:45 am

As has been said, .ini files only affect how the block appears in the editor. In order to change its in-game behaviour, you need to add:

Code: Select all

Block.config[BLOCKID].bumpable = true
to your levels luna.lua file.

Animebryan
Snifit
Snifit
Posts: 249
Joined: Fri Jun 03, 2016 5:40 pm
Flair: Need help!
Contact:

Re: How do I setup customization of NPCs, Blocks & BGOs?

Postby Animebryan » Fri Aug 23, 2019 10:08 am

So do I add that as well or just change hitable to bumpable?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9491
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: How do I setup customization of NPCs, Blocks & BGOs?

Postby Enjl » Fri Aug 23, 2019 10:13 am

Animebryan wrote:
Fri Aug 23, 2019 10:08 am
So do I add that as well or just change hitable to bumpable?
The ini is completely irrelevant for this. The ini's config flag is called "hitable" but only affects the PGE engine, which we don't use in SMBX2. All you need is the line hoeloe provided.

Animebryan
Snifit
Snifit
Posts: 249
Joined: Fri Jun 03, 2016 5:40 pm
Flair: Need help!
Contact:

Re: How do I setup customization of NPCs, Blocks & BGOs?

Postby Animebryan » Fri Aug 23, 2019 10:32 am

Enjl wrote:
Fri Aug 23, 2019 10:13 am
Animebryan wrote:
Fri Aug 23, 2019 10:08 am
So do I add that as well or just change hitable to bumpable?
The ini is completely irrelevant for this. The ini's config flag is called "hitable" but only affects the PGE engine, which we don't use in SMBX2. All you need is the line hoeloe provided.
Bringing up the ini file is irrelevant. We're talking about the luna.lua file & whether to replace hitable with bumpable or to keep hitable & have both.

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9491
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: How do I setup customization of NPCs, Blocks & BGOs?

Postby Enjl » Fri Aug 23, 2019 10:40 am

Ah, I didn't know you skipped over the part where I corrected Electriking by saying that the field is called "bumpable" instead of "hitable". Hitable doesn't exist in block config.


Return to “LunaLua Help”

Who is online

Users browsing this forum: cato and 2 guests