Difference between LuaEntity::revive() and LuaEntity::silent_revive()

Post Reply
Pi-C
Smart Inserter
Smart Inserter
Posts: 1703
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Difference between LuaEntity::revive() and LuaEntity::silent_revive()

Post by Pi-C »

What is the difference between LuaEntity::revive() and LuaEntity::silent_revive()? Their descriptions look very similar, they seem to be almost identical:

Code: Select all

$ diff /tmp/revive.txt /tmp/silent_revive.txt 
2c2
< revive{return_item_request_proxy?=…, raise_revive?=…}  → dictionary[string → uint]?, LuaEntity?, LuaEntity?
---
> silent_revive{return_item_request_proxy?=…, raise_revive?=…}  → dictionary[string → uint]?, LuaEntity?, LuaEntity?
4c4
< Revive a ghost. I.e. turn it from a ghost to a real entity or tile.
---
> Revives a ghost silently.
9c9
< If true the function will return item request proxy as the third return value.
---
> If true the function will return item request proxy as the third parameter.
$
Both can be called with the flag raise_revive, and if that is set, they will raise the same events. So when should LuaEntity::silent_revive() be used? Are there any arguments missing from the documentation?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2318
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Difference between LuaEntity::revive() and LuaEntity::silent_revive()

Post by boskid »

Both of those are using the same internal function for revive purposes with the only difference being that silent_revive makes no sound and creates no smoke.

Pi-C
Smart Inserter
Smart Inserter
Posts: 1703
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Difference between LuaEntity::revive() and LuaEntity::silent_revive()

Post by Pi-C »

boskid wrote:
Fri Apr 19, 2024 8:57 am
Both of those are using the same internal function for revive purposes with the only difference being that silent_revive makes no sound and creates no smoke.
Oh, thanks! It never occurred to me that "silent" was meant literally, referring to sound -- I thought more along the lines of the command being executed silently, without raising events. :-)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Bilka
Factorio Staff
Factorio Staff
Posts: 3236
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Difference between LuaEntity::revive() and LuaEntity::silent_revive()

Post by Bilka »

Thanks for the note, added boskid's info for the next doc release.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Resolved Requests”