Page 1 of 1

Failed to create entity 'speech-bubble'

Posted: Fri Feb 14, 2020 10:32 am
by ABacker
I use the following codes to create the 'speech-bubble' entity, and game crashed saying unknown entity name 'speech-bubble'.
It would not crash if I replace 'speech-bubble' with 'flying-text'.

Code: Select all

                
                entity.surface.create_entity {
                    name = 'speech-bubble',
                    position = {x = entity.position.x, y = entity.position.y + 1},
                    text = entity.energy .. 'J',
                    lifetime = 10
                }

Re: Failed to create entity 'speech-bubble'

Posted: Fri Feb 14, 2020 10:42 am
by Klonan
This isn't a bug, there is no entity called 'speech-bubble', try 'compi-speech-bubble'

Re: Failed to create entity 'speech-bubble'

Posted: Fri Feb 14, 2020 10:54 am
by ABacker
Klonan wrote: Fri Feb 14, 2020 10:42 am This isn't a bug, there is no entity called 'speech-bubble', try 'compi-speech-bubble'
The api doc says there is 'speech-bubble', :shock:
https://lua-api.factorio.com/latest/Lua ... ate_entity

The game changelog says:
- Added "speech-bubble" entity.

Re: Failed to create entity 'speech-bubble'

Posted: Fri Feb 14, 2020 10:59 am
by Deadlock989
ABacker wrote: Fri Feb 14, 2020 10:54 am
Klonan wrote: Fri Feb 14, 2020 10:42 am This isn't a bug, there is no entity called 'speech-bubble', try 'compi-speech-bubble'
The api doc says there is 'speech-bubble', :shock:
https://lua-api.factorio.com/latest/Lua ... ate_entity

The game changelog says:
- Added "speech-bubble" entity.
"speech-bubble" isn't the name of a prototyped entity, it is the entity type. create_entity expects a named prototype that was set up in the data stage.

Re: Failed to create entity 'speech-bubble'

Posted: Fri Feb 14, 2020 11:03 am
by ABacker
Deadlock989 wrote: Fri Feb 14, 2020 10:59 am
ABacker wrote: Fri Feb 14, 2020 10:54 am
Klonan wrote: Fri Feb 14, 2020 10:42 am This isn't a bug, there is no entity called 'speech-bubble', try 'compi-speech-bubble'
The api doc says there is 'speech-bubble', :shock:
https://lua-api.factorio.com/latest/Lua ... ate_entity

The game changelog says:
- Added "speech-bubble" entity.
"speech-bubble" isn't the name of a prototyped entity, it is the entity type. create_entity expects a named prototype that was set up in the data stage.
My bad, got it, thanks.