Jump to content

"Boss" Indicators


Recommended Posts

I've looked in the workshop on steam and here for boss indicators, I've been trying for some time, the indicators players have is a nice feature but i would ALSO like it for bosses or some certain enemies (krampus) to point me in the general direction they spawn, so i can at least grab their attention before they wreck to much havoc. Any pointers on where to start?

Link to comment
Share on other sites

I believe that the widgets\targetindicator.lua and components\playertargetindicator.lua from the DST scripts folder are the ones that dictate the behavior of the indicator. It would seem all you would need to do is copy and slightly modify the playertargetindicator.lua to work for bosses instead of players. 

For reference, by default the scripts folder is in "C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Together\data\scripts" by default from steam on windows.

Link to comment
Share on other sites

I just realized that Afro1967's Where's My Beefalo? (http://steamcommunity.com/sharedfiles/filedetails/?id=347360448) has boss map icons for the seasonal giants, and some other useful stuff. It doesn't have Krampus or anything for treeguards, though.  I think Afro1967 has stopped modding, but it could be picked up and updated by a motivated individual.

Link to comment
Share on other sites

I thought "wheres my beefalo" is only a map icon mod?
There were better map icon mods like , sth with "complete map" , but for some reason the author added "outdated" to it.. and no "updated" one exists anymore.

Anyway, map icon mods are not helpful to find bosses, since they only show you the last known position.
If you never saw the treeguard, it won't appear on map.
And if you saw him, but he is in fog again, he can change his position while the icon will stay at same position.

Edited by Serpens
Link to comment
Share on other sites

12 hours ago, chalenged said:

I believe that the widgets\targetindicator.lua and components\playertargetindicator.lua from the DST scripts folder are the ones that dictate the behavior of the indicator. It would seem all you would need to do is copy and slightly modify the playertargetindicator.lua to work for bosses instead of players. 

For reference, by default the scripts folder is in "C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Together\data\scripts" by default from steam on windows.

Great idea i'll give it a shot, maybe get in touch with some modders, maybe they can give me some assistance. 

Link to comment
Share on other sites

Here code, to toggle indicators for every client seperately on/off when hitting a key:

modmain:
 

local SERVER_SIDE = nil
local DEDICATED_SIDE = nil
local CLIENT_SIDE = nil
local ONLY_CLIENT_SIDE = nil
-- code from star:
-- Also notice that if SERVER_SIDE is nil and CLIENT_SIDE is nil too, that means the mod is force enabled and its working on main screen. I guess. 
if GLOBAL.TheNet:GetIsServer() then
	SERVER_SIDE = true
	if GLOBAL.TheNet:IsDedicated() then
		--Нельзя использовать GetServerIsDedicated, т.к. это лишь сообщает о сервере, а не о текущей машине.
		--Хотя... Не суть. Все равно же проходим через GetIsServer.
		DEDICATED_SIDE = true
	else
		CLIENT_SIDE = true --А это оригинальное решение вечной проблемы "ismastersim".
		--Следует использовать только для инициализации сетевых переменных, не совмещая с "return" выходом из префаба!!
	end
elseif GLOBAL.TheNet:GetIsClient() then
	SERVER_SIDE = false
	CLIENT_SIDE = true
	ONLY_CLIENT_SIDE = true
end

local function ToggleShowIndicators(player)
    if player:HasTag("ShowIndicators") then
        player:RemoveTag("ShowIndicators")
        -- print("ShowIndicators Tag removed")
    else
        player:AddTag("ShowIndicators")
        -- print("ShowIndicators Tag added")
	end
end

AddModRPCHandler("BossIndicators", "BossIndicators_ShowIndicatorshandler", function(player)
	if player then
        ToggleShowIndicators(player)
    end
end)

--- Press "F2" to show indicators (F1 might be already used)
GLOBAL.TheInput:AddKeyDownHandler(GetModConfigData("keybind"), function()
	local player = GLOBAL.ThePlayer
    if not player or player.HUD:IsConsoleScreenOpen() or player.HUD:IsChatInputScreenOpen() then
		return
	end
	if SERVER_SIDE then -- Server-side
		ToggleShowIndicators(player)
	else -- Client-side
		local RPC = GetModRPC("BossIndicators", "BossIndicators_ShowIndicatorshandler") 
        SendModRPCToServer(RPC)
	end
end)

modinfo:
 

local keyslist = {}

local alpha = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}
local KEY_A = 97
for i = 1,#alpha do keyslist[i] = {description = alpha[i],data = i + KEY_A - 1} end

local Fkey = {"F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"}
local KEY_F1 = 282
for i = 1, #Fkey do keyslist[#alpha + i] = {description = Fkey[i],data = i + KEY_F1 - 1} end

keyslist[#alpha + #Fkey + 1] = {description = "[",data = 91}
keyslist[#alpha + #Fkey + 2] = {description = "]",data = 93}

configuration_options =
{
    {
		label   = "Press to show Boss Indicators",
        hover = "Shows/Hides Boss Indicators after pressing the key.",
		name    = "keybind",
		options = keyslist,
		default = 283, --F2 default
	},
}



After adding this code, all you have to do add is a check for the ShowIndicators Tag for the player you are showing the indicator.

Edited by Serpens
Link to comment
Share on other sites

tried to start with oyur mod, but I before game starts I got crash with error message:
[00:01:09]: [string "scripts/util.lua"]:449: Could not find an asset matching images/krampus.tex in any of the search paths.

and yes, this file is missing in your images folder ;)
also xml file is not there.

Edited by Serpens
Link to comment
Share on other sites

I just wrote hundred comments at Global Position Mod :D

I had the idea to extend your mod:
rezecib adds support to activate/deactivate indicators and map icons, while game is running, within his Global Position mod.
And someone writes an UI.
And you add everything to your mod (you can easily get all the needed icons from already existing "Complete your map" mod.)

Then the player can hit a key ingame to open the UI.
There he can toggle Indicators and Map Icons seperately for everything!

(at best the UI would sort the list by name in game language of the player..)

Edited by Serpens
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
 Share

×
  • Create New...