Well-met Posted June 4, 2021 Share Posted June 4, 2021 Hello Say I want Klaus' bag to appear on the map from anywhere, like a Ocuvigil, I do this if GLOBAL.TheNet and GLOBAL.TheNet:GetIsServer() then AddPrefabPostInit("klaus_sack", function(inst) inst.icon = GLOBAL.SpawnPrefab("globalmapicon") inst.icon:TrackEntity(inst) inst.MiniMapEntity:SetCanUseCache(false) inst.MiniMapEntity:SetDrawOverFogOfWar(true) end) end However, I'm wondering how would one achieve this so it only shows up for one specific character? Is this even possible or supported? Link to comment Share on other sites More sharing options...
penguin0616 Posted June 5, 2021 Share Posted June 5, 2021 (edited) Working with map-related code is awful. Good luck. With that being said, you might be able to do this by using the same method that the Ancient Key and Thulecite Medallion use. The gist is that the icon only shows to players who have a certain tag by setting an icon restriction, so you can give this character the tag and it'll show up only for them. I would look at the "atrium_key" and "nightmare_timepiece" prefabs to start off (Ancient Key and Thuelcite Medallion, respectively). Edited June 5, 2021 by penguin0616 2 Link to comment Share on other sites More sharing options...
Well-met Posted June 5, 2021 Author Share Posted June 5, 2021 thank you, that does seem like a good start Link to comment Share on other sites More sharing options...
Well-met Posted June 5, 2021 Author Share Posted June 5, 2021 yep nailed it if GLOBAL.TheNet and GLOBAL.TheNet:GetIsServer() then AddPrefabPostInit("rock_moon", function(inst) inst.icon = GLOBAL.SpawnPrefab("globalmapicon") inst.MiniMapEntity:SetCanUseCache(false) inst.MiniMapEntity:SetDrawOverFogOfWar(true) inst:AddComponent("maprevealable") inst.components.maprevealable:AddRevealSource(inst, "moontracker") inst.components.maprevealable:SetIconPriority(15) inst.icon.MiniMapEntity:SetRestriction("moontracker") end) end then I just put inst:AddTag("moontracker") to any character I need 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now