[18.22] serpent.block reference

Bugs that are actually features.
Post Reply
doktorstick
Fast Inserter
Fast Inserter
Posts: 144
Joined: Fri Aug 12, 2016 10:22 pm
Contact:

[18.22] serpent.block reference

Post by doktorstick »

Howdy. `serpent.block` isn't printing out information if the reference is shared among multiple keys nor is it indicating the value is a reference.

Take for instance the snippet below. If you examine the `.pictures` key in the large dump, only the first entry has the `tint` and `flags` expanded. All subsequent tables have them both listed as zero (e.g., `flags = 0`).

Code: Select all

>>> print (serpent.block (data.raw.fire["fire-flame"]))
... <snip> ...
  pictures = {                                                           
    {                                                                    
      animation_speed = 1,                                               
      axially_symmetrical = false,                                       
      blend_mode = "normal",                                             
      direction_count = 1,                                               
      filename = "__base__/graphics/entity/fire-flame/fire-flame-13.png",
      flags = {                                                          
        "compressed"                                                     
      },                                                                 
      frame_count = 25,                                                  
      height = 118,                                                      
      line_length = 8,                                                   
      scale = 0.5,                                                       
      shift = {                                                          
        -0.01953125,                                                     
        -0.453125                                                        
      },                                                                 
      tint = {                                                           
        a = 1,                                                           
        b = 1,                                                           
        g = 1,                                                           
        r = 1                                                            
      },                                                                 
      width = 60                                                         
    },                                                                   
    {                                                                    
      animation_speed = 1,                                               
      axially_symmetrical = false,                                       
      blend_mode = "normal",                                             
      direction_count = 1,                                               
      filename = "__base__/graphics/entity/fire-flame/fire-flame-12.png",
      flags = 0,                                                         
      frame_count = 25,                                                  
      height = 116,                                                      
      line_length = 8,                                                   
      scale = 0.5,                                                       
      shift = {                                                          
        -0.0078125,                                                      
        -0.45703250000000004                                             
      },                                                                 
      tint = 0,                                                          
      width = 63                                                         
    },                                                                   
... <snip> ...
However, if you loop on the individual tables in `.pictures`, it resolves properly.

Code: Select all

>>> for _, picture in pairs (data.raw.fire["fire-flame"].pictures) do
>>>     print (serpent.block (picture))
>>> end
{                                                                    
  animation_speed = 1,                                               
  axially_symmetrical = false,                                       
  blend_mode = "normal",                                             
  direction_count = 1,                                               
  filename = "__base__/graphics/entity/fire-flame/fire-flame-13.png",
  flags = {                                                          
    "compressed"                                                     
  },                                                                 
  frame_count = 25,                                                  
  height = 118,                                                      
  line_length = 8,                                                   
  scale = 0.5,                                                       
  shift = {                                                          
    -0.01953125,                                                     
    -0.453125                                                        
  },                                                                 
  tint = {                                                           
    a = 1,                                                           
    b = 1,                                                           
    g = 1,                                                           
    r = 1                                                            
  },                                                                 
  width = 60                                                         
}                                                                    
{                                                                    
  animation_speed = 1,                                               
  axially_symmetrical = false,                                       
  blend_mode = "normal",                                             
  direction_count = 1,                                               
  filename = "__base__/graphics/entity/fire-flame/fire-flame-12.png",
  flags = {                                                          
    "compressed"                                                     
  },                                                                 
  frame_count = 25,                                                  
  height = 116,                                                      
  line_length = 8,                                                   
  scale = 0.5,                                                       
  shift = {                                                          
    -0.0078125,                                                      
    -0.45703250000000004                                             
  },                                                                 
  tint = {                                                           
    a = 1,                                                           
    b = 1,                                                           
    g = 1,                                                           
    r = 1                                                            
  },                                                                 
  width = 63                                                         
}                                                                    
Hacked Splitters - the mod prophesied to bring balance to the belts

Rseding91
Factorio Staff
Factorio Staff
Posts: 11928
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [18.22] serpent.block reference

Post by Rseding91 »

Thanks for the report; that's working as intended. It puts a '0' in place to indicate it references a different already-existing table.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”