Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2024, 12:08:32 PM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Why is TTT removing entities?
Pages: [1]
Author Topic: Why is TTT removing entities?  (Read 5064 times)
iostream
Poster

Posts: 7



« on: July 14, 2010, 07:54:15 AM »

It seems as if TTT is removing some entities on load - causing a headache when mapping.
I'm pretty sure this is for a good reason, although I can't see why.

I've only seen func_brush and env_beam being affected by this yet, but there are probably more of them getting deleted.

So how should I create my awesome laser scanning machine thingy of awesomeness if I can't use lasers? :(

Remember, Respect is Everything
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #1 on: July 14, 2010, 08:19:28 AM »

TTT is not removing those entities by choice. They're removed by Gmod's built-in map cleanup functionality that TTT uses in order to reset the map to its original state (this also happens once when starting the first round, which you're seeing as "on load"). Rope entities were also victim to this, but only if they were parented to something. Which makes no sense, but that's gmod. For ropes I implemented a workaround where they are unparented just before cleanup, and re-parented afterwards. That way, gmod's cleanup seems to leave them alone and they work properly.

Recently a feature was added that might let me specify which entities I want gmod's cleanup to leave alone. If you can get me a test map (preferably small so it loads quickly, because I'll be doing that a lot) in which entities are being removed, I can see if I can fix it that way.
iostream
Poster

Posts: 7



« Reply #2 on: July 14, 2010, 09:09:48 AM »

Ah, I see.
GMod shouldn't just delete entities though. Kinda weird.

I have only experienced problems with func_brush and env_beam at the moment, but I'll try to hunt down some more.

Anyway, I threw together a sample map with a beam and brush:
http://iostream.se/stuff/ttt_deletedentities.zip

The env_beam is removed if it's got a name.
The func_brush is removed if it's parented to something (a func_door in this map) but doesn't need a name.


Keep up the good work man :)

Remember, Respect is Everything
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #3 on: July 14, 2010, 01:02:21 PM »

Thanks for the testmap.

Bad news is that the new cleanup feature in gmod that I mentioned doesn't appear to work.

Good news is that for func_brush, the same method I use for ropes does work.

From what I see in the test map, env_beam isn't removed. It's not visible, but the entity is there (see report_entities or ent_find env_beam). Looks the same as in sandbox (which doesn't do cleanup on map load). Maybe there's an issue with how you're setting it up?
iostream
Poster

Posts: 7



« Reply #4 on: July 14, 2010, 01:19:35 PM »

Yeah, sorry, I somehow managed to not turn the beam on.

Updated testmap:
http://iostream.se/stuff/ttt_deletedentities.zip

The problem seems to be with parenting.
I added another beam now, and parented its info_targets' to the func_door, and they are gone after cleanup.

The beam with its info_targets' not-parented is visible though.
« Last Edit: July 14, 2010, 01:21:06 PM by iostream »

Remember, Respect is Everything
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #5 on: July 14, 2010, 09:09:54 PM »

Adding info_parent to the workaround method also used by func_brush etc. seems to work. Gmod just hates those entities if they're parented or something. It will remove them during map cleanup and not respawn them properly, but only if they're parented. If not, cleanup ignores them and everything works.

Normally the cleanup process respawns the env_beam entity, after which it's confused and doesn't move with the info_target entities. I've made gmod's cleanup ignore the env_beam, and it appears to work now. This might break map logic that relies on an env_beam being respawned when a new round starts, but I'm not sure those exist.

Here's a test version of TTT that includes these changes.
iostream
Poster

Posts: 7



« Reply #6 on: July 17, 2010, 06:04:21 PM »

Terrific! Both the beam and brush are functioning properly now.
Thanks for fixing :)

Remember, Respect is Everything
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Why is TTT removing entities? « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.011 seconds with 18 queries.