Return objects to their spot?
Post Reply
Quote
Re: Return objects to their spot?
Posted by DrGlass on Wed Dec 15th at 1:34am 2004


I know about the prop respawn, but lets say I have a map with a deep hole, and I dont want all my props sitting at the bottom of the hole the whole map, but I also dont want them to dissapear if they are NOT at the bottom of the hole.

So, do you think there is a way to teleport objects back to their original position if and only if they fall into this hole? I was thinking about a teleport system (in the fist part of HL2 there was a mini teleport that would move props) but that would only be able to zap them to one point...

any other ideas?




Quote
Re: Return objects to their spot?
Posted by Nanodeath on Wed Dec 15th at 1:42am 2004


If only there was some way to fire the OnUser1 of whatever fell into the hole this could be so easy...



Quote
Re: Return objects to their spot?
Posted by Vahn on Wed Dec 15th at 2:23am 2004


couldnt u set a trigger in the hole wich triggered the objects that fell in the hole to respawn again outside the whole ? maybe with a little delay time ....
im not sure i understand what u want exactly




Quote
Re: Return objects to their spot?
Posted by DrGlass on Wed Dec 15th at 2:34am 2004


ok, I want my prop_physics, for example a barrle to return or respawn to its original position only when it falls into an area of my map that is unreachable by the player.

the example is, a player shoots the barrel over the edge of a cliff into water. There is no way for that barrle to be retraived by a player becuase if they go off the cliff they will die.

the use of respawnable props would make this possible, only problem I dont want them to respawn unless they fall off the cliff.




Quote
Re: Return objects to their spot?
Posted by Nanodeath on Wed Dec 15th at 2:38am 2004


You could give the barrels like 10,000 life, and have a trigger hurt that only affected physics objects and do...1000 damage/sec? 10000 dmg/sec?



Quote
Re: Return objects to their spot?
Posted by Rof on Wed Dec 15th at 5:47am 2004


How about something like this:

Put a trigger_multiple at the bottom of the cliff. Set it's "physics objects" flag. On the output tab, set it to output: OnTrigger, target: !activator, input: Break . ("!activator" is a special name which sends an input to whatever activated the trigger).

Now when a prop_physics_respawnable falls into the trigger, it will be destroyed and respawn. This method means that you don't have to have the prop damagable by any other means.

If you want to get more fancy, you could use a filter_ ent to make sure the trigger_multiple only fires when a certain type or named object hits it.

If you're not using a prop_physics_respawnable as your object (say your using a func_physbox instead), you could use a similar setup with the addition of a point_template and env_entity_maker as a way of respawing any entity. (Set the entity's "OnBreak" output to ForceSpawn the env_entity_maker so it can be respawned after being destroyed by the trigger.)




Quote
Re: Return objects to their spot?
Posted by Nanodeath on Wed Dec 15th at 5:49am 2004


That's extremely handy...how did you figure out !activator?



Quote
Re: Return objects to their spot?
Posted by genesisrage on Wed Dec 15th at 6:35am 2004


and is there any other little tricks like that you know?





Quote
Re: Return objects to their spot?
Posted by Rof on Wed Dec 15th at 7:30am 2004


? quote:
That's extremely handy...how did you figure out !activator?


I've been browsing through the entities used in Valve's maps (try opening a bsp in a text editor and searching for "worldspawn"), and they use it quite a lot.




Quote
Re: Return objects to their spot?
Posted by Nanodeath on Wed Dec 15th at 7:34am 2004


Very nice, I'll have to do that sometime. In the meantime if you find anything particularly useful you're more than welcome to post it



Quote
Re: Return objects to their spot?
Posted by DrGlass on Wed Dec 15th at 12:21pm 2004


wow! I'll try that. The map is comming along now so I'll give that a try and report back.




Quote
Re: Return objects to their spot?
Posted by Rof on Wed Dec 15th at 6:36pm 2004


The only other special targetname I've found is "!player", which presumably targets the player (for single player only?)

It's used a lot in AI related stuff, e.g. ai_relationship and npc_antlion_template_maker, to make something friendly to the player or to follow him.




Quote
Re: Return objects to their spot?
Posted by Nanodeath on Wed Dec 15th at 8:19pm 2004


Hmm, I thought this was just player? At least when I was testing it in HL2 DM. Maybe it's either? For that matter, maybe just activator works too.



Quote
Re: Return objects to their spot?
Posted by W01f on Sun Dec 19th at 3:18am 2004


I tried this method, but the thing is that my prop_physics_respawnables don't respawn! Any idea why, and how to fix this problem?




Quote
Re: Return objects to their spot?
Posted by Joe-Bob on Sun Dec 19th at 3:54am 2004


Take a look at dm_lockdown, this is the method I used. You're pretty much naming a group of objects the same thing, making a point_template to reflect it, and then use a math_counter to spawn a new set when all of them are gone.
As I said, take a look at how Valve does it.




Quote
Re: Return objects to their spot?
Posted by W01f on Sun Dec 19th at 7:32am 2004


But that's not what I want. I want each individual object to respawn once it is "broken" by the trigger on its own, not as a group.




Quote
Re: Return objects to their spot?
Posted by Joe-Bob on Sun Dec 19th at 7:35am 2004


I'm not sure, then... maybe you could make a seperate template for each, and forcespawn on break.




Quote
Re: Return objects to their spot?
Posted by W01f on Mon Dec 20th at 3:08am 2004


Well I kinda solved the problem with teleporters, though the items don't return to their original spot which might be sorta weird...but whatever. Unless there is some way to get each item to be teleported back to their original spot...?




Quote
Re: Return objects to their spot?
Posted by Lan on Tue Dec 21st at 3:47am 2004


yes please, anymore ideas? tried them, didnt seem to work. [addsig]



Quote
Re: Return objects to their spot?
Posted by XenNetwork on Sat Jan 29th at 7:36am 2005


Is there a way to make it so when a jeep falls it will respawn?





Post Reply