I think this might be good example here:
You should actually be able to fumble your way through most of it.
Source:
Here are just a few impressions and comments on my part, as you can see, "local porcupo = {}" is used at the beginning, only to end the whole process with "return porcupo"...!
In the case of "[HARM_TYPE_NPC] = 877", for example, the number is actually only there for the own effect ID,
I don't know if you could have done this here with "NPC_ID" instead,
"[HARM_TYPE_SWORD] = 10" is a standard effect and should probably differ accordingly (that's the way it should be and it makes sense).
Otherwise, I have linked important Wiki pages here, where you may find some additional information.
https://docs.codehaus.moe/#/constants/enemy-harm-types
https://docs.codehaus.moe/#/features/npc-config
Code:
local npcManager = require("npcManager")local porcupo = {}local npcID = NPC_IDlocal config = npcManager.setNpcSettings({id = npcID,gfxheight = 32,gfxwidth = 32,gfxoffsetx = 0,gfxoffsety = 0,width = 32, height = 32,frames = 2,framestyle = 1,cliffturn = 1,jumphurt = true,nofireball = true,noiceball = false,noyoshi = false,nohurt = false,jumphurt = true,spinjumpsafe = true,iswalker = true})local harmTypes = {[HARM_TYPE_PROJECTILE_USED] = 877,[HARM_TYPE_NPC] = 877,[HARM_TYPE_HELD] = 877,[HARM_TYPE_TAIL] = 877,[HARM_TYPE_SWORD] = 10,[HARM_TYPE_FROMBELOW]= 877,[HARM_TYPE_LAVA] = {id = 13, xoffset = 0.5, xoffsetBack = 0, yoffset = 1, yoffsetBack = 1.5}}npcManager.registerHarmTypes(npcID, table.unmap(harmTypes), harmTypes)return porcupo
Source:
(As I am NOT a coder I can not really write in the normal expected "trade language"or "lingo")
Here are just a few impressions and comments on my part, as you can see, "local porcupo = {}" is used at the beginning, only to end the whole process with "return porcupo"...!
In the case of "[HARM_TYPE_NPC] = 877", for example, the number is actually only there for the own effect ID,
I don't know if you could have done this here with "NPC_ID" instead,
"[HARM_TYPE_SWORD] = 10" is a standard effect and should probably differ accordingly (that's the way it should be and it makes sense).
Otherwise, I have linked important Wiki pages here, where you may find some additional information.
https://docs.codehaus.moe/#/constants/enemy-harm-types
https://docs.codehaus.moe/#/features/npc-config
Statistics: Posted by Just_Thomas — Tue Apr 23, 2024 2:49 am