Closed 111112oo closed 2 weeks ago
Here is an updated version of the test map to test an edge case with multiple identical named entities in the template: test_tf2ctemplaterelay.txt I have added a button in the back which spawns a template of 2 identically named brushes 3 times and should then colour them green then red. Currently, in TF2C 2.1.5, it doesn't rename any of the entities or outputs, resulting in it "working", but under the hood would cause serious problems in other setups. In live TF2 it renames each set of brushes as a set and the outputs correctly, resulting in 3 different names shared across the 6 brushes. I am also in the 2.2 test where a fix for this issue is being implemented, but it manages to correctly rename the brushes but fails to rename the outputs in this situation.
Fixed in 2.2
Noticed this when testing out some maps from live TF2 I want to run on my server in the future, key elements were entirely breaking due to this.
In live TF2, when you uncheck the "Preserve entity names, don't do name fixup" spawnflag on a point_template, it will rename any targeted entities in the template along with those links like parenting and logic. This does not fully happen in TF2C, it seemingly cannot recognize or rename any logic targeting.
Here is a simple test map showcasing this roughly copying a setup used in a map I want to run: test_tf2ctemplaterelay.txt (rename to .vmf)
Both buttons here spawn a func_door with a self-deleting logic_relay that tells the door to open on spawn before deleting. The difference between them is the left button also spawns a parented func_brush with the door. Both buttons work fine in live TF2. But in TF2C the left button doesn't work and the right button does but only because of the problems here semi-canceling each-other out. To be more specific, the right button template doesn't rename anything in TF2C (the func_door and the logic_relay outputs), but renames everything in live TF2. Whereas the left button template renames the func_door in TF2C due to the parenting, but still misses the logic_relay that live TF2 gets. (The func_brush isn't renamed in both games here I assume cause it isn't targeted.)
(I was checking renames by using ent_fire really quickly though I didn't set it up to do that easily lol oops)
Templates are a very important aspect to advanced mapping so it's not great to have a glaring compatibility issue here.