-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markervision: Generalize for all placeable entities #1423
base: master
Are you sure you want to change the base?
Conversation
@@ -14,6 +14,10 @@ ENT.isDestructible = true | |||
|
|||
ENT.pickupWeaponClass = nil | |||
|
|||
-- MarkerVision related | |||
ENT.iconMaterial = Material("vgui/ttt/tid/tid_big_role_not_known") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to do a missing icons icon.
@@ -12,6 +12,7 @@ DEFINE_BASECLASS("ttt_base_placeable") | |||
if CLIENT then | |||
ENT.Icon = "vgui/ttt/icon_health" | |||
ENT.PrintName = "hstation_name" | |||
ENT.iconMaterial = Material("vgui/ttt/icon_health") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better health icon
if CLIENT then | ||
ENT.Icon = "vgui/ttt/icon_decoy" | ||
ENT.PrintName = "decoy_name" | ||
ENT.iconMaterial = Material("vgui/ttt/icon_decoy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better decoy icon
One thing I'm not a fan of is the
|
@@ -24,6 +28,11 @@ function ENT:Initialize() | |||
|
|||
if SERVER then | |||
self:PrecacheGibs() | |||
|
|||
local mvObject = self:AddMarkerVision("ttt_base_placeable_owner") | |||
mvObject:SetOwner(self:GetOriginator()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a fan that the owner is hard set to the originator here, the owner can also be a role or a team
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what is the owner relevant anyways? I just hardcoded it as I saw no benefit to it being customizable. Normally you place it you own it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The heroes crystal, that also uses this base, has the owner set to ROLE_SUPERVILLAIN. As any supervillain can see it, but a supervillain changing their role, will lose access to the marker vision
end | ||
|
||
function ENT:GetMarkerVisionColors(mvData) | ||
return { COLOR_WHITE } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this a color table? Is this one color for each icon? One for each line of text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see this is for the icon, this is a bit confusing, because the text can have colors as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know. Will adjust.
Tried to do your review comments. Would start documenting later and then try myself with the remote trigger. |
This is finished from my side, if Tim supplies the icons, it should be ready again. |
I'll try to add the icons this week! |
I took a quick glimpse at the code and I think @saibotk has to give his opinion here on the structure. I'm not entirely sure if this complicates it too much or so, seems a bit arbitrary to me, hm |
This enables markervision for all placeable entities, by initializing and removing it in the baseclass.
To overwrite, change icons or add additional infos, you can use the ent specific functions.
This shall also be the start of remote triggerable entities, that make use of the markervision system, by enabling remote configuration when a markervision enabled entity is in line of sight.