Template talk:CD

From Valve Developer Community
Jump to: navigation, search
Icon-message-48px.png
This is the discussion page of Template:CD. To add a comment, use the Edit button near the headline of the appropriate section. To create a new section, you can use the Add topic button at the top of this page.
Comments on talk pages should be signed with "~~~~", which will be converted into your signature and a timestamp.

Hierarchy Order

Reverted your edit on player (L4D2) inverted class hierarchy. The first thing people look at is the first line in a list so it being the current entity class makes most sense and is more practical. Reading CBaseEntity everytime as a first thing isn't practical since obviously every entity is CBaseEntity. --Nescius (talk) 15:08, 1 November 2022 (PDT)

The arrows' orientation and the indentation heavily suggest that the lower right one inherits from the upper left one. If you see CCSPlayerCBasePlayer, are you sure that you would think that CBasePlayer is the parent class? Like in tree graphs, it is more intuitive if parents are further up and children further down. In addition, arrows would point from parent to child, not the other way around. If you ask me, letting the reader get the hierarchy order right is more important than reading the classname that a page is about at the very top of the hierarchy box. --Popcorn (talk) 17:30, 1 November 2022 (PDT)
The arrows go from more specific to the less on the hierarchies I found on google too example. A -> B is supposed to mean A inherits from B. Maybe can rename the box to class diagram as the template name CD implies or class inheritance. But one thing that certainly should remain is current entity class being at the top. I don't think getting the order wrong can really happen. Everyone should realize what the order is by seeing CBaseEntity at the end --Nescius (talk) 22:44, 1 November 2022 (PDT)
Hm. Ok, both orientations for the arrows are reasonable. But interestingly, even in your example the root parent class is at the top, not at the bottom. I'd suggest CBaseEntity↖ CTerrorPlayer due to the fact that this way CBaseEntity is the closest to the left base (and top base), being the base entity. I don't think it is too practical to read the current class first, in fact it would even have the disadvantage that if you click through the classes in the hierarchy box, the positions of the classnames will always change. If the order was reversed (CBaseEntity at the top) and if there was a good minimal width for the box, then ideally, clicking on the link of some parent class would keep the position of all super parent classes. I think this convenience is worth more than reading the current class first instead of last. --Popcorn (talk) 08:26, 2 November 2022 (PDT)
In the example it's showing diagram of all classes so it makes sense to go from the most generic one. So if we want to see what inherits from CBaseEntity it makes sense to put it first like this. But in case of entities we are starting at one specific one. So that one should be the first and the rest goes down from it. Even when searching these inheritances in available source code first thing you look for is for example CTriggerMultiple and next to it is : CBaseTrigger. Then you check CBaseTrigger and see : CBaseToggle etc. Same when checking NetProps dumps the types go from most specific to less. CBaseEntity being the first thing to read there on every entity page doesn't make sense. Also the current entity class being first there can make the Template:code class pretty much obsolete if also the file name is included (not that this wouldn't be the case with it being the last but it doesn't look that good) --Nescius (talk) 11:36, 2 November 2022 (PDT)

Sources of information

When filling in class names and such, is it deemed permissable to use leaks to gather the intel? For entities in games without officially available source code. TF2, Portal, Postal 3... technically even HL:S. What's the ruling? Cvoxalury (talk) 09:06, 24 July 2024 (PDT)

I did fill up Template:CD/superclass with classname info from leaked source code (not sure if there is other way to know those) but don't know what's the ruling. Opted to not link to any of the files in the leaked code that's on github. Template:CD/classlink contains only links to source 2013 sdk repo and alien swarm reactive drop which are public Nescius (talk) 09:21, 24 July 2024 (PDT)
About that, I realise it's more and more work, but are there plans to incorporate Valve's HL SDK repo into that linking mechanic too? Cvoxalury (talk) 09:39, 24 July 2024 (PDT)
This stuff ? -- Nescius (talk) 11:17, 24 July 2024 (PDT)
Created Template:CD/classlink/hl, Template:CD/superclass/hl that are used when goldsrc param is specified in CD. Also needs nodes created like Template:CD CBaseMonster (GoldSrc)‎‎, Template:CD CBaseToggle (GoldSrc)‎‎ etc. example use at monster_cockroach --Nescius (talk) 12:04, 24 July 2024 (PDT)
I think it'd be best to keep this constrained to official SDK releases. I'm not aware of any official guidelines on the VDC related to leaked content, although for the sake of general precedent, there is a very old instance of a Valve employee threatening to ban a user for documenting leaked content (see bottom). There may be a more recent example I'm not aware of. —Blixibon (talk) 09:50, 24 July 2024 (PDT)

Add file2?

Some entities store their stuff in multiple locations. func_vehicle, which just got its source code released today, stores the main code in vehicles.cpp, but the definition in trains.h.
SirYodaJedi (talk) 11:39, 21 August 2024 (PDT)

This applies to many entities (all HL1 weapons use weapons.h, but individual .cpp's), but the template always (that I've seen) points to just the .cpp. Including the header would imply that many cases of it would need to be changed. Personally, I think it's fine as is? If it points to a file on Github, the rest can be followed from there. Cvoxalury (talk) 12:48, 21 August 2024 (PDT)


Can do it by adding entry to Template:CD/classlink/hl like this
| CFuncVehicle = [https://github.com/shawns-valve/halflife/blob/master/dlls/vehicle.cpp vehicle.cpp]<br>[https://github.com/shawns-valve/halflife/blob/master/dlls/trains.h trains.h] Better like this considering it can be done to all entities in one edit if needed. --Nescius (talk) 14:28, 21 August 2024 (PDT)
oh, neat
SirYodaJedi (talk) 18:45, 21 August 2024 (PDT)

Overridding superclasses and classlinks?

For example, I was trying to link to the Mapbase version of subs.cpp on the func_null page.
SirYodaJedi (talk) 17:36, 9 September 2024 (PDT)

if file1 param is specified there will be automatic lookup done using the Template:CD/classlink. To prevent that can use nolink=1 param and then file1 is shown as specified. Maybe little confusing but at this point it's for backwards compatibility with the template --Nescius (talk) 17:39, 9 September 2024 (PDT)
Okay, thanks.
SirYodaJedi (talk) 17:40, 9 September 2024 (PDT)

Alien Swarm links need to be updated

Noticed when looking at light_directional; Reactive Drop's repo doesn't contain Valve's code anymore ("Master" branch is missing).
This mirror probably would suffice: https://github.com/Source-SDK-Archives/source-sdk-alien-swarm
Not sure where all the links are (there seem to be a few different classlink subpages), else I'd do the simple find and replace myself (and I don't want to muff anything up).
SirYodaJedi (talk) 18:18, 24 September 2024 (PDT)

The links are here Template:CD/classlink/asw. Though if you want to relink it to alien swarm sdk I assume there are some classes that are not present in alien swarm sdk and are only in reactive drop --Nescius (talk) 23:44, 24 September 2024 (PDT)