TTT2 icon indicating copy to clipboard operation
TTT2 copied to clipboard

Expanding the TTT2 mapping cfg

Open Crashington opened this issue 9 months ago • 12 comments

So, ive been thinking about how to contribute to ttt2. By far the thing I am most interested in personally and have the most experience with is the hammer side of it. So I thought, why not expand the ttt2 cfg with new entities usable for ttt maps?

The only downside I see is map compatibility with base TTT, but I dont think assuming that people use ttt2 is a problem at this point? could even just make the workshop items dependent on ttt2.

Anyway. In this space I would like to collect Ideas for possible entities that mappers would find helpful!

Heres what I got so far:

  • Radar entity that gives radar item on pickup

  • Body Armor entity that gives body armor on pickup

Both of these would be great as payoff for puzzles. Or imagine a large labyrinth map that dispenses Radars after 4 minutes of gametime so the round can end, etc. Obviously also has the upside that these could be made droppable ingame too, on death or whatever else youd want.

  • An entity that can force a role on the activator

Wouldnt it be cool to have functionality to let innocents become detectives for example? Or a map feature where a traitor can pay life to make another player into a traitor? so many possibilities with this. I am not sure if this works, but if the input was just a string it could even work with custom roles.

  • A "Random Grenade" entity and tweaks or new versions to the existing ones.

This ones is a bit more complicated. Currently there are three grenade entities available for mappers. weapon_ttt_confgrenade, weapon_ttt_smokegrenade and weapon_zm_molotov. The issue here, is that none of htese do what they say, and they arent even consistent about it. the former two are actually just randomised to a random grenade whenever they spawn, pulling both from the vanilla grenades and many addon grenades. the latter is randomised to many addon grenades but not into the other vanilla grenades. This means it is impossible to place any given grenade specifically since it will almost always be randomised. Since overriding the exististing entities is probably a nono, i would propose 4 new entities: weapon_ttt2_randomgrenade, weapon_ttt2_disco, weapon_ttt2_smoke and weapon_ttt2_incendiary. These entities would then actually do what they say.

These are my ideas so far. I would love for others to chime in and give ideas for other things they would want to see from something like this

Crashington avatar Mar 19 '25 14:03 Crashington

Heres what I got so far:

  • Radar entity that gives radar item on pickup

  • Body Armor entity that gives body armor on pickup

I like that. Would it also be possible to make this work for any item? So it could also support anti fire damage for example? Maybe map events could also trigger giving such items to everybody?

An entity that can force a role on the activator

I like that

A "Random Grenade" entity and tweaks or new versions to the existing ones.

The weapon spawning system in TTT2 has to be reworked a bit anyway. People such as @wgetJane already explained a few downsides. Besides that, I want to simplify some things and add a few more twists to some things. So if you were to rework the grenades, we (not explicitly me, but the TTT2 community) should first write down a list of things for the weapon spawning that should be changed in the future

TimGoll avatar Mar 19 '25 14:03 TimGoll

I dont currently know what is possible on the coding side of things since im kind of starting from 0 there (beyond general coding knowledge) My simplified idea would be to just make an entity for every item that grants the item on pickup/collision. I think this should be comparatively very easy. Making them droppable from the inventory or on death too is something i currently wouldnt know how to do.

map events that grant everyone are possible since you can do this for "anyone within a trigger" and then have the trigger cover the whole map. or you could just have stations spread around the map that spawn enough for everyone. or a single one that refills whenever the last one is taken, or a thousand other variations that could go toward this goal haha. all up to the mapper

as for grenades, sounds like thats something i should wait on for now then. but good to know similar efforts are already going on

Crashington avatar Mar 19 '25 15:03 Crashington

for the item entity: What if this was done with a single generic entity. lets call it weapon_ttt2_equipment. with 3 fields: #1 is a string field that asks which item this entity should grant on pickup. #2 is a string field that asks which item this entity should grant if the item in field 1 does not exist #3 is an int/enumeration that asks what should happen generally if item #1 cant be found in the server files with option like a) do nothing b) despawn the entity c) grant the fallback item in #2 maybe: #4 a field that lets the mapper choose which model is used for the entity maybe: #5 a name/description field that can show up for those addons that show weapon/equipment data in the world?

this should make it super flexible, giving alot of power to mappers. the fallback system should be very fool proof to allow even custom entities from addons

I assume checking for any given item name and checking if its somethign that exists in the current installation should be trivial, right?

ideally this would then also inherit generic prop_physics stuff like disabled movement, scale, color override, parenting etc. giving mappers all the options to use these as they want in their map

Crashington avatar Mar 19 '25 15:03 Crashington

My simplified idea would be to just make an entity for every item that grants the item on pickup/collision.

You could probably create an entity and use its inputs to define the item grated to the player. Take a look at this: https://github.com/TTT-2/TTT2/blob/master/gamemodes/terrortown/entities/entities/ttt_credit_adjust.lua#L34

as for grenades, sounds like thats something i should wait on for now then. but good to know similar efforts are already going on

We can try to get the outline written down in the coming days. Maybe I have some motivation to get it started today

TimGoll avatar Mar 19 '25 15:03 TimGoll

your idea sounds solid. Although I'm not a mapper and can't say much about this. Maybe @NickCloudAT @Gensokian can provide some input here. I think @wgetJane also created maps in the past

TimGoll avatar Mar 19 '25 15:03 TimGoll

personally i wouldn't keep such changes to ttt2 only, especially since the ideas given can be pretty easily implemented into ttt and the official garrysmod+ttt repo has been very receptive to additions to the gamemode

most of these ideas also can already be quickly implemented with custom map lua (using the lua_run entity), though i guess it's nicer for them to be built into ttt

A "Random Grenade" entity and tweaks or new versions to the existing ones.

i think there should just be a ttt_random_grenade entity, seems pretty simple

a keyvalue could also be added to ttt_random_weapon that let's it never spawn as a grenade

This ones is a bit more complicated. Currently there are three grenade entities available for mappers. weapon_ttt_confgrenade, weapon_ttt_smokegrenade and weapon_zm_molotov. The issue here, is that none of htese do what they say, and they arent even consistent about it. the former two are actually just randomised to a random grenade whenever they spawn, pulling both from the vanilla grenades and many addon grenades. the latter is randomised to many addon grenades but not into the other vanilla grenades. This means it is impossible to place any given grenade specifically since it will almost always be randomised. Since overriding the exististing entities is probably a nono, i would propose 4 new entities: weapon_ttt2_randomgrenade, weapon_ttt2_disco, weapon_ttt2_smoke and weapon_ttt2_incendiary. These entities would then actually do what they say.

this is an issue caused by ttt2's weapon spawning system, it's not a base ttt issue

wgetJane avatar Mar 19 '25 22:03 wgetJane

good to know. i will look into bringing this up on the base ttt too. do you have other ideas that could expand mapper tools like this?

Crashington avatar Mar 19 '25 22:03 Crashington

Some more ideas:

Any Traitor only entity should have a general purpose variant. For example:

  • A ttt_role_button (identical to traitor button, but you can set which role(s) can see it) would be great. Useful in base TTT for detective buttons and for TTT2 there are tons of applications.
  • A brush-based ttt_role_check alternative for ttt_traitor_check. Usually, ttt_logic_role will be used anyway, but why have the brush-based entity only for traitors?

I would also love to have credit check/adjust integrated into the traitor/role button. The workflow isn't difficult to make a button that costs, but you could have a much nicer UI if you had an entity that integrates the credit check. Currently you have to communicate the credit cost by writing it in the description, if it was baked into the button entity you could have a standardized way to display its cost and clearly show if its pressable or not.

ttt_role_filter, aka a real filter entity that can be used as such. The current ttt_logic_role seems to be a bit of a workaround to not being able to make actual filters with TTT roles. No idea if that has changed and is possible now.

Something to track playercount/deaths during an active round would also be useful when you want to trigger events or change map setup depending on playernumber. Some maps open up more room if there are more players for example. Easily done in lua, but would be cool as an entity.

MrXonte avatar Mar 20 '25 10:03 MrXonte

Great ideas! especially integrating all of the credit functionality directly into buttons is something i completely forgot to write down and have wanted since i started mapping.

I wonder how all the generic role entities should/could work. would they just check via strings? would something like a role's coloring be easily accessible so that for example a jackal button is automatically colored in that light blue?

Crashington avatar Mar 20 '25 12:03 Crashington

I wonder how all the generic role entities should/could work. would they just check via strings? would something like a role's coloring be easily accessible so that for example a jackal button is automatically colored in that light blue?

i think the TTT2 implementation of ttt_logic_role already tackles this by using the ROLE_NAME syntax for new roles, so it should work using those strings. Image Also, unless I'm going insane, i think the traitor button already has all the code necessary to make it generic and display the correct role color? There are checks for role and team, all we need is a field for role/team in the fgd entity.

MrXonte avatar Mar 20 '25 13:03 MrXonte

btw there's already a ttt_role_filter, should be available from the march 26th update

wgetJane avatar Mar 20 '25 13:03 wgetJane

btw there's already a ttt_role_filter, should be available from the march 26th update

awesome! 😁

MrXonte avatar Mar 21 '25 14:03 MrXonte