Documentation: MaterialInventoryComponent
Jump to navigation
Jump to search
Name | Type | Initial Value | Example Range | Description |
---|---|---|---|---|
Members | ||||
drop_as_item | bool | true | if true, drops a bag that the player can big up | |
on_death_spill | bool | false | if true, on the death this will explode all the materials into air | |
leak_gently | bool | true | NOTE( Petri ): 11.8.2023 - set this to false for old style leaky hidden piles situation. | |
leak_on_damage_percent | float | 0 | [0, 1] | if higher than 0 then it might leak when projectile damage happens |
leak_pressure_min | float | 0.7 | leak pressure coefficient | |
leak_pressure_max | float | 1.1 | leak pressure coefficient | |
min_damage_to_leak | float | 0.09 | the minimum damage that has to be done in order for a leak to occur | |
b2_force_on_leak | float | 0 | [0, 10] | if 0, nothing happens, elsewise will add a b2 force to the particleemitter which will push the b2body |
death_throw_particle_velocity_coeff | float | 1 | how far do we throw material particles on death? | |
kill_when_empty | bool | false | if set, will send MessageDeath when materials are drained | |
halftime_materials | bool | false | if true, will multiply the materials with the given halftimes | |
do_reactions | int | 0 | [0, 100] | NOTE( Petri ): 15.8.2023 - if > 0, will do CellReactions between the materials. Value is the percent chance of how often. 100 = every frame |
do_reactions_explosions | bool | false | requires do_reactions > 0 - are we allowed to do reaction explosions? | |
do_reactions_entities | bool | false | requires do_reactions > 0 - are we allowed to load entities when doing reactions? | |
reaction_speed | int | 5 | Note( Petri ): 17.8.2023 - how 'fast' do we let reactions happen. How many pixels of material do we convert at one time (5-10) seems like a nice speed. | |
reactions_shaking_speeds_up | bool | true | Note( Petri ): 17.8.2023 - added the ability of shaking the bottle to cause reactions to happen quicker. | |
max_capacity | double | -1 | how much materials we can store in total. < 0 = infinite | |
audio_collision_size_modifier_amount | float | 0 | if > 0, 'fullness of this container' * 'audio_collision_size_modifier_amount' is added to collision audio event size | |
last_frame_drank | int32 | -100 | last frame someone ingested from this via IngestionSystem
Note: There's a visual glitch related to this parameter one might encounter when using a player.xml from an old world in a newly generated world, that a potion has been drunk previously can miss its texture in the inventory. To restore the texture, drink the potion once or change the value of last_frame_drank of the potion to -100 in player.xml. | |
Custom data types | ||||
count_per_material_type | MATERIAL_VEC_DOUBLES | Count of each material indexed by material type ID | ||
Privates | ||||
is_death_handled | bool | false | ||
ex_position | vec2 | (0, 0) | used to figure out movement velocity | |
ex_angle | float | 0 | used to figure out movement velocity |