When applying particles to a mob or obj that has the KEEP_TOGETHER appearance flag set, and at least one overlay (or underlay) the space in which particles can display becomes restricted. In the provided test case of a 32x32 mob, the restricted particle height and width ranges are both 1-63 pixels with 1,1 being the top left corner of the mob, and 63,63 being the bottom right most.
Notably the default dimensions of particles are 100x100. This results in particles spawning in outside of the 63x63 range and being hidden. You CAN unhide them though, if you use drift or gravity to send them upwards and to the left
NOTE: the 63x63 size limit only applies to 32x32 atoms/overlays, larger atoms/overlays have larger ranges
EXAMPLE: a 64x64 atom with a 64x64 overlay, a 32x32 atom with a 64x64 overlay, or a 64x64 atom and a 32x32 overlay all have a max dimension of 127x127.
Numbered Steps to Reproduce Problem:
1. Assign a particle to a mob/obj
2. Apply an overlay to the mob/obj
3. Set the KEEP_TOGETHER appearance flag
the order of these steps does NOT matter.
Code Snippet (if applicable) to Reproduce Problem:
appearance_flags = KEEP_TOGETHER
particles = new/particles/some_particle
overlays += image('icon.dmi', "overlay")
FULL TEST CASE DOWNLOAD: https://www.dropbox.com/s/ow6y30r1cex1r07/ 20211209_Sovexe.zip?dl=0
world
// Set the world's name. This will appear in the title bar.
name = "Your First World"
// Configure the default mob object players will log in as.
mob = /mob/demo
mob/demo
icon = 'icons/demo.dmi'
icon_state = "base"
particles = new/particles/demo_particle
verb/set_KEEP_TOGETHER_on()
appearance_flags = KEEP_TOGETHER
world.log << "KEEP_TOGETHER flag has been set"
verb/set_KEEP_TOGETHER_off()
appearance_flags = 0
world.log << "KEEP_TOGETHER flag has been cleared"
verb/apply_overlay()
overlays += image('icons/demo.dmi', "overlay")
verb/remove_overlay()
overlays = null
verb/set_custom_particles_dimensions()
particles.width = input(usr, "Enter the new width", "", 100) as num
particles.height = input(usr, "Enter the new height", "", 100) as num
world.log << "Particles dimensions set to ([particles.width],[particles.height])"
//max size that this mob can handle displaying particles when bug occurs
verb/set_particles_dimensions_63x63()
particles.height = 63
particles.width = 63
world.log << "Particles dimensions set to ([particles.width],[particles.height])"
//min size that this mob can handle displaying particles
verb/set_particles_dimensions_1x1()
particles.height = 1
particles.width = 1
world.log << "Particles dimensions set to ([particles.width],[particles.height])"
verb/set_particle_dimensions_default()
particles.height = 100
particles.width = 100
world.log << "Particles dimensions set to ([particles.width],[particles.height])"
particles/demo_particle
color = "#000"
gravity = list(1,0,0)
count = 5
spawning = 1
lifespan = 10
turf
floor
icon = 'icons/floor.dmi'
area
outside
Expected Results:
-Particles are restricted to the height and width set on the particles object
Actual Results:
-Particles are artificially restricted into a box around the atom whose height and width are equal to the twice largest dimensions of the kept together sprites minus 1
ex. 32x32 sprite and overlay
32x2-1=63
63x63 limit
Does the problem occur:
Every time? Or how often?Every time when conditions are met
In other games?Yes
In other user accounts?Yes
On other computers?Yes
When does the problem NOT occur?
When only using just KEEP_TOGETHER with no over/underlays, or when using over/underlays and not using KEEP_TOGETHER
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
unknown
Workarounds:
None that I am aware of, other than not combining these.
https://streamable.com/foqujs