make pheromone visible for all aliens regardless of distance?
Wyzcrak
Pot Pie Aficionado Join Date: 2002-12-04 Member: 10447Forum Moderators, Constellation, NS2 Playtester, Squad Five Blue
Pot Pie Aficionado Join Date: 2002-12-04 Member: 10447Forum Moderators, Constellation, NS2 Playtester, Squad Five Blue
in Modding
I've created a pheromone with Pheromone.lua's CreatePheromone(...). It's a LargeThreatMarker.
How can I make that pheromone visible to all alien players regardless of distance or location, such that the pheromone's icon appears in the player's HUD and provides a waypoint on the ground no matter where that player is on the map when the pheromone is created?
Put another way: How do I override the distance at which the pheromone renders in the alien player's HUD?
How can I make that pheromone visible to all alien players regardless of distance or location, such that the pheromone's icon appears in the player's HUD and provides a waypoint on the ground no matter where that player is on the map when the pheromone is created?
Put another way: How do I override the distance at which the pheromone renders in the alien player's HUD?
Comments
function Pheromone:GetAppearDistance()
return kMaxRelevancyDistance
end
This seems not to change the distance from which I can see the pheromone as a player, and I'm not sure what else to modify.
My goal is to see the ThreatMarker pheromone, and its waypoint, from any location on the map.
local function ReplacementGetMostRelevantPheromone(toOrigin) local pheromones = GetEntitiesWithinRange("Pheromone", toOrigin, modSpecificCondition and 300 or 100) local bestPheromone local bestDistSq = math.huge for p = 1, #pheromones do local currentPheromone = pheromones[p] local currentDistSq = currentPheromone:GetDistanceSquared(toOrigin) if currentDistSq < bestDistSq then bestDistSq = currentDistSq bestPheromone = currentPheromone end end return bestPheromone end ReplaceLocals( PlayerUI_GetOrderPath, { GetMostRelevantPheromone = ReplacementGetMostRelevantPheromone } )Many thanks to Dragon, McGlaspie, Samus, and Golden for their help in Discord.
Note to self: the contents above of ReplacementGetMostRelevantPheromone were copied from build 279's GetMostRelevantPheromone in Player_Client.lua, so I might need to update my replacement method's contents to suit changes in future builds.