Page 1 of 1

Adding an equipment window (like modular armor) to a car?

Posted: Wed May 21, 2014 8:36 pm
by obuw
Hey all,

I just started working on my first factorio mod. Hopefully it's going to be a modular car.

However, I wasn't able to quite figure out if it is even possible to set up an equipment window for the car. I guess I'd have to somehow listen to a right-click event and pop up the UI manually. Or is it even possible to pop up a UI like that?

If that is not possible, I guess I'll have to use the trunk for upgrades.

Oh, and I don't suppose it is possible to override parts of the base functionality for an entity? For instance I want to disable the burner completely to prevent it from showing up (making the car run on solar power), but removing the burner section results in an error.

Here's what I have so far:
https://www.dropbox.com/s/gzrxymhg4yr9v ... ebuggy.zip

Re: Adding an equipment window (like modular armor) to a car

Posted: Sat May 24, 2014 10:32 pm
by JamesOFarrell
The wiki page on working with GUI elements is here:

https://forums.factorio.com/wiki/inde ... le=Lua/Gui

Also if you download F-Mod it has some good examples of working with GUI code, I would probably start there (in fact I did start there).

Removing the burner may not be possible. The wiki says that the burners variable is of the type EnergySource-Burner. You could try setting it to be of the the type EnergySource-Electric but I assume lua would throw a runtime error. Only one way to find out though.

Re: Adding an equipment window (like modular armor) to a car

Posted: Sun May 25, 2014 3:53 am
by domtronvox
That is exactly what I was wanting to do.

I was looking into modifying modules(like speed, efficiency ect.) so you could have armor, tires, tracks, engines(electric for solar, normal for burners), storage, and what ever else one can think of. My idea was to have a car frame which was useless until you filled it with the core parts(tires/tracks and engine) each of which gives a base stat or a bonuses. Later versions could support each part modifying the sprite with overlays (like how choosing an assembler recipe will add a pipe to the assembler). If you want to collaborate give me a heads up(pm or email). :)