Page 1 of 1

Need a list of ALL custom block settings

Posted: Sun Jan 17, 2021 1:50 pm
by Animebryan
I need a complete list of ALL custom block settings for the block.lua file. I'm trying to make a custom Muncher block but for some reason it defaults to being Invisible, Slippery & containing a coin. I need to remove those defaults & set it to cause damage on contact.

Re: Need a list of ALL custom block settings

Posted: Sun Jan 17, 2021 1:52 pm
by Emral
yeah pge just does that for some reason. That's separate to block config though, which is what affects the game.

Re: Need a list of ALL custom block settings

Posted: Sun Jan 17, 2021 3:55 pm
by Animebryan
Aaaaaaaaaaaaaaaagggggggggggggggggghhhhhhhhhhhhhhhhhhhh!!! Why won't it animate?!!!

Code: Select all

--Blockmanager is required for setting basic Block properties
local blockManager = require("blockManager")

--Create the library table
local sampleBlock = {}
--BLOCK_ID is dynamic based on the name of the library file
local blockID = BLOCK_ID

--Defines Block config for our Block. You can remove superfluous definitions.
local sampleBlockSettings = {
	id = blockID,
	--Frameloop-related
	frames = 2,
	framestyle = 0,
	framespeed = 8, --# frames between frame change
	
	--Identity-related flags:
	--semisolid = false, --top-only collision
	--sizable = false, --sizable block
	--passthrough = false, --no collision
	--bumpable = false, --can be hit from below
	--lava = false, --instakill
	--pswitchable = false, --turn into coins when pswitch is hit
	--smashable = 0, --interaction with smashing NPCs. 1 = destroyed but stops smasher, 2 = hit, not destroyed, 3 = destroyed like butter

	--floorslope = 0, -1 = left, 1 = right
	--ceilingslope = 0,

	--Emits light if the Darkness feature is active:
	--lightradius = 100,
	--lightbrightness = 1,
	--lightoffsetx = 0,
	--lightoffsety = 0,
	--lightcolor = Color.white,

	--Define custom properties below
}

--Applies blockID settings
blockManager.setBlockSettings(sampleBlockSettings)

--Register the vulnerable harm types for this Block. The first table defines the harm types the Block should be affected by, while the second maps an effect to each, if desired.

--Custom local definitions below


--Register events
function sampleBlock.onInitAPI()
	blockManager.registerEvent(blockID, sampleBlock, "onTickEndBlock")
	--registerEvent(sampleBlock, "onBlockHit")
end

function sampleBlock.onTickEndBlock(v)
    -- Don't run code for invisible entities
	if v.isHidden or v:mem(0x5A, FIELD_BOOL) then return end
	
	local data = v.data
	
	--Execute main AI here. This template hits itself.
	--v:hit()
end

--Gotta return the library table!
return sampleBlock
Image

Re: Need a list of ALL custom block settings

Posted: Thu Jan 21, 2021 9:02 pm
by Animebryan
No, seriously! Why won't it animate?

Re: Need a list of ALL custom block settings

Posted: Fri Jan 22, 2021 12:28 am
by Emral
I dunno. You haven't shared enough information to determine the issue and I don't wanna help you if you prefer screaming over doing that.

Re: Need a list of ALL custom block settings

Posted: Fri Jan 22, 2021 10:12 pm
by Animebryan
Enjl wrote:
Fri Jan 22, 2021 12:28 am
I dunno. You haven't shared enough information to determine the issue and I don't wanna help you if you prefer screaming over doing that.
It animates in the editor just not when playing, so the problem has to be with the lua file, but I can provide the txt file just in case.
As for the screaming, I've wasted a few hours trying everything I could to fix the problem, to the point where I went from cranking out about 1 level every day or every 2 days to suddenly putting my episode on hold once again (for the umpteenth time) until the issue is resolved. You clearly don't understand how frustrating it is dealing with this shit over & over again. I just want to finish making my episode with no more problems.

block-109.txt (using the block-n.txt template)

frames=2
framestyle=0
framespeed=8

sizable = false
passthrough = false
pswitchable = false
lava = false
semisolid = false
floorslope = 0
ceilingslope = 0
bumpable = false
smashable = 0

lightoffsetx = 0
lightoffsety = 0
lightradius = 128
lightbrightness = 1
lightcolor = white
lightflicker = false

I had a ini file before but the graphic animates perfectly fine in the editor without one so I deleted it, since only lua files effect it while playing.

Re: Need a list of ALL custom block settings

Posted: Fri Jan 22, 2021 10:52 pm
by Hoeloe
Blocks from 1.3 currently cannot have their animation settings changed via configs.

Re: Need a list of ALL custom block settings

Posted: Sat Jan 23, 2021 4:27 am
by Animebryan
I see. But I also tried to set this up as a custom block (block-751) and had the same problem.