Skip to main content

UpgradeItem

Struct UpgradeItem 

Source
pub struct UpgradeItem {
Show 29 fields pub name: &'static str, pub stack_size: i64, pub alt_select: LuaAny, pub select: LuaAny, pub hidden: Option<bool>, pub order: Option<&'static str>, pub subgroup: Option<&'static str>, pub icon: Option<&'static str>, pub factoriopedia_description: Option<&'static str>, pub hidden_in_factoriopedia: Option<bool>, pub localised_description: Option<&'static str>, pub localised_name: Option<&'static str>, pub parameter: Option<bool>, pub factoriopedia_alternative: Option<&'static str>, pub auto_recycle: Option<bool>, pub burnt_result: Option<&'static str>, pub dark_background_icon: Option<&'static str>, pub default_import_location: Option<&'static str>, pub flags: Option<&'static [&'static str]>, pub fuel_acceleration_multiplier: Option<f64>, pub fuel_acceleration_multiplier_quality_bonus: Option<f64>, pub fuel_category: Option<&'static str>, pub fuel_emissions_multiplier: Option<f64>, pub fuel_glow_color: Option<Color>, pub fuel_top_speed_multiplier: Option<f64>, pub fuel_top_speed_multiplier_quality_bonus: Option<f64>, pub fuel_value: Option<&'static str>, pub has_random_tint: Option<bool>, pub ingredient_to_weight_coefficient: Option<f64>,
}
Expand description

Minimal UpgradeItemPrototype for data.extend.

An upgrade planner.

For an entity to be allowed as an upgrade source, it must be minable, may not have “not-upgradable” flag set and may not be hidden. Additionally, the source entity’s mining result must not be an item product that is hidden. Mining results with no item products are allowed.

For an entity to be allowed as an upgrade target, it must have least 1 item that builds it that isn’t hidden.

For two entities to be upgrades of each other, the two entities must have the same fast replaceable group, the same collision box and the same collision mask. Additionally, underground belts cannot be upgraded to transport belts and vice versa.

For an entity to be automatically upgraded to another entity without configuring the upgrade planner, the next upgrade of the upgrade source entity must be set.

type = "upgrade-item" is injected by the Lua generator.

Fields§

§name: &'static str

Unique textual identification of the prototype. May only contain alphanumeric characters, dashes and underscores. May not exceed a length of 200 characters.

For a list of all names used in vanilla, see data.raw.

§stack_size: i64

Count of items of the same name that can be stored in one inventory slot. Must be 1 when the "not-stackable" flag is set.

§alt_select: LuaAny

Prototype property alt_select.

§select: LuaAny

Prototype property select.

§hidden: Option<bool>

Prototype property hidden.

§order: Option<&'static str>

Used to order prototypes in inventory, recipes and GUIs. May not exceed a length of 200 characters.

§subgroup: Option<&'static str>

The name of an ItemSubGroup.

§icon: Option<&'static str>

Path to the icon file.

Only loaded, and mandatory if icons is not defined.

§factoriopedia_description: Option<&'static str>

Provides additional description used in factoriopedia.

§hidden_in_factoriopedia: Option<bool>

Prototype property hidden_in_factoriopedia.

§localised_description: Option<&'static str>

Overwrites the description set in the locale file. The description is usually shown in the tooltip of the prototype.

§localised_name: Option<&'static str>

Overwrites the name set in the locale file. Can be used to easily set a procedurally-generated name because the LocalisedString format allows to insert parameters into the name directly from the Lua script.

§parameter: Option<bool>

Whether the prototype is a special type which can be used to parametrize blueprints and doesn’t have other function.

§factoriopedia_alternative: Option<&'static str>

The ID type corresponding to the prototype that inherits from this.

For example, if this is an EntityPrototype, this property’s type is EntityID.

§auto_recycle: Option<bool>

Whether the item should be included in the self-recycling recipes automatically generated by the quality mod.

This property is not read by the game engine itself, but the quality mod’s data-updates.lua file. This means it is discarded by the game engine after loading finishes.

§burnt_result: Option<&'static str>

The item that is the result when this item gets burned as fuel.

§dark_background_icon: Option<&'static str>

If this is set, it is used to show items in alt-mode instead of the normal item icon. This can be useful to increase the contrast of the icon with the dark alt-mode icon outline.

Path to the icon file.

Only loaded if dark_background_icons is not defined.

§default_import_location: Option<&'static str>

Prototype property default_import_location.

§flags: Option<&'static [&'static str]>

Specifies some properties of the item.

§fuel_acceleration_multiplier: Option<f64>

Must be 0 or positive.

§fuel_acceleration_multiplier_quality_bonus: Option<f64>

Additional fuel acceleration multiplier per quality level. Defaults to 30% of fuel_acceleration_multiplier - 1 if fuel_acceleration_multiplier is larger than 1. Otherwise defaults to 0.

Must be 0 or positive.

§fuel_category: Option<&'static str>

Must exist when a nonzero fuel_value is defined.

§fuel_emissions_multiplier: Option<f64>

Prototype property fuel_emissions_multiplier.

§fuel_glow_color: Option<Color>

Colors the glow of the burner energy source when this fuel is burned. Can also be used to color the glow of reactors burning the fuel, see ReactorPrototype::use_fuel_glow_color.

§fuel_top_speed_multiplier: Option<f64>

Must be 0 or positive.

§fuel_top_speed_multiplier_quality_bonus: Option<f64>

Additional fuel top speed multiplier per quality level. Defaults to 30% of fuel_top_speed_multiplier - 1 if fuel_top_speed_multiplier is larger than 1. Otherwise defaults to 0.

Must be 0 or positive.

§fuel_value: Option<&'static str>

Amount of energy the item gives when used as fuel.

Mandatory if fuel_acceleration_multiplier, fuel_top_speed_multiplier or fuel_emissions_multiplier or fuel_glow_color are used.

§has_random_tint: Option<bool>

Prototype property has_random_tint.

§ingredient_to_weight_coefficient: Option<f64>

Prototype property ingredient_to_weight_coefficient.

Trait Implementations§

Source§

impl Clone for UpgradeItem

Source§

fn clone(&self) -> UpgradeItem

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for UpgradeItem

Source§

impl Debug for UpgradeItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for UpgradeItem

Source§

fn default() -> UpgradeItem

Returns the “default value” for a type. Read more
Source§

impl PartialEq for UpgradeItem

Source§

fn eq(&self, other: &UpgradeItem) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for UpgradeItem

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.