Page 1 of 1

Custom GUIElement on Entity open/select

Posted: Sun Aug 25, 2013 6:59 pm
by Eastborn
Soo, i was thinking,

is it possible to create a ui on rightclick of an entity?

i already tried checking the player.gui en de top/center and left attributes of it while having a smart-inventory open
but it doesn't display that any GUI element is open. If there was a way, i could just adjust the inventory that already exists.

i also couldn't find an event for detecting rightclick of an entity. If i did i could just create a plain entity and on rightclick activate a custom GUI element.

Thanks in advance,
Eastborn

Re: Custom GUIElement on Entity open/select

Posted: Tue Aug 27, 2013 10:25 am
by ficolas
Eastborn wrote:Soo, i was thinking,

is it possible to create a ui on rightclick of an entity?

i already tried checking the player.gui en de top/center and left attributes of it while having a smart-inventory open
but it doesn't display that any GUI element is open. If there was a way, i could just adjust the inventory that already exists.

i also couldn't find an event for detecting rightclick of an entity. If i did i could just create a plain entity and on rightclick activate a custom GUI element.

Thanks in advance,
Eastborn
No, it is not possible, and I think it has alredy been suggested/talked about

Re: Custom GUIElement on Entity open/select

Posted: Wed Aug 28, 2013 3:25 am
by zer0t3ch
ficolas wrote:
Eastborn wrote:Soo, i was thinking,

is it possible to create a ui on rightclick of an entity?

i already tried checking the player.gui en de top/center and left attributes of it while having a smart-inventory open
but it doesn't display that any GUI element is open. If there was a way, i could just adjust the inventory that already exists.

i also couldn't find an event for detecting rightclick of an entity. If i did i could just create a plain entity and on rightclick activate a custom GUI element.

Thanks in advance,
Eastborn
No, it is not possible, and I think it has alredy been suggested/talked about
Well it's gotta be possible to some extent, or else how do chests and furnaces work?

Re: Custom GUIElement on Entity open/select

Posted: Wed Aug 28, 2013 6:53 am
by Eastborn
zer0t3ch wrote:Well it's gotta be possible to some extent, or else how do chests and furnaces work?
Well, i think they do that in the c++ code of the game.

I also tested if i could grab the inventory or any ui of entities ingame trough lua. this was not possible..

Re: Custom GUIElement on Entity open/select

Posted: Fri Aug 30, 2013 2:41 pm
by zer0t3ch
Eastborn wrote:
zer0t3ch wrote:Well it's gotta be possible to some extent, or else how do chests and furnaces work?
Well, i think they do that in the c++ code of the game.

I also tested if i could grab the inventory or any ui of entities ingame trough lua. this was not possible..
Seeing as the chests are added as prototypes, I would think they would do the clicks for it in LUA also.

Re: Custom GUIElement on Entity open/select

Posted: Fri Aug 30, 2013 3:52 pm
by ficolas
zer0t3ch wrote:
Eastborn wrote:
zer0t3ch wrote:Well it's gotta be possible to some extent, or else how do chests and furnaces work?
Well, i think they do that in the c++ code of the game.

I also tested if i could grab the inventory or any ui of entities ingame trough lua. this was not possible..
Seeing as the chests are added as prototypes, I would think they would do the clicks for it in LUA also.
Every entity is added as a prototype, but if you look at the definition, the type of the chest, is container, that is what the c++ code takes to know what does that thing do, if you dont belive me, you can allways look at the lua code, any entity in vanilla made like we do the mods, just the definition is, what makes the entity be diferent (regardless of the diferences in the prototype definition, like the image and colision box) is in the c++ code.

A custom entity type has been asked for several times, and I think kovarex said he will add it, some time in the future.

Re: Custom GUIElement on Entity open/select

Posted: Sat Aug 31, 2013 8:32 pm
by zer0t3ch
ficolas wrote:
zer0t3ch wrote:
Eastborn wrote: Well, i think they do that in the c++ code of the game.

I also tested if i could grab the inventory or any ui of entities ingame trough lua. this was not possible..
Seeing as the chests are added as prototypes, I would think they would do the clicks for it in LUA also.
Every entity is added as a prototype, but if you look at the definition, the type of the chest, is container, that is what the c++ code takes to know what does that thing do, if you dont belive me, you can allways look at the lua code, any entity in vanilla made like we do the mods, just the definition is, what makes the entity be diferent (regardless of the diferences in the prototype definition, like the image and colision box) is in the c++ code.

A custom entity type has been asked for several times, and I think kovarex said he will add it, some time in the future.
Ah, ok. Can't wait for the custom entity!

Re: Custom GUIElement on Entity open/select

Posted: Sat Sep 07, 2013 7:28 pm
by slpwnd
Ficolas made a good point. At the moment, only the properties of existing types of entities (prototypes) can be changed. So you can make a variation of a chest or a variation of a solar panel, but it is not possible to make a new entity completely from the ground (well you can use some tricks like for instance in the treemod script to achieve the same effect). And yes, the custom lua entity is definitely coming.