Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

Electroely

Fuelweaver's death camera lock on other creatures?

Recommended Posts

Electroely    1,756

Just wondering, would it be possible to make a mod that makes other raid bosses lock their camera when they die the same way the Fuelweaver does it?

Share this post


Link to post
Share on other sites
Destros09    1,134
47 minutes ago, Electroely said:

Just wondering, would it be possible to make a mod that makes other raid bosses lock their camera when they die the same way the Fuelweaver does it?

I want this on butterflys

Share this post


Link to post
Share on other sites
DarkXero    2,672
local focustime = {
	bee = 3,
	toadstool = 5,
}

local function OnFocusCamera(inst)
	local player = GLOBAL.TheFocalPoint.entity:GetParent()
	if player ~= nil then
		GLOBAL.TheFocalPoint:PushTempFocus(inst, 6, 22, 6)
	end
end

local function DoDeathFocus(inst)
	if inst.modcamerafocusdeath:value() then
		if inst.modcamerafocusdeathtask == nil then
			inst.modcamerafocusdeathtask = inst:DoPeriodicTask(0, OnFocusCamera)
		end
	elseif inst.modcamerafocusdeathtask ~= nil then
		inst.modcamerafocusdeathtask:Cancel()
		inst.modcamerafocusdeathtask = nil
	end
end

local function CancelDeathFocus(inst)
	inst.modcamerafocusdeath:set(false)
end

local function TriggerDeathFocus(inst)
	inst.modcamerafocusdeath:set(true)
	inst:DoTaskInTime(focustime[inst.prefab], CancelDeathFocus)
end

local function DeathFocusInit(inst)
	inst.modcamerafocusdeath:set_local(false)
	if not GLOBAL.TheNet:IsDedicated() then
		inst:ListenForEvent("modcamerafocusdeathdirty", DoDeathFocus)
	end
	if GLOBAL.TheWorld.ismastersim then
		inst:ListenForEvent("death", TriggerDeathFocus)
	end
end

local function DeathFocus(inst)
	inst.modcamerafocusdeathtask = nil
	inst.modcamerafocusdeath = GLOBAL.net_bool(inst.GUID, "mod.modcamerafocusdeath", "modcamerafocusdeathdirty")
	inst:DoTaskInTime(0, DeathFocusInit)
end

for k, v in pairs(focustime) do
	AddPrefabPostInit(k, DeathFocus)
end

 

  • Like 2

Share this post


Link to post
Share on other sites
Electroely    1,756
Spoiler
2 hours ago, DarkXero said:


local focustime = {
	bee = 3,
	toadstool = 5,
}

local function OnFocusCamera(inst)
	local player = GLOBAL.TheFocalPoint.entity:GetParent()
	if player ~= nil then
		GLOBAL.TheFocalPoint:PushTempFocus(inst, 6, 22, 6)
	end
end

local function DoDeathFocus(inst)
	if inst.modcamerafocusdeath:value() then
		if inst.modcamerafocusdeathtask == nil then
			inst.modcamerafocusdeathtask = inst:DoPeriodicTask(0, OnFocusCamera)
		end
	elseif inst.modcamerafocusdeathtask ~= nil then
		inst.modcamerafocusdeathtask:Cancel()
		inst.modcamerafocusdeathtask = nil
	end
end

local function CancelDeathFocus(inst)
	inst.modcamerafocusdeath:set(false)
end

local function TriggerDeathFocus(inst)
	inst.modcamerafocusdeath:set(true)
	inst:DoTaskInTime(focustime[inst.prefab], CancelDeathFocus)
end

local function DeathFocusInit(inst)
	inst.modcamerafocusdeath:set_local(false)
	if not GLOBAL.TheNet:IsDedicated() then
		inst:ListenForEvent("modcamerafocusdeathdirty", DoDeathFocus)
	end
	if GLOBAL.TheWorld.ismastersim then
		inst:ListenForEvent("death", TriggerDeathFocus)
	end
end

local function DeathFocus(inst)
	inst.modcamerafocusdeathtask = nil
	inst.modcamerafocusdeath = GLOBAL.net_bool(inst.GUID, "mod.modcamerafocusdeath", "modcamerafocusdeathdirty")
	inst:DoTaskInTime(0, DeathFocusInit)
end

for k, v in pairs(focustime) do
	AddPrefabPostInit(k, DeathFocus)
end

 

 

Thanks! Would you allow me to upload it on the Steam Workshop (if you haven't done so already)? Mostly just so I don't have to redownload it manually... I'll give you full credit on the workshop page if you want it...

Share this post


Link to post
Share on other sites
Sudura2017    449
8 hours ago, Destros09 said:

I want this on butterflys

Rabbits. Every time you trap them. From across the world.

Share this post


Link to post
Share on other sites
DarkXero    2,672
1 hour ago, Electroely said:

Thanks! Would you allow me to upload it on the Steam Workshop (if you haven't done so already)? Mostly just so I don't have to redownload it manually... I'll give you full credit on the workshop page if you want it...

Go ahead and do as you please. I don't need credit.

  • Like 2

Share this post


Link to post
Share on other sites