I have never had to use this
I've had quite a few occasions where I want to know what the last prop spawned was. I use find() functions to mimic this functionality, but it's not very effective, and it's pretty expensive.
Anyone else think this would be a good addition, or am I way off?
I have never had to use this
Prop spawners do have an entity output for the last prop, I recently used it in an applyForce railgun effort.
I'm looking for either a function to pull the last spawned prop spawned by a specified player, or any player in general; or a trigger that executes an E2 when a prop is spawned onto the map.
I think the prop spawner only specifies what it spawned last, and not what was spawned last on the server.
I don't think this is useful. can you give an example for a contraption you would build with this?
"It's easy to win forgiveness for being wrong; being right is what gets you into real trouble." - Bjarne Stroustrup
Lífið læðist lúmskt áfram
Here is a method you can use to find your last spawned prop.
As a bonus for you, C will output the amount of props you currently have spawned.
Keep in mind that this ignores anything not under the class of "prop_physics".
Code:@persist Lp:entity if(first()){ findIncludePlayerProps(owner()) findByClass("prop_physics") Lp = findResult(1)} Lp:setColor(255,0,0)
Last edited by OmicroN; 07-09-2009 at 08:50 AM.
Are you sure the findResult() function returns entites in which order they were spawned?
"If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
-- Niels Bohr
Wire FPGA
we don't want wiremod (and especially E2) to interact with the player constructing things.
so, in addition to the apparent implementation problems, this won't ever be in the official wiresvn.
"It's easy to win forgiveness for being wrong; being right is what gets you into real trouble." - Bjarne Stroustrup
Lífið læðist lúmskt áfram
Unless something has changed recently, it has been that way for me.
The code is not telling it to find the nearest, furthest, or to find it in any other order. So logical assumption would be to find either the first or the last spawned item. In my practice I have found that it has tracked the latest object, if it is reversed just change the code to findResult(1) and then you're good.
Bookmarks