Documentation: VegetationComponent

From Noita Wiki
Jump to navigation Jump to search
Name Type Initial Value Example Range Description
Members
is_visual bool false the type of the tree. If is_visual=0 will insert the pixels into the world as cells. is_visual=1 will add a single cell and attach an image to that particle
is_real_pixels bool false if true will create the actual pixels into the world of the material given
is_grass bool false if set will treat this as grass and lay it on surfaces defined in material_on_top_of ( if not set will put it ontop of everything).
is_ceiling_plant bool false
check_safety bool false if set, will check the 4 corners for safty
rand_seed float 1234 [0, 10000] uses this to randomize the positions
tree_width float 120 [0, 512] partitions the space into tree_width lengths each partion might have a tree
tree_radius_low float 0.3 within the tree width what's the min distance it can spawn in (0) all the way to the left
tree_radius_high float 0.7 within the tree width what's the max distance (1) all the way to right
tree_probability float 0.7 what's the probability of a tree being spawned in a tree_width section
is_rare bool false if true, the tree is spawned only 1/3 of cases
tree_extra_y int 2 [0, 50] if is_visual is true, then this will move it down by this much
tree_image_file std::string filename of the png that will get loaded as the tree. The filename can have the $[1-4] notation in it
tree_image_visual std::string this will be used if is_visual=1, if it's not set then we will use tree_image_file
tree_material std::string wood material that the tree is made out of, or is_visual=1 then it's material that the seed is made out of
load_this_xml_instead std::string is_visual must be true! IF SET will load this entity at the x - visual_offset_x, y - visual_offset_y, (why _minus_ visual_offset_x? Because that's how the offsets work for visual vegetation sprites loaded through this, so that it is at least somewhat consistent)
visual_offset_x float 0 is_visual=1, will set the centerpoint (SetCenterOffset) of the image to this
visual_offset_y float 0 is_visual=1, will set the centerpoint (SetCenterOffset) of the image to this
visual_color std::string 0xFFFFFF is_visual=1, the color of the single cell that is created for the plant
grass_requires_neighbors bool false is_grass=1, and this is set, then will check that there is a pixel to down left and down right (so it doesn't leak down).
material_on_top_of std::string Creates this only on top of this material, if empty then anything goes
height_check int 0 if != 0 will check that there is air up to this height
max_y int 99999 this is the max y that the plant / tree can be placed
random_flip_x_scale bool false if true, has 50% chance of being flipped horizontally
Privates
mVisualColor uint32 0
tree_material_id int -1
material_id_on_top_of int -1
mTreeData const ceng::CArray2D< uint32 >*