New Box Droppers

Avatar
FelixGriffin
2,680 Posts
Posted Jun 09, 2012
Since the instances for droppers in instances/gameplay are so cluttered that there is a VDC page dedicated to listing their properties, I was thinking that they could be simplified.

With these new droppers, there are several "dropper" instances (dirty, clean, underground...), each of which takes as a parameter the name of the template. Those templates are in different instances, each of which holds one instance of that cube or whatever and a point_template in a nodraw-box.

So to make a default PTI-like cube dropper, you would place a copy of instances/itemdropper/dropper_clean.vmf, then somewhere in your map a copy of instances/itemdropper/weighted_cube.vmf, then pass @weighted_cubeas the parameter to the dropper. For multiple droppers, you would only neeonee weighted_cube.vmf instance. This would also mke it easy to add, say, Reepblue's repulsion cubes--it only needs one instance, not a dozen or so for various droppers.

It's almost working now. I'll post sample instances when I'm done.

Do you think that this is a good idea?

Advertisement
Registered users don’t see ads! Register now!
Avatar
spongylover123
944 Posts
Posted Jun 09, 2012
Replied 25 minutes later
what are you trying to say?
clarify.
Avatar
zivi7
649 Posts
Posted Jun 09, 2012
Replied 6 minutes later
I don't quite understand it yet either.

When I read "new droppers" I thought you meant the new dropper instances that came with the PTI and fit into a 128x128x128 block. They are slightly smaller than the common droppers. Only downside seems to be that their model apparently doesn't have the rusty skin for destroyed chambers.

Avatar
ChickenMobile
2,460 Posts
Posted Jun 09, 2012
Replied 5 hours later
If you really wanted to: you could have the dropper instance different from the entity spawner instance and just link the two together by using a filter which will open and close the dropper (pass the type of cube or the name of the cube to the dropper instance as a filter for the trigger that plays the dropper's aperture animations).

In an instance I made that spawned different types of gel, I used names of relays that enabled or disabled based on the $values you put into the instance.

Gel Dropper instance
This might be handy to look at if you want to spawn custom cubes or by using names instead of numbers.

&

Avatar
FelixGriffin
2,680 Posts
Posted Jun 09, 2012
Replied 51 minutes later
Sorry, clarifying (they work now):

When you make the instance, it has a replace parameter. You give it the name of another instance (holding the cube) which you have elsewhere in your map. Through a bit of magic it spawns the template inside that instance.

I'll upload it shortly.

Avatar
FelixGriffin
2,680 Posts
Posted Jun 09, 2012
Replied 1 hour later
Uploaded.

Customizable Box Droppers

Right now I only have the various types of normal weighted cubes, and the normal and rusted droppers. I'll add more soon, such as custom cubes and underground and Portal 1 droppers.

&

Avatar
Lpfreaky90
2,842 Posts
Posted Jun 10, 2012
Replied 8 hours later
Quick question: why would this be better then TSL Dropper AnnyCube v1.4 (FIXED) ?
I don't know, haven't tested them yet.
Avatar
FelixGriffin
2,680 Posts
Posted Jun 10, 2012
Replied 9 hours later
Don't those ones just pass parameters to a prop_weighted_cube? 7Zip doesn't like the RAR so I don't know how those work. But these ones use an external point_template, separate from the instance, in a different file.
Avatar
HMW
806 Posts
Posted Jun 11, 2012
Replied 22 hours later
I think this is a great idea. It significantly reduces the number of redundant entities.

It's easy to rack up many unneeded or redundant entities in a map nowadays, because those generic instances are, well, generic, and contain a lot of stuff that is not used (coughglobal_ents.vmfcough), or could be shared between multiple instances, like the cube templates.

I already made a set of "whatever-droppers" that drop anything that has a certain name, but sticking the templates for common cases in an instance is even better.

Avatar
ChickenMobile
2,460 Posts
Posted Jun 11, 2012
Replied 8 hours later

HMW wrote:
I think this is a great idea. It significantly reduces the number of redundant entities.

Sorry, what is a great idea? Bit hard to follow when so many people post :S

Avatar
BenVlodgi
633 Posts
Posted Jun 12, 2012
Replied 2 hours later
from what I've read this doesn't sound like a better idea
the default instance determines what type of cube to drop the exact same way you choose a type of cube... with parameters
there are no redundant entities in that instance, it kills the monster spawners on mapspawn if a different type of cube is desired
the PTI instance is actually the best box spawner I ever seen, very compact and easy to use
if you want to be able to change the type of box dropper it is... like overgrown/destroyed, just copy that instance and change the textures + the skin of the dropper
Avatar
FelixGriffin
2,680 Posts
Posted Jun 12, 2012
Replied 10 hours later
But what if, say, you wanted Reepblue's gelcube? Or the unfizzleable cube from Blue Portals? Or Skotty's ?rial faith cube? Those aren't included in the PTI instance, so you would need to add even more relays and logic_cases inside to determine which to use. And as those contain multiple entities, the logic would get even worse.

The purpose of these instances is so that custom cubes can be used as well as prop_weighted_cubes and prop_monster_boxes. Even if you use them for normal cube droppers, the instance it reads the properties from doesn't need to know about every different type of cube, so it contains fewer instances than the equivalent PTI instance.

Avatar
zivi7
649 Posts
Posted Jun 12, 2012
Replied 4 minutes later

BenVlodgi wrote:
the PTI instance is actually the best box spawner I ever seen, very compact and easy to use
if you want to be able to change the type of box dropper it is... like overgrown/destroyed, just copy that instance and change the textures + the skin of the dropper

Unfortunately, there doesn't seem to be a 128x128 model with the rusty skin.

Avatar
BenVlodgi
633 Posts
Posted Jun 12, 2012
Replied 8 hours later

FelixGriffin wrote:
Even if you use them for normal cube droppers, the instance it reads the properties from doesn't need to know about every different type of cube, so it contains fewer instances than the equivalent PTI instance.

I dont think you understand how the instance works, the PTI instance is both compact, and optimized... there is not a ton of different cubes, just 2... and if you want instances which have 1 type of cube each, then use the original instances

Avatar
FelixGriffin
2,680 Posts
Posted Jun 12, 2012
Replied 1 hour later
I understand the PTI instance. This one isn't meant for standard cubes, although it can be used for that (I posted the normal cubes with it as a demo because I don't have many custom cubes yet). It's meant to be useful for a mod which includes several new cubes, or for a mod using many themes (destroyed, old aperture, new), so that only a few instances are required. The PTI one is efficient at what it's meant for: clean style, with the cubes from the original game. But you'd need a new instance for destroyed theme, and one for a custom cube, and one for destroyed theme + custom cube, et cetera. That is what this aims to prevent.
Avatar
BenVlodgi
633 Posts
Posted Jun 12, 2012
Replied 1 hour later
I see, you could add items to the pti dropper, or make an instance with shared dropper stuff then make another instance which has the prop stuff
Avatar
HMW
806 Posts
Posted Jun 16, 2012
Replied 3 days later
On second thought, the centralised template approach does not seem such a good idea to me.

I tried to implement it with my custom droppers, but the savings in entity count you get from that is entirely offset by the things you need to add (scripting!) to track which cube belongs to which dropper. Unless you have some horribly complex custom thing that you want to spawn, I don't think this is a worthwhile approach.

For simple custom things, BenVlodgi's idea is probably fine: have one 'generic' dropper instance and include that in another instance that adds all of the specific stuff.

Avatar
FelixGriffin
2,680 Posts
Posted Jun 16, 2012
Replied 2 hours later
I agree with that. I tried to make the script as simple as possible by using parenting to get an info_target to remember the name of its own box, and it should work as long as there's a physics object in each cube, and only one thing needs to be out at a time from a single dropper. It could even work with only RunScriptCode inputs, I'll probably do that later.

I mostly made this for my forcefield cubes, which I might even need two templates for (there are more than sixteen entities per cube). Those are complex enough that it would be more efficient to use a shared template.

But you're right. Although hopefully not requiring as much logic as the PTI dropper, individual templates would suffice for most levels.

Advertisement
Registered users don’t see ads! Register now!
Avatar
HMW
806 Posts
Posted Jun 17, 2012
Replied 23 hours later
Though I must say that your approach of attaching this 'marker' to the spawned box is very clever! It's probably the most efficient way to solve this problem, if you do need to have a centralised template.

FelixGriffin wrote:
It could even work with only RunScriptCode inputs, I'll probably do that later.

Cool, just remember that you can't pass string literals via RunScriptCode. The double quotes will screw up the data structure of your vmf. There are other ways to get that done though. (Creative entity naming + EntityGroup[whatever].GetName() comes to mind.)