Jump to content

Recommended Posts

As the title says, I am looking for a Mod that can announce when some things are set on fire;  and by whom.  I want try to track players greifing constantly setting the base camp etc on fire and destroying everything.

 

I can do a bit of coding, but I'm not sure where to look for more info on how to execute this, and while I haven't found a Mod that does this yet, doesn't mean there isn't one.

I don't think there are any specific mods like that.

 

There are mods for fire (and structure) protection.

http://steamcommunity.com/sharedfiles/filedetails/?id=400409675

http://steamcommunity.com/sharedfiles/filedetails/?id=360823660

http://steamcommunity.com/sharedfiles/filedetails/?id=404161345

 

Making a tracker for fires caused by propagation caused by players is a bit complicated.

 

You can use this:

local old = GLOBAL.ACTIONS.LIGHT.fnGLOBAL.ACTIONS.LIGHT.fn = function(act)    if act.invobject and act.invobject.components.lighter then		if act.doer and act.target then			print(act.doer.prefab, act.doer.userid, act.doer.name, 			"lighted up", act.target.prefab, "with", act.invobject.prefab)		end    end	return old(act)endAddPrefabPostInit("firestaff", function(inst)	local oldon = inst.components.weapon.onattack	inst.components.weapon.onattack = function(weapon, attacker, target)		if attacker and target then			print(attacker.prefab, attacker.userid, attacker.name,			"lighted up", target.prefab, "with", "firestaff")		end		return oldon(weapon, attacker, target)	endend)

to track people using a torch, lighter, or firestaff to light up a thing.

 

But then again, if fire propagates, you don't know.

People can bypass this by using a campfire, fuel it to max near berry bushes, and they will heat up.

To track fire propagation initiated by players torch or lighter, modify GLOBAL.ACTIONS.LIGHT.fn by tagging target with the doer's user ID and a custom fire tag (if user ID exists of course).

 

Then modify Propagator:OnUpdate(dt), so if self.inst has a custom fire tag, tag all surrounding entities, ents, with the user ID tag as well as the custom fire tag.

 

If you want to track fire propagation caused by camp fire, firedarts, fire staff, the end is nigh, gunpowder and slurtleslime, you have to add custom fire tag and user ID when all respective functions are executed. :frown:

Edited by Isosurface

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