Skip to content

vbsp_config dropperitems

Spencer Brown edited this page Feb 8, 2025 · 3 revisions

DropperItems is a block in vbsp_config describing various properties for cubes and cube droppers that may exist in the map. This allows cubes to be synthesised by the compiler, and allows different droppers and cubes to seamlessly be mixed and matched. The block has 3 different subtypes - Cube, Dropper, and CubeAddon. Each must have a unique ID value.

For custom cubes, the way this functions is that you do not create the prop_weighted_cube yourself, instead telling the compiler how to do so. It handles putting it in the dropper, fizzling/respawning it, etc. Any logic must be done via a "cube addon", which is an instance added on top of the cube.

Note that in the case where the timer value is used to link a cube and dropper item, each will keep their original unique instance names and will not conflict. All that happens is fizzling/respawn logic is interconnected to make them appear to be part of the same item.

Cube

The Cube block represents a type of cube which can spawn, and also a 'built in' cube addon for custom cube functionality. It has the following syntax:

"DropperItems"
	{
	"Cube"
		{
		"ID"          "UNIQUE_ID"
		"ItemID"      "<ITEM_ID>"
		"CubeType"    "STANDARD"
		"HasName"     "UniqueCube"
		"isCompanion" "0"
		"Offset"      "20"
		"baseTint"    "255 255 255"
		
		"Pack"      "PACKLIST_ID"
		"Model"     "models/props/metal_box.mdl"
		"PackColor" "PACKLIST_ID"
		"Model"     "models/props/metal_box_color.mdl"
		
		}
	}

The options are as follows:

  • ID: A unique name for this type, used to refer to it elsewhere. The following names are specially handled for Valve's cube types:
    • VALVE_CUBE_STANDARD
    • VALVE_CUBE_COMPANION
    • VALVE_CUBE_REFLECTION
    • VALVE_CUBE_SPHERE
    • VALVE_CUBE_FRANKEN
  • ItemID: A lookup value which should point to the instance used for the dropperless cube variant. This will automatically handle the various interactions and generate instances. This instance name will never appear in the final map. The item should have a timer value widget, to support having a pre-placed cube link to a dropper.
  • CubeType: Defines the type of cube it will behave as. This determines which buttons it presses, interactions with lasers, and the skins desired for gel. Valid values are WEIGHTED, COMPANION, REFLECTION, SPHERE, ANTIQUE (for an Old Aperture cube), and FRANKEN. Franken-type items are not able to switch model.
  • HasName: The name used in voice attributes. This should also be unique.
  • isCompanion: If True, the item will be treated as 'special' for the purposes of voicelines and other logic. This is provided to allow Companion Spheres, for example.
  • tryRusty: This is only really relevant for Valve's cubes. All the rusty cube types have one or more missing gel skins, so a custom model is required. If this is set, the custom model is skipped if it is impossible to paint this cube to save map filesize.
  • Offset: The distance from the origin of the model to below its base. This allows cubes to be generated at a consistent height above the floor.
  • BaseTint: If set, applies a rendercolor tint to the model. Any Cube Colouriser tints will be multiplied with this.
  • Model: If set, switch to a custom model for the cube.
  • ModelColor: A custom model used when the cube has been colourised with the Cube Colouriser.
  • ModelSwapMeth: If a custom model is provided, this specifies the method used to switch, either setmodel or cube_type. setmodel() is a bit more reliable, but Cube Type 6 is required if the collision changes from the base type.
  • Pack, PackColor: Deprecated, packlists for explicitly setting resources. These are now automatically detected, intelligently excluding any skins that cannot be used.
  • overlay_inst, overlay_pack, vscript, outputs, fixups: These keys configure the "built in" cube addon for the item, allowing adding custom logic. See Cube Addons below.
  • thinkFunc: Only one think function is permitted, so only the base cube is able to directly set the think function.

Dropper

The dropper block allows for defining custom items which can drop any type of cube. The template inside should be configured to spawn box and cube_addon_*, and use unique names. box should be fizzled as normal and detected by filters. It has the following syntax:

"DropperItems"
	{
	"Dropper"
		{
		"ID"             "UNIQUE_ID"
		"ItemID"         "<ITEM_ID>"
		"cube_ang"	     "0 45 180"
		"Cube_Pos"       "0 0 -64"
		"BluePaintInst"  "instances/bee2/clean/items/unique_dropper/painter.vmf"
		"OutStartDrop"   "instance:spawn_man;OnUser2"
		"OutFinishDrop"  "instance:close_trig:OnStartTouch"
		"InputRespawn"   "instance:spawn_man;SetStateATrue"
		}
	}

The options are as follows:

  • ID: A unique name for this type, used to refer to it elsewhere.
  • ItemID: A lookup value which should point to the instance used for the dropper. This will register it as the dropper, and apply the various transformations.
  • Cube_Ang: The orientation of the cube. This allows ensuring laser cubes and FrankenTurrets point in the correct direction. A deprecated cube_dir option is also available, which simply specifies the direction of the front of the cube.
  • Cube_Pos: Specifies the position of the floor under the generated cube.
  • FilterName: Set to the name of the filter_activator_name inside the dropper instance used to detect the cube. This allows compiler logic to reuse the filter.
  • BouncePaintInst: Cubes prepainted with Repulsion Gel need some special handling, since they would bounce around uncontrollably inside the dropper. This controls the behaviour to use.:
    • If this is set to <prepaint>, the cube will be spawned visually painted, then set to actually painted after it leaves the dropper. Old Aperture droppers use this since you can't see it inside, so you don't see the cube not bouncing off of surfaces.
    • Otherwise, this is an instance overlaid on the dropper. In this case the cube will be unpainted, then be painted as it leaves. An output is automatically added to FireUser1 on painter_blue to trigger FX when the cube leaves the dropper, as well as actually paint it.
  • OutStartDrop: An instance proxy output which will be fired when the dropper starts the spawning process. This should be triggered at the same time as the dropper fizzles already-spawned cubes.
  • OutFinishDrop: An instance proxy output which will be fired when the cube has completely left the dropper. This dropper should arrange to fire this output with the cube as the !activator.
  • InputRespawn: An instance proxy input which will make the dropper respawn a cube.

Cube Addons

Cube addons are a system to allow items or config settings to add additional logic to cubes. For example the Rexaura package optionally adds triggers to dissolve cubes when hit by pellets. As mentioned above each cube type also contains a "built in" addon, which is defined inline with other options.

Entities in the addon should be named cube_addon_something to make them be respawned in the cube template, and can refer to the cube via a name of box. Make sure your entity names have an author/package name to prevent collisions with other items. It's suggested to parent everything to the cube (even logic) if possible to ensure they are cleaned up, but you can also define an OnFizzled output.

For Frankenturrets, the instance is rotated to match the "box" part if it spawns extended.

The syntax looks like so:

"CubeAddon"
	{
	"ID" "MY_ADDON"
	"instance" "instances/BEE2/logic/amazing_addon.vmf"

	"Outputs"
		{
		"OnSpawn" "cube_addon_amazing_spawn_rl:Trigger::0:-1"
		"OnFizzle" "cube_addon_amazing_pfx:FadeOut:1.5:0:-1"
		"OnFinishedDrop" "cube_addon_amazing_pfx:Start::0:-1"
		}
	"Fixups"
		{
		"$is_amazing" "1"
		"$in_dropper" "<dropper>"
		"$tint" "<tint>"
		}
	}

The options are as follows:

  • Outputs: Allows triggering IO events when certain things occur. The name is the type of output, and the value is processed like in VMF or AddOutput syntax. !self can be used to refer to the cube.
    • OnSpawn: Fired when the cube is created.
    • OnFizzle: Fired when the cube is fizzled, or otherwise destroyed.
    • OnFinishedDrop: Fired when the cube has left the dropper completely. This can be used to wake up the cube and begin doing things. For dropperless cubes, this is fired shortly after OnSpawn.
  • instance: An instance which is placed on top of the cube to add additional logic to make it functional. Entities must be named specially as mentioned above.
  • vscript: Specifies one or more .nut files to append to the cube's script function list. Keep in mind other scripts could have been added, so make sure to prefix any variables/functions. Only the base cube type is able to set the think function.
  • fixups: Defines a block of fixup variables to configure the instance. These can be constant, read out of the original cube's definition, or one of several special values (many set to 1/0 depending on some condition). If the block is not specified, all fixups are copied unchanged. The following special values are allowed:
    • <cube>: Set to 1 if this is a cube placed outside a dropper.
    • <dropper>: Set to 1 if this is a cube spawning from a dropper.
    • <linked>: Set to 1 if this is a dropper and dropperless cube linked together, so another cube is linked to this.
Clone this wiki locally