LuaGameScript.get_data_raw()

Things that we aren't going to implement
Rseding91
Factorio Staff
Factorio Staff
Posts: 13232
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaGameScript.get_data_raw()

Post by Rseding91 »

If you want to get ahold of me I'm almost always on Discord.

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: LuaGameScript.get_data_raw()

Post 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.

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

Re: LuaGameScript.get_data_raw()

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: LuaGameScript.get_data_raw()

Post by Earendel »

Thanks, would you like me to add the ones already mentioned to the new thread?

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

Re: LuaGameScript.get_data_raw()

Post by Rseding91 »

Earendel wrote:Thanks, would you like me to add the ones already mentioned to the new thread?
Yes please.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Won't implement”