Jump to content

Recommended Posts

On 4/12/2026 at 7:53 PM, Demon Hawking said:

I have a mod (not mine) that I would like to tweak. I would like to add flat planar damage to a weapon. How could I achieve that? 

You need to find the prefab name of that weapon and then paste this code into your modmain file. You can find the prefab name using some mods in the workshop, console, or client_log.

AddPrefabPostInit("prefabmod", function(inst)

    if not GLOBAL.TheWorld.ismastersim then
        return
    end
    inst:AddComponent("planardamage")
    inst.components.planardamage:SetBaseDamage(20)
    
end)

 

6 hours ago, Haruhi Kawaii said:

You need to find the prefab name of that weapon and then paste this code into your modmain file. You can find the prefab name using some mods in the workshop, console, or client_log.

AddPrefabPostInit("prefabmod", function(inst)

    if not GLOBAL.TheWorld.ismastersim then
        return
    end
    inst:AddComponent("planardamage")
    inst.components.planardamage:SetBaseDamage(20)
    
end)

 

Thank you for the reply. Where should I paste the code if the addprefab looks like this?

image.png.66937cb0803fe1d8cac60950f24bbb14.png 

I tried to add it under the damage, walkspeed multiplier and at the end, but none of it worked.

20 hours ago, Demon Hawking said:

Thank you for the reply. Where should I paste the code if the addprefab looks like this?

image.png.66937cb0803fe1d8cac60950f24bbb14.png 

I tried to add it under the damage, walkspeed multiplier and at the end, but none of it worked.

Currently, I don't see any problems with that code. Are you sure you've got the prefab name correct? Try your changes with a vanilla game prefab like Spear. Also, check your modinfo; that code only works on mods that are server-only.

1 hour ago, Haruhi Kawaii said:

Currently, I don't see any problems with that code. Are you sure you've got the prefab name correct? Try your changes with a vanilla game prefab like Spear. Also, check your modinfo; that code only works on mods that are server-only.

I tried some things and it turned out that another mod was causing issues with planar damage values. After I uninstaled it the code started working. Thank you for your help with the code. 

  • Health 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...