Jump to content

Custom Recipe Tab Help


Recommended Posts

So, I am attempting to add a custom recipe tab to DST, and 2 things I've noticed.

1. It never seems to work.

2. It is a HELL of a lot harder than DS

Here's the exact coding I have.

--Shitton of recipe stuff beginning		local resolvefilepath = GLOBAL.resolvefilepathlocal TECH = GLOBAL.TECHlocal CUSTOM_RECIPETABS = GLOBAL.CUSTOM_RECIPETABSCUSTOM_RECIPETABS.GEMS = { str = "GEMS", sort = 998, icon = "book.tex", icon_atlas = resolvefilepath("images/shadow.tex") }STRINGS.TABS.GEMS = "Gems" local rakkyboomerang_recipe = Recipe("redgem", { Ingredient("houndstooth", 2), Ingredient("log", 3) }, CUSTOM_RECIPETABS.GEMS, TECH.NONE, nil, nil, nil, nil, true) -- Add new tabAddClassPostConstruct("widgets/crafttabs", function(class)    if class.owner:HasTag("gembuilder") then        local v = CUSTOM_RECIPETABS.GEMS        local k = #class.tab_order + 1        local tab_bg =        {            normal = "tab_normal.tex",            selected = "tab_selected.tex",            highlight = "tab_highlight.tex",            bufferedhighlight = "tab_place.tex",            overlay = "tab_researchable.tex",        }                 class.tabs.spacing = 750/k        local tab = class.tabs:AddTab(STRINGS.TABS[v.str], resolvefilepath("images/hud/redgem.xml"), v.icon_atlas or resolvefilepath("images/hud/redgem.xml"), v.icon, tab_bg.normal, tab_bg.selected, tab_bg.highlight, tab_bg.bufferedhighlight, tab_bg.overlay,                         function() --select fn                if not class.controllercraftingopen then                                         if class.craft_idx_by_tab[k] then                        class.crafting.idx = class.craft_idx_by_tab[k]                    end                     class.crafting:SetFilter(                        function(recipe)                            local rec = GLOBAL.AllRecipes[recipe]                            return rec and rec.tab == v                        end)                                                                                                                  class.crafting:Open()                end            end,             function() --deselect fn                class.craft_idx_by_tab[k] = class.crafting.idx                class.crafting:Close()            end)        tab.filter = v        tab.icon = v.icon        tab.icon_atlas = v.icon_atlas or resolvefilepath("images/hud/redgem.xml")        tab.tabname = STRINGS.TABS[v.str]        class.tabbyfilter[v] = tab                 table.insert(class.tab_order, tab)    endend)---Shitton of recipe stuff ending

Anybody know how to help?

Link to comment
Share on other sites

1. Actually, you probably have. It's a recipe Dleowolf used on a similar problem, but for some reason it doesn't work for me.

2. I probably should have put this, but the problem is that I can't get the icon working.

Link to comment
Share on other sites

Okay, so, I tried all the advice, I tried using Jacket, I tried many guides, and still no clue why it isn't working.

I'm just... stumped.

Here's the files for the mod, I hope someone can figure out the problem.

It also says I can't upload 7zips (The kind of thing I need to use to give the whole mod) so I suppose here's a mediafire link I guess?

 

http://www.mediafire.com/download/17e6q8lauoh1o4b/Black_The_Overlord_(BETA).7z

Link to comment
Share on other sites

well, ill also throw in how i added my custom tab in DST:

modmain:

in the Assettable:

Asset("ATLAS", "images/inventoryimages/zergtab.xml"),
below:

GLOBAL.RECIPETABS['ZERG'] = {str = "ZERG", sort=0, icon = "zergtab.tex", icon_atlas = "images/inventoryimages/zergtab.xml"}GLOBAL.STRINGS.TABS.ZERG="ZERG"
adding a recipe:

AddRecipe("larva_drone", {Ingredient("meat", 1)}, GLOBAL.RECIPETABS.ZERG, GLOBAL.TECH.NONE, nil, nil, nil, nil, "kerrigan","images/inventoryimages/larva_drone.xml")GLOBAL.STRINGS.RECIPE_DESC.LARVA_DRONE = "Spawn Drone."
also, i used this

if GLOBAL.TheSim:GetGameID()=="DST" then 
to completely seperate the way i do it in DST from how i do it in DS. I made my whole mod completely compatible with both games like that.

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

Edited by Seiai
Link to comment
Share on other sites

@Blackbando, Yes, it's a lot harder in DST right now. It should become easier at some point, I'm guessing having an AddRecipeTab modmain environment function is one of PeterA's todos.

 

Atlases are xml, not tex. You also don't have tab_bg defined in your modmain, so you'll need to pull the values from it in scripts/widgets/crafttabs. For the AddTab function, the first atlas is for the background, so you want that to be the same as every other tab (the second icon parameter is for the background, confusingly...). So your code, but edited (I guessed what assets you actually wanted to use based  on what was in images/hud):

--Shitton of recipe stuff beginning        local resolvefilepath = GLOBAL.resolvefilepathGLOBAL.CUSTOM_RECIPETABS.GEMS = { str = "GEMS", sort = 998, icon = "gemology.tex", icon_atlas = resolvefilepath("images/hud/gemology.xml") }GLOBAL.STRINGS.TABS.GEMS = "Gems"  AddRecipe("redgem", { Ingredient("houndstooth", 2), Ingredient("log", 3) }, GLOBAL.CUSTOM_RECIPETABS.GEMS, GLOBAL.TECH.NONE, nil, nil, nil, nil, true)   local tab_bg = {    normal = "tab_normal.tex",    selected = "tab_selected.tex",    highlight = "tab_highlight.tex",    bufferedhighlight = "tab_place.tex",    overlay = "tab_researchable.tex",}-- Add new tabAddClassPostConstruct("widgets/crafttabs", function(class)    if class.owner:HasTag("gembuilder") then        local v = CUSTOM_RECIPETABS.GEMS        local k = #class.tab_order + 1        local tab_bg =        {            normal = "tab_normal.tex",            selected = "tab_selected.tex",            highlight = "tab_highlight.tex",            bufferedhighlight = "tab_place.tex",            overlay = "tab_researchable.tex",        }                  class.tabs.spacing = 750/k        local tab = class.tabs:AddTab(			STRINGS.TABS[v.str],			resolvefilepath("images/hud.xml"),	-- the background atlas			v.icon_atlas,						-- the foreground atlas			v.icon,								-- the foreground image			tab_bg.normal,						-- the background image			tab_bg.selected,					-- the background image when selected			tab_bg.highlight,					-- the background image when highlighted			tab_bg.bufferedhighlight,			-- the background image when buffered			tab_bg.overlay,						-- the overlay image showing new recipes                          function() --select fn                if not class.controllercraftingopen then                                          if class.craft_idx_by_tab[k] then                        class.crafting.idx = class.craft_idx_by_tab[k]                    end                      class.crafting:SetFilter(                        function(recipe)                            local rec = GLOBAL.AllRecipes[recipe]                            return rec and rec.tab == v                        end)                                                                                                                    class.crafting:Open()                end            end,              function() --deselect fn                class.craft_idx_by_tab[k] = class.crafting.idx                class.crafting:Close()            end		)        tab.filter = v        tab.icon = v.icon        tab.icon_atlas = v.icon_atlas        tab.tabname = STRINGS.TABS[v.str]        class.tabbyfilter[v] = tab                  table.insert(class.tab_order, tab)				class:DoUpdateRecipes() -- you might not need this, but I threw it in just in case    endend)---Shitton of recipe stuff ending
Edited by rezecib
Link to comment
Share on other sites

Yes, I checked the log, and, from what I can gather, nothing had an error that crashed it.

Here's my full log,

[00:00:00]: Starting Up[00:00:00]: Version: 138494[00:00:00]: Current time: Thu Jun 04 15:56:04 2015[00:00:00]: Don't Starve Together: 138494 WIN32_STEAMNNN Build Date: 2015-06-03_16-29-15[00:00:00]: Parsing command line[00:00:00]: Command Line Arguments: [00:00:00]: Initializin Minidump handler[00:00:00]: ....Done[00:00:00]: Initializing Steam[00:00:01]: Steam AppBuildID: 646767[00:00:01]: Steam BetaName(Branch): [][00:00:01]: ....Done[00:00:01]: Fixing DPI[00:00:01]: ...Done[00:00:01]: THREAD - started 'GAClient' (4456)[00:00:01]: HttpClient::ClientThread::Main()[00:00:06]: ProfileIndex:14.02[00:00:06]: THREAD - started 'GAClient' (13592)[00:00:06]: THREAD - started 'GAClient' (9056)[00:00:06]: HttpClient::ClientThread::Main()[00:00:06]: HttpClient::ClientThread::Main()[00:00:06]: Network tick rate: U=15(2), D=0[00:00:06]: Network tick rate: U=15(2), D=0[00:00:06]: Authorized application C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Together Beta\bin\dontstarve_steam.exe is enabled in the firewall.[00:00:06]: WindowsFirewall - Application already authorized[00:00:06]: loaded ping_cache[00:00:06]: OnLoadPermissionList: APP:Klei/DoNotStarveTogether/save/blocklist.txt (Failure)[00:00:06]: OnLoadPermissionList: APP:Klei/DoNotStarveTogether/save/adminlist.txt (Failure)[00:00:06]: OnLoadUserIdList: APP:Klei/DoNotStarveTogether/save/whitelist.txt (Failure)[00:00:06]: Offline user name: OU_76561198050668028[00:00:06]: SteamID: 76561198050668028[00:00:06]: THREAD - started 'GAClient' (15992)[00:00:06]: HttpClient::ClientThread::Main()[00:00:06]: cGame::InitializeOnMainThread[00:00:06]: WindowManager::Initialize[00:00:06]: CreateWindow: Requesting 1366,705 - 5/6/5 - -1/-1/-1 - 0[00:00:07]: CreateEGLContext: 16 configs found[00:00:07]: RestoreWindowPosition[00:00:07]:    Saved Client Pos (0 x 23)[00:00:07]:    Adjusted Window Pos (-8 x -8)[00:00:07]: EnsureWindowOnScreen[00:00:07]:    All good.[00:00:07]: THREAD - started 'WindowsInputManager' (13484)[00:00:12]: Renderer initialize: Okay[00:00:16]: AnimManager initialize: Okay[00:00:16]: Buffers initialize: Okay[00:00:19]: cDontStarveGame::DoGameSpecificInitialize()[00:00:20]: GameSpecific initialize: Okay[00:00:20]: cGame::StartPlaying[00:00:20]: LOADING LUA[00:00:20]: DoLuaFile scripts/main.lua[00:00:20]: DoLuaFile loading buffer scripts/main.lua[00:00:23]: scripts/main.lua(167,1) running main.lua	[00:00:23]: loaded modindex	[00:00:23]: ModIndex: Beginning normal load sequence.	[00:00:24]: ModIndex:GetModsToLoad inserting moddir, 	Black The Overlord (BETA)	[00:00:24]: Could not load mod_config_data/modconfiguration_Black The Overlord (BETA)	[00:00:24]: Loading mod: Black The Overlord (BETA) (BlackK) Version:1.1.3	[00:00:24]: Mod: Black The Overlord (BETA) (BlackK)	Loading modworldgenmain.lua	[00:00:24]: Mod: Black The Overlord (BETA) (BlackK)	  Mod had no modworldgenmain.lua. Skipping.	[00:00:24]: Mod: Black The Overlord (BETA) (BlackK)	Loading modmain.lua	[00:00:33]: LOADING LUA SUCCESS[00:00:34]: PlayerDeaths loaded morgue	6451	[00:00:34]: loaded profile	[00:00:34]: bloom_enabled	false	[00:00:34]: loaded saveindex	[00:00:34]: OnFilesLoaded()	[00:00:34]: OnUpdatePurchaseStateComplete	[00:00:47]: Mod: Black The Overlord (BETA) (BlackK)	Registering prefabs	[00:00:47]: Mod: Black The Overlord (BETA) (BlackK)	  Registering prefab file: prefabs/black	[00:00:47]: Mod: Black The Overlord (BETA) (BlackK)	    black	[00:00:47]: Mod: Black The Overlord (BETA) (BlackK)	  Registering default mod prefab	[00:00:49]: 	Load FE	[00:00:51]: 	Load FE: done	[00:00:51]: platform_motd	table: 0B93E170	[00:00:51]: SimLuaProxy::QueryServer()[00:00:51]: SimLuaProxy::QueryServer()[00:00:51]: SimLuaProxy::QueryServer()[00:00:52]: ModIndex: Load sequence finished successfully.	[00:00:52]: Reset() returning[00:00:55]: platform_motd	table: 0C7046F8	[00:01:22]: [200] Account Communication Success (6)[00:01:22]: [ACCOUNT_ACTION_TOKEN_PURPOSE] Received UserId from TokenPurpose: KU_axt8-fXb[00:01:22]: QueryServerComplete no callback[00:01:25]: Downloaded server listings - full: 3531 filtered: 1882[00:01:29]: Network tick rate: U=15(2), D=0[00:01:29]: [Warning] Could not confirm port 10999 is open in the firewall. [00:01:29]: Setting up socket descriptors[00:01:29]: Online Server Started on port: 10999[00:01:30]: unloading prefabs for mod MOD_Black The Overlord (BETA)	[00:01:30]: Collecting garbage...[00:01:30]: lua_gc took 0.08 seconds[00:01:30]: ~NetworkLuaProxy()[00:01:30]: ~SimLuaProxy()[00:01:30]: lua_close took 0.15 seconds[00:01:30]: cGame::StartPlaying[00:01:30]: LOADING LUA[00:01:30]: DoLuaFile scripts/main.lua[00:01:30]: DoLuaFile loading buffer scripts/main.lua[00:01:32]: scripts/main.lua(167,1) running main.lua	[00:01:32]: loaded modindex	[00:01:32]: ModIndex: Beginning normal load sequence.	[00:01:33]: ModIndex:GetModsToLoad inserting moddir, 	Black The Overlord (BETA)	[00:01:33]: Could not load mod_config_data/modconfiguration_Black The Overlord (BETA)	[00:01:33]: Loading mod: Black The Overlord (BETA) (BlackK) Version:1.1.3	[00:01:33]: Mod: Black The Overlord (BETA) (BlackK)	Loading modworldgenmain.lua	[00:01:33]: Mod: Black The Overlord (BETA) (BlackK)	  Mod had no modworldgenmain.lua. Skipping.	[00:01:33]: Mod: Black The Overlord (BETA) (BlackK)	Loading modmain.lua	[00:01:33]: LOADING LUA SUCCESS[00:01:34]: PlayerDeaths loaded morgue	6451	[00:01:34]: loaded profile	[00:01:34]: bloom_enabled	false	[00:01:34]: loaded saveindex	[00:01:34]: OnFilesLoaded()	[00:01:34]: OnUpdatePurchaseStateComplete	[00:01:34]: 	Unload FE	[00:01:34]: 	Unload FE done	[00:01:38]: Mod: Black The Overlord (BETA) (BlackK)	Registering prefabs	[00:01:38]: Mod: Black The Overlord (BETA) (BlackK)	  Registering prefab file: prefabs/black	[00:01:38]: Mod: Black The Overlord (BETA) (BlackK)	    black	[00:01:38]: Mod: Black The Overlord (BETA) (BlackK)	  Registering default mod prefab	[00:01:40]: 	LOAD BE	[00:01:56]: Could not preload undefined prefab 0x4058bc0 (molehat)[00:01:58]: Could not preload undefined prefab 0x20e21d7a (puppet_wes)[00:01:58]: Could not preload undefined prefab 0x20e21d7a (puppet_wes)[00:02:12]: 	LOAD BE: done	[00:02:13]: Deserialize world session from session/07E0005EC2F1543F/0000000001	[00:02:13]: Save file is at version nil	[00:02:13]: 	Upgrading to 1...	[00:02:13]: Converting summer to autumn:	[00:02:13]: Begin Session: 07E0005EC2F1543F[00:02:14]: saving to server_temp/server_save	[00:02:15]: MiniMapComponent::AddAtlas( minimap/minimap_data.xml )[00:02:15]: MiniMapComponent::AddAtlas( ../mods/Black The Overlord (BETA)/images/map_icons/black.xml )[00:02:20]: Loading Nav Grid	[00:02:21]: OVERRIDE: setting	season_start	to	autumn	[00:02:48]: Reconstructing topology	[00:02:48]: 	...Sorting points	[00:02:48]: 	...Sorting edges	[00:02:48]: 	...Connecting nodes	[00:02:48]: 	...Validating connections	[00:02:48]: 	...Housekeeping	[00:02:48]: 	...Done!	[00:02:50]: Truncating to snapshot #1...[00:02:50]:  - session/07E0005EC2F1543F/KU_axt8-fXb_/0000000002[00:02:50]:    1 file(s) removed[00:02:50]: 1 uploads added to server. From server_temp[00:02:50]: Telling Client our new session identifier: 07E0005EC2F1543F[00:02:50]: ModIndex: Load sequence finished successfully.	[00:02:52]: Reset() returning[00:02:52]: QueryServerComplete no callback[00:03:08]: Creating Steam Room[00:03:13]: Attempting to send resume request[00:03:13]: ReceiveResumeRequest[00:03:13]: Received request to resume from: session/07E0005EC2F1543F/KU_axt8-fXb_[00:03:13]: OnResumeRequestLoadComplete - UserID KU_axt8-fXb[00:03:13]: ReceiveResumeNotification[00:03:13]: Deleting user minimap from session/07E0005EC2F1543F/KU_axt8-fXb_/minimap[00:03:13]: Deleting user session from session/07E0005EC2F1543F/KU_axt8-fXb_/0000000002[00:03:16]: Console_CreateRoom: roomName I WILL EAT YOUR PANCREAS! created for id 109775242091999894[00:05:09]: Received request to spawn as black from xXxBANDOxXx[Host][00:05:10]: [string "scripts/entityscript.lua"]:484: calling 'HasTag' on bad self (string expected, got boolean)LUA ERROR stack traceback:=[C]:-1 in (method) HasTag (C) <-1--1>scripts/entityscript.lua:484 in (method) HasTag (Lua) <483-485>   self (valid:true) =      OnSleepIn = function - scripts/prefabs/player_common.lua:931      userid = KU_axt8-fXb      inlimbo = false      GetMoistureRateScale = function - scripts/prefabs/player_common.lua:97      ghostenabled = true      SetCameraDistance = function - scripts/prefabs/player_common.lua:1042      ScreenFlash = function - scripts/prefabs/player_common.lua:1096      EnableMovementPrediction = function - scripts/prefabs/player_common.lua:407      player_classified = 109443 - player_classified (valid:true)      playercolour = table: 2EEE6C70      DynamicShadow = DynamicShadow (3FB3F3D8)      name = xXxBANDOxXx      jointask = PERIODIC 109442: 0.000000      IsOverheating = function - scripts/prefabs/player_common.lua:67      worldstatewatching = table: 3F9A3A68      Light = Light (3FB3F4F8)      inherentactions = table: 2F7CCB80      LightWatcher = LightWatcher (3FB3F518)      Network = Network (3FB3F1F8)      AnimState = AnimState (3FB4D7B8)      OnRemoveEntity = function - scripts/prefabs/player_common.lua:530      GetMoisture = function - scripts/prefabs/player_common.lua:77      pendingtasks = table: 3D6342E8      ShowHUD = function - scripts/prefabs/player_common.lua:1036      GUID = 109442      sg = sg="wilson", state="idle", time=0.00, tags = "idle,canrotate,"      spawntime = 111.93333917111      ApplyScale = function - scripts/prefabs/player_common.lua:1111      OnSetSkin = function - scripts/prefabs/player_common.lua:1004      SetGhostMode = function - scripts/prefabs/player_common.lua:446      CanExamine = function - scripts/prefabs/player_common.lua:20      HUD = HUD      OnWakeUp = function - scripts/prefabs/player_common.lua:959      Transform = Transform (3FB4B838)      OnLoad = function - scripts/prefabs/player_common.lua:909      IsHUDVisible = function - scripts/prefabs/player_common.lua:1026      actionreplica = table: 3D6407A0      event_listening = table: 3D635DC8      ScreenFade = function - scripts/prefabs/player_common.lua:1089      actioncomponents = table: 3D63DD48      OnSave = function - scripts/prefabs/player_common.lua:900      lower_components_shadow = table: 3D63DC80      GetMaxMoisture = function - scripts/prefabs/player_common.lua:87      OnNewSpawn = function - scripts/prefabs/player_common.lua:1515      entity = Entity (3D7EF840)      SnapCamera = function - scripts/prefabs/player_common.lua:1048      prefab = black      updatecomponents = table: 0B93F430      Physics = Physics (3FB3F678)      AttachClassified = function - scripts/prefabs/player_common.lua:519      OnDespawn = function - scripts/prefabs/player_common.lua:977      persists = false      ShowActions = function - scripts/prefabs/player_common.lua:1030      MiniMapEntity = MiniMapEntity (3FB3F1B8)      SoundEmitter = SoundEmitter (3FB4D718)      ShakeCamera = function - scripts/prefabs/player_common.lua:1056      IsActionsVisible = function - scripts/prefabs/player_common.lua:1020      IsFreezing = function - scripts/prefabs/player_common.lua:57      soundsname = maxwell      event_listeners = table: 3D634E00      replica = table: 3D63DD98      DetachClassified = function - scripts/prefabs/player_common.lua:525      components = table: 3D63DCA8      GetTemperature = function - scripts/prefabs/player_common.lua:47   tag = truescripts/components/builder.lua:354 in () ? (Lua) <348-357>   self =      bonus_tech_level = 0      accessible_tech_trees = table: 16A86908      inst = 109442 - black (valid:true)      recipes = table: 16A847C0      _ = table: 16A83F50      buffered_builds = table: 16A86CF0   recname = redgem   recipe = table: 0BF62998=(tail call):-1 in ()  (tail) <-1--1>scripts/widgets/crafting.lua:131 in (method) UpdateRecipes (Lua) <122-177>   self =      callbacks = table: 3A2C6240    [00:05:10]: SCRIPT ERROR! Showing error screen	[00:05:10]: #[string "scripts/widgets/hoverer.lua"]:46: attempt to index field 'controls' (a nil value)#LUA ERROR stack traceback:@scripts/widgets/hoverer.lua:46 in (method) OnUpdate (Lua) <27-135>   self =      callbacks = table: 3A2CB600      followhandler = table: 3A2C1AD8      lastStr =       inst = 109621 -  (valid:true)      focus = false      children = table: 3A2CB060      focus_flow_args = table: 3A2CC488      focus_target = false      secondarytext = Text -       owner = 109442 - black (valid:true)      parent = Controls      strFrames = 0      name = HoverText      enabled = true      focus_flow = table: 3A2CBF88      text = Text -       shown = true      isFE = false   using_mouse = true   str = nil   colour = nil@scripts/frontend.lua:594 in (method) Update (Lua) <460-609>   self =      topblackoverlay = Image - images/global.xml:square.tex      fade_title_out = false      overlayroot = overlayroot      save_indicator_time_left = 0      fade_title_time = 0      helptextbg = Image - images/global.xml:square.tex      helptext = HelpText      subtitle = Text -       updating_widgets_alt = table: 1255F160      spinner_repeat_time = -1      title = Text -       scroll_repeat_time = -1      topFadeHidden = false      gameinterface = 100012 -  (valid:true)      updating_widgets = table: 0C5F5D00      lastx = 1077      total_fade_time = 1      lasty = 183      autosave_enabled = true      fade_time = 1.0092457496872      blackoverlay = Image - images/global.xml:square.tex      screenstack = table: 0C5F2DA8      num_pending_saves = 0      save_indicator_fade_time = 0      saving_indicator = UIAnim      consoletext = Text - CONSOLE TEXT      alpha = 1.0000007903626      tracking_mouse = true      focus_locked = false      fade_title_in = false      forceProcessText = false      screenroot = screenroot      repeat_time = 0      displayingerror = false      helptexttext = Text -    dt = 0   k = HoverText   v = true@scripts/frontend.lua:642 in (method) PushScreen (Lua) <620-647>   self =      topblackoverlay = Image - images/global.xml:square.tex      fade_title_out = false      overlayroot = overlayroot      save_indicator_time_left = 0      fade_title_time = 0      helptextbg = Image - images/global.xml:square.tex      helptext = HelpText      subtitle = Text -       updating_widgets_alt = table: 1255F160      spinner_repeat_time = -1      title = Text -       scroll_repeat_time = -1      topFadeHidden = false      gameinterface = 100012 -  (valid:true)      updating_widgets = table: 0C5F5D00      lastx = 1077      total_fade_time = 1      lasty = 183      autosave_enabled = true      fade_time = 1.0092457496872      blackoverlay = Image - images/global.xml:square.tex      screenstack = table: 0C5F2DA8      num_pending_saves = 0      save_indicator_fade_time = 0      saving_indicator = UIAnim      consoletext = Text - CONSOLE TEXT      alpha = 1.0000007903626      tracking_mouse = true      focus_locked = false      fade_title_in = false      forceProcessText = false      screenroot = screenroot      repeat_time = 0      displayingerror = false      helptexttext = Text -    screen = ScriptErrorScreen@scripts/frontend.lua:753 in (method) ShowScreen (Lua) <750-755>   self =      topblackoverlay = Image - images/global.xml:square.tex      fade_title_out = false      overlayroot = overlayroot      save_indicator_time_left = 0      fade_title_time = 0      helptextbg = Image - images/global.xml:square.tex      helptext = HelpText      subtitle = Text -       updating_widgets_alt = table: 1255F160      spinner_repeat_time = -1      title = Text -       scroll_repeat_time = -1      topFadeHidden = false      gameinterface = 100012 -  (valid:true)      updating_widgets = table: 0C5F5D00      lastx = 1077      total_fade_time = 1      lasty = 183      autosave_enabled = true      fade_time = 1.0092457496872      blackoverlay = Image - images/global.xml:square.tex      screenstack = table: 0C5F2DA8      [00:05:10]: [Fixed] SPAWNING PLAYER AT: (10.00, 0.00, 130.00)	[00:05:10]: Serializing user session to session/07E0005EC2F1543F/KU_axt8-fXb_/0000000002[00:05:11]: QueryServerComplete no callback[00:05:12]: QueryServerComplete no callback[00:10:31]: Left room 109775242091999894[00:10:39]: Collecting garbage...[00:10:40]: lua_gc took 0.81 seconds[00:10:40]: ~NetworkLuaProxy()[00:10:40]: ~SimLuaProxy()[00:10:43]: lua_close took 3.55 seconds[00:10:44]: HttpClient::ClientThread::Main() complete[00:10:45]: HttpClient::ClientThread::Main() complete[00:10:45]: saved ping_cache[00:10:45]: HttpClient::ClientThread::Main() complete[00:10:46]: Could not unload undefined prefab 0x4058bc0 (molehat)[00:10:50]: Could not unload undefined prefab 0x20e21d7a (puppet_wes)[00:10:50]: Could not unload undefined prefab 0x20e21d7a (puppet_wes)[00:10:53]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. [00:10:53]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. [00:10:53]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. [00:10:53]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. [00:10:53]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. [00:10:53]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. [00:10:53]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. [00:10:53]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. [00:11:09]: HttpClient::ClientThread::Main() complete[00:11:09]: Shutting down
Link to comment
Share on other sites

  • Developer

Hey everyone, Kzisor brought this to my attention and sent me a code suggestion, and I've extended the crafting tabs to be accessed from the mod api now.

 

Here's an example of how you would use this new api, AddRecipeTab.

local sort_key = 25local fancy_tab = AddRecipeTab("Fancy Stuff", sort_key, "images/hud/fancy.xml", "fancy.tex" )local Ingredient = GLOBAL.IngredientAddRecipe("fancy_item", {Ingredient("goldnugget", 1)}, fancy_tab, GLOBAL.TECH.NONE )

I haven't done much testing on this yet, so if you run into issues, please let me know, and I'll get that sorted out.

 

This will be going out in the next patch, probably tonight. Hope this works for everyone's needs and simplifies the adding of new tabs!

Link to comment
Share on other sites

Hey everyone, Kzisor brought this to my attention and sent me a code suggestion, and I've extended the crafting tabs to be accessed from the mod api now.

 

Here's an example of how you would use this new api, AddRecipeTab.

local sort_key = 25local fancy_tab = AddRecipeTab("Fancy Stuff", sort_key, "images/hud/fancy.xml", "fancy.tex" )local Ingredient = GLOBAL.IngredientAddRecipe("fancy_item", {Ingredient("goldnugget", 1)}, fancy_tab, GLOBAL.TECH.NONE )

I haven't done much testing on this yet, so if you run into issues, please let me know, and I'll get that sorted out.

 

This will be going out in the next patch, probably tonight. Hope this works for everyone's needs and simplifies the adding of new tabs!

 

Pointing out that while PeterA did give the proper function to call he forgot a very important parameter/argument which can be passed to the function.

local fancy_tab = AddRecipeTab( "Fancy Stuff", -- Display Name.sort_key, -- Sort Key."images/hud/fancy.xml", -- Atlas File."fancy.tex", -- Icon File."fancybuilder" -- Builder Tag.)

You can add a builder tag to the Recipe Tab just as you can do with the Recipes, so only specific characters see the tab.

Link to comment
Share on other sites

Hello again...

Er, so, I was attempting to add more recipes to the tab, and then this happened.

db2ff4e0436e3ae897b60d53f2a2994b.png

 

And here is the code

---Shitton of recipe stuff beginning	local require = GLOBAL.requirelocal STRINGS = GLOBAL.STRINGSlocal resolvefilepath = GLOBAL.resolvefilepathlocal CUSTOM_RECIPETABS = GLOBAL.CUSTOM_RECIPETABS-- Comment: the atlas said tex instead of xmlCUSTOM_RECIPETABS.GEMS = { 	str = "GEMS", 	sort = 998, 	icon = "gemology.tex", 	icon_atlas = resolvefilepath("images/hud/gemology.xml") }STRINGS.TABS.GEMS = "Minerals"-- Comment: forgot to get the global Ingredientlocal Ingredient = GLOBAL.Ingredientlocal TECH = GLOBAL.TECH-- Comment: put boolean true instead of tag-- Comment: didn't use AddRecipe of mod environment, used Recipelocal redgem_recipe = AddRecipe("redgem", { Ingredient("goldnugget", 5), Ingredient("flint", 3), Ingredient("torch", 1) }, CUSTOM_RECIPETABS.GEMS, TECH.NONE, nil, nil, nil, nil, "gembuilder")local bluegem_recipe = AddRecipe("bluegem", { Ingredient("goldnugget", 8), Ingredient("nitre", 2), Ingredient("ice", 5) }, CUSTOM_RECIPETABS.GEMS, TECH.NONE, nil, nil, nil, nil, "gembuilder")local purplegem_recipe = AddRecipe("purplegem", { Ingredient("redgem", 1), Ingredient("bluegem", 1) }, CUSTOM_RECIPETABS.GEMS, TECH.NONE, nil, nil, nil, nil, "gembuilder")local orangegem_recipe = AddRecipe("orangegem", { Ingredient("purplegem", 1), Ingredient("redgem", 1) }, CUSTOM_RECIPETABS.GEMS, TECH.NONE, nil, nil, nil, nil, "gembuilder")local greengem_recipe = AddRecipe("greengem", { Ingredient("purplegem", 1), Ingredient("bluegem", 1) }, CUSTOM_RECIPETABS.GEMS, TECH.NONE, nil, nil, nil, nil, "gembuilder")local yellowgem_recipe = AddRecipe("yellowgem", { Ingredient("greengem", 1), Ingredient("prangegem", 1) }, CUSTOM_RECIPETABS.GEMS, TECH.NONE, nil, nil, nil, nil, "gembuilder")-- Add new tabAddClassPostConstruct("widgets/crafttabs", function(self)	-- Comment: copy pasted directly from the crafttabs widget, with our parameters    if self.owner:HasTag("gembuilder") then		local tab_bg = 		{			normal = "tab_normal.tex",			selected = "tab_selected.tex",			highlight = "tab_highlight.tex",			bufferedhighlight = "tab_place.tex",			overlay = "tab_researchable.tex",		}		local k = #self.tab_order + 1		v = CUSTOM_RECIPETABS.GEMS		self.tabs.spacing = 750 / k        local tab = self.tabs:AddTab(STRINGS.TABS[v.str], resolvefilepath("images/hud.xml"), v.icon_atlas or resolvefilepath("images/hud.xml"),        v.icon, tab_bg.normal, tab_bg.selected, tab_bg.highlight, tab_bg.bufferedhighlight, tab_bg.overlay,                        function() --select fn                if not self.controllercraftingopen then                    if self.craft_idx_by_tab[k] then                        self.crafting.idx = self.craft_idx_by_tab[k]                    end                    local default_filter = function(recname)                        local recipe = GLOBAL.GetValidRecipe(recname)                        return recipe ~= nil                        and recipe.tab == v                        and (self.owner.replica.builder == nil or                        self.owner.replica.builder:CanLearn(recname))                    end                    local advanced_filter = function(recname)                        local recipe = GLOBAL.GetValidRecipe(recname)                        return recipe ~= nil                        and recipe.tab == v                        and (self.owner.replica.builder == nil or                        self.owner.replica.builder:CanLearn(recname))                    end                    self.crafting:SetFilter(advanced_filter)                    self.crafting:Open()                end            end,             function() --deselect fn                self.craft_idx_by_tab[k] = self.crafting.idx                self.crafting:Close()            end)        tab.filter = v        tab.icon = v.icon        tab.icon_atlas = v.icon_atlas or resolvefilepath("images/hud.xml")        tab.tabname = STRINGS.TABS[v.str]        self.tabbyfilter[v] = tab                table.insert(self.tab_order, tab)				self:DoUpdateRecipes()	endend)-- Quick check if hostlocal IsMasterSim = function()	if not GLOBAL.TheWorld.ismastersim then		return false	end	return trueend---Shitton of recipe stuff ending

And, for some reason, though this is the last of my priorities atm, it made it so the recipe tab is there twice and I don't know why.

Link to comment
Share on other sites

I did read what they said. I just didn't get if that would help me with my current problem. It wasn't a response to my last post, so I assumed it would've helped with earlier problems.

Edited by Blackbando
Link to comment
Share on other sites

@Blackbando,

 

Well, you can improve the wall o' text with the new functionality that Peter brought.

 

Regarding your error, it's because of

Ingredient("prangegem", 1)

there is no prangegem in the game, so, no image for it, thus, crash.

 

On a second note, see my example here:

http://forums.kleientertainment.com/topic/54230-helpcould-i-make-some-different-items-to-create-the-a-same-new-item/

 

To create different recipes for things that already have recipes, such as purple gems, so you don't lock other people out of them.

Link to comment
Share on other sites

Er, hello again. How would one add magic levels and such to a recipe with this new system?

I have this put in

AddRecipe("yellowgem", {Ingredient("orangegem", 1), Ingredient("greengem", 1)}, fancy_tab, GLOBAL.TECH.MAGIC.3)

and get this error message

')' expected near '.3'

Link to comment
Share on other sites

@Blackbando, GLOBAL.TECH.MAGIC_THREE does exist it's used quite frequently so you're doing something else wrong. (for example the batbat recipe)

Recipe("batbat", {Ingredient("batwing", 5), Ingredient("livinglog", 2), Ingredient("purplegem", 1)}, RECIPETABS.MAGIC, TECH.MAGIC_THREE)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...