Jump to content

New to modding need help


Recommended Posts

So, im quite new to modding and i have this idea i want to make a reality.
I want to make a character this a custom HUD, like a button in the top right (What that button is for another post)

But i only want that button to show up if you're playing my custom character.
How would I go about doing that?

Link to comment
Share on other sites

@AgainstMatter

local ImageButton = require "widgets/imagebutton"local function add_button(inst)	local controls = inst.HUD.controls	local function button_pressed()	-- Do stuff	end	local your_button = controls.sidepanel:AddChild(ImageButton(UI_ATLAS, "button.tex", "button_over.tex", "button_disabled.tex"))	your_button:SetScale(1, 1, 1)	your_button:SetPosition(0, 0, 0)	your_button:SetOnClick(button_pressed)	your_button:Show()	your_button:SetText("Button label")	your_button:Enable()	controls.sidepanel:AddChild(your_button)endlocal function sim_postinit(inst)	if (inst.prefab == "your_character_prefab") then		add_button(inst)	endendAddSimPostInit(sim_postinit)
Link to comment
Share on other sites

@gameboys370

If you've downloaded them from the workshop you should just be able to go in to mods from the main menu and click on the mods you want to enable/disable and then click "apply"

 

If you've downloaded the mod in some other way, you need to navigate to the don't starve mods folder.
To do that you right click on Don't starve in steam and click "properties" 

Then click on "local files"

And then click on "browse local content"

This will bring you to the Don't starve system folder.

From there you want drag and drop your mod in to the mods folder.

After that you just launch the game and do the same thing you'd do when you have downloaded something from the workshop.

 

Link to comment
Share on other sites

@Blueberrys

 

Starting up
Don't Starve: 115739 WIN32_STEAM
Build Date: 2014-11-04_16-15-32
THREAD - started 'GAClient' (14404)
HttpClient::ClientThread::Main()
cGame::InitializeOnMainThread
WindowManager::Initialize
RestoreWindowPosition
   Saved Client Pos (1926 x 30)
   Adjusted Window Pos (1918 x 0)
EnsureWindowOnScreen
   All good.
GLInfo
~~~~~~
GL_VENDOR: Google Inc.
GL_RENDERER: ANGLE (AMD Radeon R9 200 Series)
GL_VERSION: OpenGL ES 2.0 (ANGLE 1.0.0.2249)
GL_SHADING_LANGUAGE_VERSION: OpenGL ES GLSL ES 1.00 (ANGLE 1.0.0.2249)
THREAD - started 'WindowsInputManager' (8972)
OpenGL extensions (19, 19):
GL_ANGLE_depth_texture
GL_ANGLE_framebuffer_blit
GL_ANGLE_framebuffer_multisample
GL_ANGLE_instanced_arrays
GL_ANGLE_pack_reverse_row_order
GL_ANGLE_texture_compression_dxt3
GL_ANGLE_texture_compression_dxt5
GL_ANGLE_texture_usage
GL_ANGLE_translated_shader_source
GL_EXT_read_format_bgra
GL_EXT_robustness
GL_EXT_texture_compression_dxt1
GL_EXT_texture_format_BGRA8888
GL_EXT_texture_storage
GL_OES_get_program_binary
GL_OES_packed_depth_stencil
GL_OES_rgb8_rgba8
GL_OES_standard_derivatives
GL_OES_texture_npot
GL_MAX_TEXTURE_SIZE = 16384
GL_MAX_TEXTURE_IMAGE_UNITS = 16
GL_MAX_RENDERBUFFER_SIZE = 16384
GL_MAX_VIEWPORT_DIMS = 16384, 16384
GL_MAX_VARYING_VECTORS = 10
GL_MAX_VERTEX_ATTRIBS = 16
GL_MAX_VERTEX_UNIFORM_VECTORS = 254
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 4
GL_MAX_FRAGMENT_UNIFORM_VECTORS = 221
4 compressed texture formats
texture format 0x83f0
texture format 0x83f1
texture format 0x83f2
texture format 0x83f3
cDontStarveGame::DoGameSpecificInitialize()
cGame::StartPlaying
LOADING LUA
DoLuaFile scripts/main.lua
DoLuaFile loading buffer scripts/main.lua
scripts/main.lua(161,1) running main.lua
 
scripts/modindex.lua(311,1) loaded modindex
scripts/modindex.lua(75,1) ModIndex: Beginning normal load sequence.
 
scripts/modindex.lua(386,1) Could not load mod_config_data/modconfiguration_Waya the Revenant
scripts/mods.lua(152,1) Loading mod: Waya the Revenant (waya the Revenant)
scripts/mods.lua(179,1) Mod: Waya the Revenant (waya the Revenant) Loading modworldgenmain.lua
scripts/mods.lua(187,1) Mod: Waya the Revenant (waya the Revenant)  Mod had no modworldgenmain.lua. Skipping.
scripts/mods.lua(179,1) Mod: Waya the Revenant (waya the Revenant) Loading modmain.lua
LOADING LUA SUCCESS
scripts/playerdeaths.lua(79,1) PlayerDeaths loaded morgue 919
scripts/playerprofile.lua(480,1) loaded profile
scripts/playerprofile.lua(544,1) bloom_enabled true
scripts/saveindex.lua(99,1) loaded saveindex
scripts/gamelogic.lua(1162,1) OnFilesLoaded()
scripts/gamelogic.lua(1151,1) OnUpdatePurchaseStateComplete
scripts/gamelogic.lua(118,1) Unload BE
Could not unload undefined prefab 0x4374c56c (yellowstaff)
Could not unload undefined prefab 0x303bfdce (axe)
Could not unload undefined prefab 0x94cf6c04 (goldenpickaxe)
Could not unload undefined prefab 0x8cc766ef (pumpkin_lantern)
Could not unload undefined prefab 0xfdcabd86 (earmuffshat)
Could not unload undefined prefab 0x9a6718eb (resurrectionstatue)
Could not unload undefined prefab 0x6b0c64bf (resurrectionstatue_placer)
Could not unload undefined prefab 0xdfb37276 (telestaff)
Could not unload undefined prefab 0xaf34ecc0 (trunkvest_winter)
Could not unload undefined prefab 0x875750ea (turf_road)
Could not unload undefined prefab 0xcd7669e5 (nightsword)
Could not unload undefined prefab 0x3f6c9ebb (diviningrod)
Could not unload undefined prefab 0xefa57cea (bandage)
Could not unload undefined prefab 0xde4bc7e7 (wall_hay_item)
Could not unload undefined prefab 0xe51acd32 (lightning_rod)
Could not unload undefined prefab 0x947bfcb8 (lightning_rod_placer)
Could not unload undefined prefab 0xb1fa364d (pickaxe)
Could not unload undefined prefab 0x34fb4f82 (pitchfork)
Could not unload undefined prefab 0x3f5176c5 (firepit)
Could not unload undefined prefab 0x8a462465 (firepit_placer)
Could not unload undefined prefab 0x62a5e7fe (nightlight)
Could not unload undefined prefab 0x185806ec (nightlight_placer)
Could not unload undefined prefab 0x3d4d1dc6 (bedroll_straw)
Could not unload undefined prefab 0xadfdb7ae (armor_sanity)
Could not unload undefined prefab 0xdf13a0c1 (ruins_bat)
Could not unload undefined prefab 0x76d26529 (bugnet)
Could not unload undefined prefab 0x5ce426c4 (blowdart_fire)
Could not unload undefined prefab 0x1541c9cc (armorruins)
Could not unload undefined prefab 0xe16c07d0 (ruinshat)
Could not unload undefined prefab 0xe5936c6a (firestaff)
Could not unload undefined prefab 0x1c48b877 (campfire)
Could not unload undefined prefab 0xdfe3a33 (campfire_placer)
Could not unload undefined prefab 0x89c20b1b (telebase)
Could not unload undefined prefab 0x868a468f (telebase_placer)
Could not unload undefined prefab 0x4740cff7 (tent)
Could not unload undefined prefab 0xb4d742b3 (tent_placer)
Could not unload undefined prefab 0x10473739 (spear)
Could not unload undefined prefab 0x36768a92 (orangestaff)
Could not unload undefined prefab 0x8d44bbad (cookpot)
Could not unload undefined prefab 0x30d2f57d (cookpot_placer)
Could not unload undefined prefab 0xa1e54a85 (goldenaxe)
Could not unload undefined prefab 0x68ba7100 (researchlab2)
Could not unload undefined prefab 0x3386a16a (researchlab2_placer)
Could not unload undefined prefab 0xdac7fbf5 (birdcage)
Could not unload undefined prefab 0xe1f9b335 (birdcage_placer)
Could not unload undefined prefab 0xe6af29d2 (compass)
Could not unload undefined prefab 0x2ca456a0 (orangeamulet)
Could not unload undefined prefab 0xcf1626 (rabbithouse)
Could not unload undefined prefab 0x1aa31ec4 (rabbithouse_placer)
Could not unload undefined prefab 0xe474f23c (armormarble)
Could not unload undefined prefab 0x3ccdbe75 (icestaff)
Could not unload undefined prefab 0x68ba7101 (researchlab3)
Could not unload undefined prefab 0xd6985329 (researchlab3_placer)
Could not unload undefined prefab 0xe87e06c0 (icebox)
Could not unload undefined prefab 0xf2bd1baa (icebox_placer)
Could not unload undefined prefab 0x19c004b2 (pighouse)
Could not unload undefined prefab 0x469fe538 (pighouse_placer)
Could not unload undefined prefab 0xca16846d (boards)
Could not unload undefined prefab 0xa8b25abc (wall_ruins_item)
Could not unload undefined prefab 0x21bf03b1 (thulecite)
Could not unload undefined prefab 0xfa14dec6 (birdtrap)
Could not unload undefined prefab 0x68370bd6 (trap_teeth)
Could not unload undefined prefab 0x7c11af2 (treasurechest)
Could not unload undefined prefab 0xd411bef8 (treasurechest_placer)
Could not unload undefined prefab 0xef21c9f2 (rope)
Could not unload undefined prefab 0x539e9e8a (trunkvest_summer)
Could not unload undefined prefab 0x2e54b535 (cane)
Could not unload undefined prefab 0xb981ecda (fast_farmplot)
Could not unload undefined prefab 0x2639673 (farmplot_placer)
Could not unload undefined prefab 0xf4eb0943 (shovel)
Could not unload undefined prefab 0xbcfca634 (strawhat)
Could not unload undefined prefab 0xe2bfa46 (tophat)
Could not unload undefined prefab 0xcda99af6 (winterhat)
Could not unload undefined prefab 0x761a1799 (gunpowder)
Could not unload undefined prefab 0x1cd9e60e (razor)
Could not unload undefined prefab 0xbea16a01 (hambat)
Could not unload undefined prefab 0x2e264dbc (blowdart_pipe)
Could not unload undefined prefab 0xec43b9f4 (sewing_kit)
Could not unload undefined prefab 0x46094f1b (beefalohat)
Could not unload undefined prefab 0x9a99c7b7 (armorgrass)
Could not unload undefined prefab 0x4d9a964d (trap)
Could not unload undefined prefab 0xd8067599 (beehat)
Could not unload undefined prefab 0xda17c8e8 (armorslurper)
Could not unload undefined prefab 0x47611d71 (sweatervest)
Could not unload undefined prefab 0x85181f7c (minerhat)
Could not unload undefined prefab 0x15220700 (backpack)
Could not unload undefined prefab 0x8bbc7f55 (beemine)
Could not unload undefined prefab 0xe8f381a1 (turf_checkerfloor)
Could not unload undefined prefab 0xd5201c09 (beebox)
Could not unload undefined prefab 0x753b7621 (beebox_placer)
Could not unload undefined prefab 0xb918c5fd (fishingrod)
Could not unload undefined prefab 0x86860bc2 (boomerang)
Could not unload undefined prefab 0x80cb1e18 (featherhat)
Could not unload undefined prefab 0x5a59f5cc (goldenshovel)
Could not unload undefined prefab 0xfb180669 (blowdart_sleep)
Could not unload undefined prefab 0xc4101586 (hammer)
Could not unload undefined prefab 0x4685284 (umbrella)
Could not unload undefined prefab 0xda1f7edf (winterometer)
Could not unload undefined prefab 0x955229cb (winterometer_placer)
Could not unload undefined prefab 0x111db7ae (footballhat)
Could not unload undefined prefab 0x9d92cce (purpleamulet)
Could not unload undefined prefab 0x3949a42 (meatrack)
Could not unload undefined prefab 0x56340ba8 (meatrack_placer)
Could not unload undefined prefab 0xbc429ef3 (bushhat)
Could not unload undefined prefab 0x22ec3802 (wall_stone_item)
Could not unload undefined prefab 0xfbaefa0e (rainometer)
Could not unload undefined prefab 0xeea990dc (rainometer_placer)
Could not unload undefined prefab 0x41ba89b5 (nightmarefuel)
Could not unload undefined prefab 0x3cb06493 (healingsalve)
Could not unload undefined prefab 0x75370b6 (papyrus)
Could not unload undefined prefab 0x37c31aa6 (lantern)
Could not unload undefined prefab 0xcceee6c3 (cutstone)
Could not unload undefined prefab 0x7fcb037d (greenstaff)
Could not unload undefined prefab 0x3edae42e (multitool_axe_pickaxe)
Could not unload undefined prefab 0x7f2d088c (armorwood)
Could not unload undefined prefab 0xc3bf310c (blueamulet)
Could not unload undefined prefab 0x739fbe3c (homesign)
Could not unload undefined prefab 0x33fdbd2e (homesign_placer)
Could not unload undefined prefab 0x7f46d7c0 (batbat)
Could not unload undefined prefab 0x378bda50 (wall_wood_item)
Could not unload undefined prefab 0x3c935451 (eyeturret_item)
Could not unload undefined prefab 0xb6201ac9 (onemanband)
Could not unload undefined prefab 0xf0330963 (panflute)
Could not unload undefined prefab 0x6f21e747 (piggyback)
Could not unload undefined prefab 0x1daa5ab7 (turf_carpetfloor)
Could not unload undefined prefab 0xcba65752 (amulet)
Could not unload undefined prefab 0x38967bb2 (researchlab)
Could not unload undefined prefab 0x77e9ae38 (researchlab_placer)
Could not unload undefined prefab 0xcad92460 (flowerhat)
Could not unload undefined prefab 0xb1591875 (greenamulet)
Could not unload undefined prefab 0x1153dbb9 (pottedfern)
Could not unload undefined prefab 0xf2102a71 (pottedfern_placer)
Could not unload undefined prefab 0x68ba7102 (researchlab4)
Could not unload undefined prefab 0x79aa04e8 (researchlab4_placer)
Could not unload undefined prefab 0x263bc4d5 (slow_farmplot)
Could not unload undefined prefab 0x2639673 (farmplot_placer)
Could not unload undefined prefab 0xe5071541 (nightmare_timepiece)
Could not unload undefined prefab 0x2c158f7c (torch)
Could not unload undefined prefab 0x2ae7e3b3 (purplegem)
Could not unload undefined prefab 0x265d1455 (turf_woodfloor)
Could not unload undefined prefab 0xf8e41fa9 (bedroll_furry)
Could not unload undefined prefab 0xdb20fa95 (heatrock)
Could not unload undefined prefab 0x9a0ed246 (yellowamulet)
Could not unload undefined prefab 0x33ab6997 (hud)
Could not unload undefined prefab 0x3364203d (forest)
Could not unload undefined prefab 0x2e5cb72d (cave)
Could not unload undefined prefab 0x40b82ff2 (maxwell)
Could not unload undefined prefab 0xbddda476 (fire)
Could not unload undefined prefab 0x1078732c (character_fire)
Could not unload undefined prefab 0x427b5b39 (shatter)
scripts/gamelogic.lua(123,1) Unload BE done
HttpClientWriteCallback (0x00B5C20B, 1, 16, 0x071DF834)
HttpClientWriteCallback READ 16 (16 total)
scripts/mods.lua(269,1) Mod: Waya the Revenant (waya the Revenant) Registering prefabs
scripts/mods.lua(275,1) Mod: Waya the Revenant (waya the Revenant)  Registering prefab file: prefabs/waya
scripts/mods.lua(279,1) Mod: Waya the Revenant (waya the Revenant)    waya
scripts/mods.lua(292,1) Mod: Waya the Revenant (waya the Revenant)  Registering default mod prefab
scripts/gamelogic.lua(133,1) Load FE
scripts/gamelogic.lua(135,1) Load FE: done
scripts/screens/mainscreen.lua(583,1) platform_motd table: 138FDA18
SimLuaProxy::QueryServer()
scripts/modindex.lua(85,1) ModIndex: Load sequence finished successfully.
 
Reset() returning
QueryServerComplete no callback
HttpClientWriteCallback (0x00B5C1FF, 1, 16, 0x071DF834)
HttpClientWriteCallback READ 16 (16 total)
QueryServerComplete no callback
HttpClientWriteCallback (0x00B5C15C, 1, 1250, 0x071DF834)
HttpClientWriteCallback READ 1250 (1250 total)
scripts/screens/mainscreen.lua(583,1) platform_motd table: 138F8EA0
scripts/mods.lua(304,1) unloading prefabs for mod MOD_Waya the Revenant
Collecting garbage...
lua_gc took 0.01 seconds
~SimLuaProxy()
lua_close took 0.02 seconds
ReleaseAll
ReleaseAll Finished
cGame::StartPlaying
LOADING LUA
DoLuaFile scripts/main.lua
DoLuaFile loading buffer scripts/main.lua
scripts/main.lua(161,1) running main.lua
 
scripts/modindex.lua(311,1) loaded modindex
scripts/modindex.lua(75,1) ModIndex: Beginning normal load sequence.
 
scripts/modindex.lua(386,1) Could not load mod_config_data/modconfiguration_Waya the Revenant
scripts/mods.lua(152,1) Loading mod: Waya the Revenant (waya the Revenant)
scripts/mods.lua(179,1) Mod: Waya the Revenant (waya the Revenant) Loading modworldgenmain.lua
scripts/mods.lua(187,1) Mod: Waya the Revenant (waya the Revenant)  Mod had no modworldgenmain.lua. Skipping.
scripts/mods.lua(179,1) Mod: Waya the Revenant (waya the Revenant) Loading modmain.lua
LOADING LUA SUCCESS
scripts/playerdeaths.lua(79,1) PlayerDeaths loaded morgue 919
scripts/playerprofile.lua(480,1) loaded profile
scripts/playerprofile.lua(544,1) bloom_enabled true
scripts/saveindex.lua(99,1) loaded saveindex
scripts/gamelogic.lua(1162,1) OnFilesLoaded()
scripts/gamelogic.lua(1151,1) OnUpdatePurchaseStateComplete
scripts/gamelogic.lua(148,1) Unload FE
scripts/gamelogic.lua(150,1) Unload FE done
scripts/mods.lua(269,1) Mod: Waya the Revenant (waya the Revenant) Registering prefabs
scripts/mods.lua(275,1) Mod: Waya the Revenant (waya the Revenant)  Registering prefab file: prefabs/waya
scripts/mods.lua(279,1) Mod: Waya the Revenant (waya the Revenant)    waya
scripts/mods.lua(292,1) Mod: Waya the Revenant (waya the Revenant)  Registering default mod prefab
scripts/gamelogic.lua(164,1) LOAD BE
Could not preload undefined prefab 0x350a87f2 (note)
Could not preload undefined prefab 0x350a87f2 (note)
Could not preload undefined prefab 0x350a87f2 (note)
scripts/gamelogic.lua(172,1) LOAD BE: done
MiniMapComponent::AddAtlas( minimap/minimap_data.xml )
MiniMapComponent::AddAtlas( ../mods/Waya the Revenant/images/map_icons/waya.xml )
scripts/gamelogic.lua(493,1) Loading Nav Grid
scripts/mainfunctions.lua(122,1) Can't find prefab randomtreeandleif
scripts/mainfunctions.lua(195,1) SpawnSaveRecord [nil, RandomTreeAndLeif] FAILED
scripts/modindex.lua(85,1) ModIndex: Load sequence finished successfully.
 
HttpClientWriteCallback (0x00B5C1FF, 1, 16, 0x071DF834)
HttpClientWriteCallback READ 16 (16 total)
Reset() returning
QueryServerComplete no callback
...nt_starve/data/../mods/Waya the Revenant/modmain.lua:49: attempt to index global 'your_button' (a nil value)
LUA ERROR stack traceback:
        D:/Program files/Steam/steamapps/common/dont_starve/data/../mods/Waya the Revenant/modmain.lua(49,1) in function 'onclick'
        D:/Program files/Steam/steamapps/common/dont_starve/data/scripts/widgets/button.lua(37,1) in function 'OnControl'
        D:/Program files/Steam/steamapps/common/dont_starve/data/scripts/widgets/widget.lua(112,1) in function 'OnControl'
        D:/Program files/Steam/steamapps/common/dont_starve/data/scripts/widgets/widget.lua(112,1) in function 'OnControl'
        D:/Program files/Steam/steamapps/common/dont_starve/data/scripts/widgets/widget.lua(112,1) in function 'OnControl'
        D:/Program files/Steam/steamapps/common/dont_starve/data/scripts/widgets/widget.lua(112,1) in function 'OnControl'
        D:/Program files/Steam/steamapps/common/dont_starve/data/scripts/widgets/widget.lua(112,1) in function 'OnControl'
        D:/Program files/Steam/steamapps/common/dont_starve/data/scripts/widgets/widget.lua(112,1) in function 'OnControl'
        D:/Program files/Steam/steamapps/common/dont_starve/data/scripts/screens/playerhud.lua(286,1) in function 'OnControl'
        D:/Program files/Steam/steamapps/common/dont_starve/data/scripts/frontend.lua(236,1) in function 'OnControl'
        D:/Program files/Steam/steamapps/common/dont_starve/data/scripts/input.lua(163,1) in function 'OnControl'
        D:/Program files/Steam/steamapps/common/dont_starve/data/scripts/input.lua(337,1)
scripts/frontend.lua(723,1) SCRIPT ERROR! Showing error screen
Force aborting...
 
 
Link to comment
Share on other sites

Waya the Revenant/modmain.lua:49: attempt to index global 'your_button' (a nil value)

 

I recommend you read more on lua scopes and local variables.

You can't use the your_button variable from inside the button_pressed function as it hasn't been declared where the function can access it.

Remove the "local" modifier from the your_button variable, then declare the variable before the button_pressed function.

local your_button-- ...-- button_pressed function here-- can access your_button
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.

×
  • Create New...