Jump to content

How can I tell from the code if mod is client only or all clients required?

Recommended Posts

Hi! I've made a mod a long time ago that I can't play without :-). Now that DST is coming in a few days I was wondering if this mod is client_only or all_clients_required? Is there any way to know this without actually testing the mod?


This is the code. Fairly short, inspired by simplex's "NoMoreWallFing":


-- Force attack (CTRL-F) ignores chester/companions/walls    -- Thanks to simplex (NoMoreWallFing)

local getinfo = GLOBAL.debug.getinfolocal pcall = GLOBAL.pcalllocal function make_no_f_able(inst)	local combat = inst.components.combat	if not combat then return end	combat.canbeattackedfn = (function()		local oldfn = combat.canbeattackedfn		return function(inst, attacker)			if not oldfn or oldfn(inst, attacker) then				if attacker:HasTag("player") then					local status, info = pcall(getinfo, 4, 'f')					return not status or info.func ~= attacker.components.playercontroller.GetAttackTarget				else					return true				end			end		end	end)()endAddComponentPostInit("repairable", function(_, inst)	if inst:HasTag("wall") then		inst:DoTaskInTime(0, make_no_f_able)	endend)AddComponentPostInit("follower", function(_, inst)	if inst:HasTag("companion") then		inst:DoTaskInTime(0, make_no_f_able)	endend)

My guess is that it's not client_only, since it changes the "combat" components.



EDIT: When I was looking for help with the mod Rincevvind posted this:

local function DontHitMeWulfe(inst,attacker)    return not attacker:HasTag("wulfe") --      return attacker.prefab~="player"end function SomePrefabInit(inst)    inst.components.combat.canbeattackedfn=DontHitMeWulfeend AddPrefabPostInit("hound", SomePrefabInit)

Is this different?

Edited by Tenshin
Link to comment
Share on other sites

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...