container#
Hierarchy#
Valid Parent Blocks:
ID Properties#
This block should not have an ID.
Parameters#
- capacity đź”—
Type:
integerNo description
- conditionAffectsCapacity đź”—
Type:
booleanSets whenever the condition of the part will impact the capacity. A lower condition will negatively impact the container’s capacity.
- contentType đź”—
Type:
stringUnclear how this parameter works exactly. The game uses it to define the “content” of tires and gas tanks by providing the string keys
GasolineorAir. It seems to simply remove any item container being used as the container for this part.
- seat đź”—
Type:
stringThe seat ID of this container. When present, this container can be used as a seat for a vehicle.
- test đź”—
Type:
stringRefers to a Lua global function returning a boolean which is used to determine whether an item can be put in this container when trying to transfer items.
Here’s an example from the vanilla game, with the parmeter being set to:
test = Vehicles.ContainerAccess.GloveBox
With the Lua function being defined as:
function Vehicles.ContainerAccess.GloveBox(vehicle, part, chr) if chr:getVehicle() == vehicle then local seat = vehicle:getSeat(chr) -- Can the seated player reach the passenger seat? -- Only character in front seat can access it return seat == 1 or seat == 0; elseif chr:getVehicle() then -- Can't reach from inside a different vehicle. return false else -- Standing outside the vehicle. if not vehicle:isInArea(part:getArea(), chr) then return false end local doorPart = vehicle:getPartById("DoorFrontRight") if doorPart and doorPart:getDoor() and not doorPart:getDoor():isOpen() then return false end return true end end
The parameters are:
vehicleis a BaseVehicle classpartis a VehiclePartchris an IsoGameCharacter