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

Place to get help with not working mods / modding interface.
Post Reply
obuw
Long Handed Inserter
Long Handed Inserter
Posts: 72
Joined: Tue May 06, 2014 7:49 pm
Contact:

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

Post 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
Obuw's Warfare - Combat improvements

JamesOFarrell
Filter Inserter
Filter Inserter
Posts: 402
Joined: Fri May 23, 2014 8:54 am
Contact:

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

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

domtronvox
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed May 21, 2014 6:55 pm
Contact:

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

Post 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). :)

Post Reply

Return to “Modding help”