Page 2 of 2

Re: LuaGameScript.get_data_raw()

Posted: Tue May 09, 2017 9:42 pm
by Rseding91

Re: LuaGameScript.get_data_raw()

Posted: Tue May 09, 2017 10:22 pm
by Earendel
Rseding91 wrote:
Earendel wrote: gun.attack_parameters.sound
gun.attack_parameters.shell_particle
gun.attack_parameters.shell_particle.name
gun.attack_parameters.shell_particle.speed
gun.attack_parameters.shell_particle.starting_frame_speed
gun.attack_parameters.projectile_center
gun.attack_parameters.gun_center_shift
gun.attack_parameters.projectile_creation_distance
All of these already exists through http://lua-api.factorio.com/latest/LuaI ... parameters
There's no mention of them in the API documentation. Some do seem to work but others don't
/c game.print(game.item_prototypes["pistol"].attack_parameters["projectile_center"]) -- works

flamethrower definition:
gun_barrel_length = 0.8,
gun_center_shift = { 0, -1 },
/c game.print(game.item_prototypes["flamethrower"].attack_parameters["gun_barrel_length"]) -- fails
/c game.print(game.item_prototypes["flamethrower"].attack_parameters["gun_center_shift"]) -- fails
Rseding91 wrote:
Earendel wrote:ammo.ammo_type -- I'm not sure how much (if any) is missing here, the API format is different and there are a lot of possibilities to check due to nesting.
I mirrored the input format as far as I remember so there should be no confusion.
Just off the top of my head, data.raw definition uses "source_effects", but the API version uses "source_effect":
/c game.print(#game.item_prototypes["firearm-magazine"].get_ammo_type().action[1].action_delivery[1].source_effects) -- error
/c game.print(#game.item_prototypes["firearm-magazine"].get_ammo_type().action[1].action_delivery[1].source_effect) -- prints 2
Rseding91 wrote:
Earendel wrote:car.turret_animation
car.animation
car.animation.layers
car.animation.layers[].animation_speed
*.icon
*.icon[] -- getting layers of icons
What use could those be? We don't support rendering specific images so I'm having a hard time trying to figure out what they would ever be useful for.
The icon is mainly to get access to the tint. Animation speed is so that an animation can be forced to run on a vehicle by artificially boosting it's speed. If there was some other way to force a minimum animation speed or 'idle' animation an a vehicle then this would not be required.

Re: LuaGameScript.get_data_raw()

Posted: Tue May 09, 2017 10:46 pm
by Rseding91
Thanks for pointing out the flamethrower ones - the property tree changes in 0.15 broke those. I've fixed them for 0.15.10.

They're not mentioned in the API documentation because it's the same as prototype documentation: filling all that out would take more time than it's worth because we keep changing them.

Also I fixed the two "source_effect" -> "source_effects" and "target_effect" -> "target_effects" for 0.15.10 as well.

Re: LuaGameScript.get_data_raw()

Posted: Wed May 10, 2017 5:23 pm
by Earendel
Thanks, would you like me to add the ones already mentioned to the new thread?

Re: LuaGameScript.get_data_raw()

Posted: Wed May 10, 2017 6:32 pm
by Rseding91
Earendel wrote:Thanks, would you like me to add the ones already mentioned to the new thread?
Yes please.