Custom GUIElement on Entity open/select

Place to get help with not working mods / modding interface.
User avatar
Eastborn
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu Aug 01, 2013 3:49 am
Contact:

Custom GUIElement on Entity open/select

Post 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
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Custom GUIElement on Entity open/select

Post 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
User avatar
zer0t3ch
Fast Inserter
Fast Inserter
Posts: 118
Joined: Fri Jul 26, 2013 6:06 am
Contact:

Re: Custom GUIElement on Entity open/select

Post 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?
"F**k thy hater"
-George Watsky

Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com

Image
User avatar
Eastborn
Burner Inserter
Burner Inserter
Posts: 6
Joined: Thu Aug 01, 2013 3:49 am
Contact:

Re: Custom GUIElement on Entity open/select

Post 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..
User avatar
zer0t3ch
Fast Inserter
Fast Inserter
Posts: 118
Joined: Fri Jul 26, 2013 6:06 am
Contact:

Re: Custom GUIElement on Entity open/select

Post 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.
"F**k thy hater"
-George Watsky

Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com

Image
ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Custom GUIElement on Entity open/select

Post 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.
User avatar
zer0t3ch
Fast Inserter
Fast Inserter
Posts: 118
Joined: Fri Jul 26, 2013 6:06 am
Contact:

Re: Custom GUIElement on Entity open/select

Post 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!
"F**k thy hater"
-George Watsky

Feel free to contact me!
Skype: Zer0t3ch
Razer Comms: Zer0t3ch
Email: zer0t3ch@live.com

Image
slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: Custom GUIElement on Entity open/select

Post 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.
Post Reply

Return to “Modding help”