Sim Constructor


Recommended Posts

This mod is a tool that allows mod makers to edit engine.lua while maintaining compability.

Later I will make it possible to change other files too. Feel free to leave a suggestion on what files you want to be able to edit.

Update: This mod now comes with Lemonymous's Sequential Mod Loader

 

http://steamcommunity.com/sharedfiles/filedetails/?id=580661011

 

Here's an example mod that demonstrates how to use it

 

http://steamcommunity.com/sharedfiles/filedetails/?id=580664017

workshop-580661011.zip

Link to comment
Share on other sites

Can You add a way to modify client/states/state-something.lua? I tried to add new entries for options like "ALARM TYPES" in state-generation-options.lua (more specifically, append changes to "CUSTOM_OPTIONS" table ) for my Programs Extended mod, but it seems impossible without hardcoding.

Link to comment
Share on other sites

Another request if I may. I tried to overwrite "client/hud/hud.lua" functions. It works only on some, don't know why. [ 'local hud = include("hud/hud")' and then overwrite function 'hud:refreshTrackerMusic( hud, stage )' works, but hud:onSimEvent( ev ) does not. ].

 

EDIT:

You might want to upload Sim Constructor to the forums for gog users.

Link to comment
Share on other sites

client/hud/hud:onSimEvent (ev)

	elseif ev.eventType == simdefs.EV_ITEMS_PANEL then		if ev.eventData then			if ev.eventData.shopUnit then                local shop_panel = include( "hud/shop_panel" )                if ev.eventData.shopUnit:getTraits().storeType=="research" then               		self:showItemsPanel( shop_panel.research( self, ev.eventData.shopperUnit, ev.eventData.shopUnit, STRINGS.UI.SHOP_RESEARCH, nil,true))				elseif ev.eventData.shopUnit:getTraits().storeType=="server" or ev.eventData.shopUnit:getTraits().storeType=="extraserver" then					self:showItemsPanel( shop_panel.server( self, ev.eventData.shopperUnit, ev.eventData.shopUnit ))				elseif ev.eventData.shopUnit:getTraits().storeType=="miniserver" then					self:showItemsPanel( shop_panel.server( self, ev.eventData.shopperUnit, ev.eventData.shopUnit, STRINGS.UI.SHOP_MINISERVER, true))				else					self:showItemsPanel( shop_panel.shop( self, ev.eventData.shopperUnit, ev.eventData.shopUnit ))				end            else                local items_panel = include( "hud/items_panel" )			    if ev.eventData.targetUnit then				    self:showItemsPanel( items_panel.loot( self, ev.eventData.unit, ev.eventData.targetUnit ))			    else				    self:showItemsPanel( items_panel.pickup( self, ev.eventData.unit, ev.eventData.x, ev.eventData.y ))			    end            end		elseif self._itemsPanel then			self._itemsPanel:refresh()		end

I added new shop variant in ProgramsExtended (sells 4 programs), but what shop menu shows up is dependent on storeType="" variable. This is coded with "if else" and any new non-vanilla shop type will get nanofab window regardless of what it actually sells. I want to add the or ev.eventData.shopUnit:getTraits().storeType=="extraserver" portion of code in line 1823, so my shop displays Shopcat menu.

 

If it turns out to be too much of a problem, don't bother. I doubt anyone else will need to tweak hud stuff, Klei did great job with the UI.

Regardless, thanks for help mate.

Link to comment
Share on other sites

I could really use some help if anyone could spare the time. I've been trying to make a mod that uses the sim constructor + sequential modloader, but the presence of my mod (it doesn't even need to be activated) causes a frozen black screen when hitting "Start Game" after selecting the generation options. When I looked in the log, I found "workshop-580661011/state-generation-options.lua:519: bad arg" as the last line. Does this mean I'm using the Sequential Modloading part wrong or is it something else?

I've attached the full log.

invisibleinc.txt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.