Page 1 of 1

[12.9] Tiles don't fire on_built_entity

Posted: Fri Oct 02, 2015 12:40 am
by vzybilly
Tile Ghosts fire the event but not the tile itself. did not test bots.

To see if ANY event fires from the Tiles, I hooked up a watcher for all non-tick events.
This is the event log for placing and mining.

Code: Select all

Event: on_player_mined_item @ 218913
  item_stack[table]
    name[string]=stone-brick
    count[number]=1
  player_index[number]=1
This is the event log for placing and mining a Ghost by hand.

Code: Select all

Event: on_built_entity @ 218790
  created_entity[table]
    __self[userdata]
  player_index[number]=1
Event: on_preplayer_mined_item @ 219100
  entity[table]
    __self[userdata]
  player_index[number]=1
watcher code snippet
watcher code full


In comparison, this is the event log for a small electric pole.

Code: Select all

Event: on_put_item @ 218932
  position[table]
    y[number]=3.22265625
    x[number]=-14.8359375
  player_index[number]=1
Event: on_built_entity @ 218932
  created_entity[table]
    __self[userdata]
  player_index[number]=1
Event: on_preplayer_mined_item @ 219162
  entity[table]
    __self[userdata]
  player_index[number]=1
Event: on_player_mined_item @ 219162
  item_stack[table]
    name[string]=small-electric-pole
    count[number]=1
  player_index[number]=1


a Tile should atleast fire "on_put_item", it should also fire either "on_built_entity" or "on_built_tile"

Re: [12.9] Tiles don't fire on_built_entity

Posted: Wed Oct 07, 2015 10:55 am
by slpwnd
Well this is more of a feature request than a bug report. Tiles don't fire on_built_entity precisely because they are tiles not entities. You are right that there should be an on_built_tile method. And yes, it is confusing when tile ghost fire the event but the tile itself not. Technically speaking it is correct since ghost is an entity not a tile, but that is probably too technical.

I am putting this to minor issues. However I have made a ticket for this in our internal TODO.

Re: [12.9] Tiles don't fire on_built_entity

Posted: Wed Oct 07, 2015 4:34 pm
by vzybilly
slpwnd wrote:Well this is more of a feature request than a bug report. Tiles don't fire on_built_entity precisely because they are tiles not entities. You are right that there should be an on_built_tile method. And yes, it is confusing when tile ghost fire the event but the tile itself not. Technically speaking it is correct since ghost is an entity not a tile, but that is probably too technical.

I am putting this to minor issues. However I have made a ticket for this in our internal TODO.
how come it fires the mined item event? it doesn't fire any other event but that. the placing would be the put item event, this would all be workable if it was like that...

to me, the fact it only fires the mined event shows that the others were either forgotten or bugged...

sorry if this post is abit jumbled, I'm on my phone on vacation...