• Moving an entity through level transitions
    12 replies, posted
Is it possible to store somewhere a brush entity (func_tracktrain as example) and then spawn it on a new loaded using changelevel (not changelevel2) map?
You could store the entities properties in a text file and then use the text file to recreate the entity.
Yeah, but this wouldn't work for brush entities
Why is that?
My bad, just discovered that entity model can be a brush as well
Oh fuck, you're right. I get it now sorry. The brush won't exist on the other map, I think you'll have to make a SENT with recreate the brush with http://wiki.garrysmod.com/page/Category:mesh.
I have another problem: when I spawn func_tracktrain and set set save value "target" to patch_track name, the train just doesn't want to move. What else do I need to do to make it work?
I'm not familiar with func_tracktrain, it seems like there's more keyvalues to set. func_tracktrain Also, I would try to call SetSpeed 1 and StartForward using ENT:Fire.
I had to do a lot in my Lambda gamemode to achieve this. You have look at it here https://github.com/ZehMatt/Lambda/blob/develop/gamemode/sv_transition.lua
holy shit Maybe you know how to help me. I realized that all Half-Life Source maps in On a Rail chapter has the train placed in a black box outside of map. If map is loaded through "map" command, train moves to the track and works perfectly. When map is launched through "changelevel", the train stays in the box. I tried manually setting its position and angles, also making solid and not nodraw, but it doesn't move at all. Also I tried spawning a new train with getting the brush model of the old one. Still not moving.
I also noticed this with c2a2c, specifically - I believe this is caused by the saverestore system marking the entity as dormant, but never updating it since no data existed from the previous map. You can get the train to appear by reversing the CBaseEntity::MakeDormant's effects, however, you cannot make it move along its path. This is because MakeDormant clears the entity's Think method and there is no way to restore it from Lua.
Ok, but if I recreate an entity with different parameters, how do I make it move? "target" keyvalue sets the path_track, but it doesn't work
Yeah, it looks like you can skip out on the saverestore system's dormancy manually by changing the globalname to the current map, or just an empty string.
Sorry, you need to Log In to post a reply to this thread.