random
Base class for all random spawners.
Vars | |
anchored | Stops persistent lootdrop spawns from being shoved into lockers |
---|---|
loot | A list of possible items to spawn e.g. list(/obj/item, /obj/structure, /obj/effect) |
loot_subtype_path | The subtypes (this excludes the provided path) to combine with the loot list |
loot_type_path | The subtypes AND type to combine with the loot list |
remove_if_cant_spawn | Whether items that cannot be spawned will be removed from the loot list. Keep it TRUE unless you've a good reason. |
spawn_all_loot | Whether the spawner should spawn all the loot in the list |
spawn_loot_chance | The chance for the spawner to create loot (ignores spawn_loot_count) |
spawn_loot_count | How many items will be spawned |
spawn_loot_double | If the same item can be spawned twice |
spawn_loot_split | Whether the items should be distributed to offsets 0,1,-1,2,-2,3,-3.. This overrides pixel_x/y on the spawner itself |
spawn_loot_split_pixel_offsets | The pixel x/y divider offsets for spawn_loot_split (spaced 1 pixel apart by default) |
spawn_random_offset | Whether the items should have a random pixel_x/y offset (maxium offset distance is ±16 pixels for x/y) |
spawn_scatter_radius | Determines how big of a range (in tiles) we should scatter things in. |
Procs | |
get_spawn_locations | If the spawner has a spawn_scatter_radius set, this creates a list of nearby turfs available that are in view and have an unblocked line to them. |
make_item | This helps keeping the modified weights more or less correct, since pick_weight doesn't appreciate decimals. Makes the actual item related to our spawner. |
skew_loot_weights | Levels out the weights of loot if lower than 1, or makes rarer spawns even more rare. |
spawn_loot | If the spawner has any loot defined, randomly picks some and spawns it. Does not cleanup the spawner. |
Var Details
anchored
Stops persistent lootdrop spawns from being shoved into lockers
loot
A list of possible items to spawn e.g. list(/obj/item, /obj/structure, /obj/effect)
loot_subtype_path
The subtypes (this excludes the provided path) to combine with the loot list
loot_type_path
The subtypes AND type to combine with the loot list
remove_if_cant_spawn
Whether items that cannot be spawned will be removed from the loot list. Keep it TRUE unless you've a good reason.
spawn_all_loot
Whether the spawner should spawn all the loot in the list
spawn_loot_chance
The chance for the spawner to create loot (ignores spawn_loot_count)
spawn_loot_count
How many items will be spawned
spawn_loot_double
If the same item can be spawned twice
spawn_loot_split
Whether the items should be distributed to offsets 0,1,-1,2,-2,3,-3.. This overrides pixel_x/y on the spawner itself
spawn_loot_split_pixel_offsets
The pixel x/y divider offsets for spawn_loot_split (spaced 1 pixel apart by default)
spawn_random_offset
Whether the items should have a random pixel_x/y offset (maxium offset distance is ±16 pixels for x/y)
spawn_scatter_radius
Determines how big of a range (in tiles) we should scatter things in.
Proc Details
get_spawn_locations
If the spawner has a spawn_scatter_radius set, this creates a list of nearby turfs available that are in view and have an unblocked line to them.
make_item
This helps keeping the modified weights more or less correct, since pick_weight doesn't appreciate decimals. Makes the actual item related to our spawner.
spawn_loc - where are we spawning it? type_path_to_make - what are we spawning?
skew_loot_weights
Levels out the weights of loot if lower than 1, or makes rarer spawns even more rare.
spawn_loot
If the spawner has any loot defined, randomly picks some and spawns it. Does not cleanup the spawner.