I'm not sure if this is a bug, but sometimes the .name field doesnt contain the name, but an object...
for example for player.cursor_ghost
you'd expect .name to be a string, right?
player.cursor_ghost.name is LuaItemPrototype?
player.cursor_ghost.name is LuaItemPrototype?
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
Re: player.cursor_ghost.name is LuaItemPrototype?
It's weird that it's called "name", but that's the intended behavior. I found it a while ago and they updated the docs.
See:
https://lua-api.factorio.com/latest/con ... DPair.html
Linked from:
https://lua-api.factorio.com/latest/cla ... rsor_ghost
See:
https://lua-api.factorio.com/latest/con ... DPair.html
Linked from:
https://lua-api.factorio.com/latest/cla ... rsor_ghost
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Re: player.cursor_ghost.name is LuaItemPrototype?
so when you wanna read the name you write "something.name.name" ? kinda weird but ok
especially since it's inconsistent
especially since it's inconsistent
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
Re: player.cursor_ghost.name is LuaItemPrototype?
Yup that's right. I agree it really ought to be named "item" or something like that. And so far only seems to affect cursor_ghost?
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Re: player.cursor_ghost.name is LuaItemPrototype?
I made a similar bug report a while ago; 123575
Here it is that get_filter(1) gives a prototype for a name or a string depending on the type of entity it is called on, I did not realize there were other cases.
Here it is that get_filter(1) gives a prototype for a name or a string depending on the type of entity it is called on, I did not realize there were other cases.
Re: player.cursor_ghost.name is LuaItemPrototype?
https://lua-api.factorio.com/latest/cla ... ly_burning
currently_burning.name is also item prototype
meanwhile that.burnt_result.name is a string again.
this is ridiculous
currently_burning.name is also item prototype
meanwhile that.burnt_result.name is a string again.
this is ridiculous
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds