Sign in to follow this  
DarkCrafter

Need a little help

Recommended Posts

DarkCrafter    6

Do you want it to work like willow's lighter, or just an item with no uses and with the texture of willow's lighter?

an item with no use and the texture of willows lighter

Edited by DarkCrafter

Share this post


Link to post
Share on other sites
Aquaterion    821
local assets ={    Asset("ANIM", "anim/lighter.zip"),}local function fn()        local inst = CreateEntity()        inst.entity:AddTransform()        inst.entity:AddAnimState()        inst.entity:AddSoundEmitter()        inst.entity:AddNetwork()        MakeInventoryPhysics(inst)        inst.AnimState:SetBank("lighter")        inst.AnimState:SetBuild("lighter")        inst.AnimState:PlayAnimation("idle")        if not TheWorld.ismastersim then            return inst        end        inst.entity:SetPristine()        inst:AddComponent("inspectable")        --inst:AddComponent("stackable")		--inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM		-- Remove the -- from the 2 lines above to make this item able to stack more than 1, TUNING.STACK_SIZE_SMALLITEM is 20 I believe.        inst:AddComponent("inventoryitem")        MakeHauntableLaunchAndIgnite(inst)        return instendreturn Prefab("common/lighter2", fn, assets, prefabs) --You might need to change "common/lighter2" not sure tho...

This uses Willow's lighter (lighter.zip) to get the texture and animation. I'm not sure if it works as I haven't tested it.

 

Share this post


Link to post
Share on other sites
DarkCrafter    6
local assets ={    Asset("ANIM", "anim/lighter.zip"),}local function fn()        local inst = CreateEntity()        inst.entity:AddTransform()        inst.entity:AddAnimState()        inst.entity:AddSoundEmitter()        inst.entity:AddNetwork()        MakeInventoryPhysics(inst)        inst.AnimState:SetBank("lighter")        inst.AnimState:SetBuild("lighter")        inst.AnimState:PlayAnimation("idle")        if not TheWorld.ismastersim then            return inst        end        inst.entity:SetPristine()        inst:AddComponent("inspectable")        --inst:AddComponent("stackable")		--inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM		-- Remove the -- from the 2 lines above to make this item able to stack more than 1, TUNING.STACK_SIZE_SMALLITEM is 20 I believe.        inst:AddComponent("inventoryitem")        MakeHauntableLaunchAndIgnite(inst)        return instendreturn Prefab("common/lighter2", fn, assets, prefabs) --You might need to change "common/lighter2" not sure tho...

This uses Willow's lighter (lighter.zip) to get the texture and animation. I'm not sure if it works as I haven't tested it.

Thanks! Testing it out now

Share this post


Link to post
Share on other sites
Aquaterion    821

you need to put it in yourmod/scripts/prefabs/lighter2.lua

 

you'll also need a modmain.lua in yourmod/modmain.lua with this code:
 

PrefabFiles = {    "lighter2"}

and modinfo.lua in yourmod/modinfo.lua with this code:

name = "Extra Lighter"description = "Adds an unusable lighter"author = "DarkCrafter"version = "v1.0"forumthread = ""api_version = 10dst_compatible = true

You can rename lighter2.lua to whatever you want, but you'll have to change "lighter2 "in modmain.lua to whatever you changed it.

 

That should work.

 

You'll also have to enable the mod.

Edited by Aquaterion

Share this post


Link to post
Share on other sites
DarkCrafter    6

you need to put it in yourmod/scripts/prefabs/lighter2.lua

 

you'll also need a modmain.lua in yourmod/modmain.lua with this code:

 

PrefabFiles = {    "lighter2"}

and modinfo.lua in yourmod/modinfo.lua with this code:

name = "Extra Lighter"description = "Adds an unusable lighter"author = "DarkCrafter"version = "v1.0"forumthread = ""api_version = 10dst_compatible = true

You can rename lighter2.lua to whatever you want, but you'll have to change "lighter2 "in modmain.lua to whatever you changed it.

 

That should work.

 

You'll also have to enable the mod.

Thanks. Everything went well except when i went to pick it up, it crashed. And how would i make this a hand held item? After all that is done, it will be a breeze with the other coding.

Edited by DarkCrafter

Share this post


Link to post
Share on other sites
Aquaterion    821

I doubt that as items don't need inventory icons, if it works on the floor, it should work in your inventory.

 

One of the lines I told you to add:

  inst:AddComponent("inventoryitem")

was already there I believe so you might wanna check if there is a duplicate.

 

Try adding:

inst.MiniMapEntity:SetIcon("lighter.png")

as in the code I gave you it creates a minimapentity, so maybe it's not working because it's missing.

After can you send me your crash log. You can get it from /Documents/Keli/DontStarveTogether/log.txt

Edited by Aquaterion

Share this post


Link to post
Share on other sites
DarkCrafter    6

I only added the inst:AddComponent("equippable"). The other 2 were already in there.
 
Log:

Starting up
Command Line Arguments: 
Don't Starve: 122690 WIN32_STEAM
Build Date: 2015-01-09_13-20-16
THREAD - started 'GAClient' (2068)
HttpClient::ClientThread::Main()
THREAD - started 'GAClient' (8824)
Network tick rate: U=15(2), D=0
HttpClient::ClientThread::Main()
Network tick rate: U=15(2), D=0
THREAD - started 'GAClient' (5596)
HttpClient::ClientThread::Main()
loaded ping_cache
OnLoadPermissionList
OnLoadPermissionList
SteamID: 76561198113007654
cGame::InitializeOnMainThread
WindowManager::Initialize
THREAD - started 'GAClient' (9536)
HttpClient::ClientThread::Main()
WindowManager::SetFullscreen(0, 1366, 768, 60)
GLInfo
~~~~~~
GL_VENDOR: Google Inc.
GL_RENDERER: ANGLE (Intel® HD Graphics 3000)
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)
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 = 8192
GL_MAX_TEXTURE_IMAGE_UNITS = 16
GL_MAX_RENDERBUFFER_SIZE = 8192
GL_MAX_VIEWPORT_DIMS = 8192, 8192
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
THREAD - started 'WindowsInputManager' (9908)
cDontStarveGame::DoGameSpecificInitialize()
cGame::StartPlaying
LOADING LUA
DoLuaFile scripts/main.lua
DoLuaFile loading buffer scripts/main.lua
scripts/main.lua(167,1) running main.lua
 
loaded modindex
ModIndex: Beginning normal load sequence.
 
WARNING loading modinfo.lua: workshop-351203429 does not specify if it is compatible with Don't Starve Together. It may not work properly.
ModIndex:GetModsToLoad inserting moddir, The Darkend
ModIndex:GetModsToLoad inserting moddir, workshop-347360448
ModIndex:GetModsToLoad inserting moddir, workshop-358966231
ModIndex:GetModsToLoad inserting moddir, workshop-361911655
ModIndex:GetModsToLoad inserting moddir, workshop-369544255
Could not load mod_config_data/modconfiguration_The Darkend
Loading mod: The Darkend (The Darkened)
Could not load mod_config_data/modconfiguration_workshop-347360448
Loading mod: workshop-347360448 (DST Where's My Beefalo?)
Could not load mod_config_data/modconfiguration_workshop-358966231
Loading mod: workshop-358966231 (Compass HUD)
loaded mod_config_data/modconfiguration_workshop-361911655
Loading mod: workshop-361911655 (Menu Colors)
Could not load mod_config_data/modconfiguration_workshop-369544255
Loading mod: workshop-369544255 (Shovel Knight)
Mod: The Darkend (The Darkened) Loading modworldgenmain.lua
Mod: The Darkend (The Darkened)  Mod had no modworldgenmain.lua. Skipping.
Mod: The Darkend (The Darkened) Loading modmain.lua
Mod: workshop-361911655 (Menu Colors) Loading modworldgenmain.lua
Mod: workshop-361911655 (Menu Colors)  Mod had no modworldgenmain.lua. Skipping.
Mod: workshop-361911655 (Menu Colors) Loading modmain.lua
Mod: workshop-358966231 (Compass HUD) Loading modworldgenmain.lua
Mod: workshop-358966231 (Compass HUD)  Mod had no modworldgenmain.lua. Skipping.
Mod: workshop-358966231 (Compass HUD) Loading modmain.lua
Mod: workshop-347360448 (DST Where's My Beefalo?) Loading modworldgenmain.lua
Mod: workshop-347360448 (DST Where's My Beefalo?)  Mod had no modworldgenmain.lua. Skipping.
Mod: workshop-347360448 (DST Where's My Beefalo?) Loading modmain.lua
Mod: workshop-369544255 (Shovel Knight) Loading modworldgenmain.lua
Mod: workshop-369544255 (Shovel Knight)  Mod had no modworldgenmain.lua. Skipping.
Mod: workshop-369544255 (Shovel Knight) Loading modmain.lua
LOADING LUA SUCCESS
PlayerDeaths loaded morgue 5274
loaded profile
bloom_enabled false
loaded saveindex
OnFilesLoaded()
OnUpdatePurchaseStateComplete
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 0x1541c9cc (armorruins)
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 0x69afe33b (book_brimstone)
Could not unload undefined prefab 0xdfb37276 (telestaff)
Could not unload undefined prefab 0xaf34ecc0 (trunkvest_winter)
Could not unload undefined prefab 0x34a58be1 (book_sleep)
Could not unload undefined prefab 0xa3ec4f57 (book_gardening)
Could not unload undefined prefab 0x875750ea (turf_road)
Could not unload undefined prefab 0x2cc493e4 (book_birds)
Could not unload undefined prefab 0xcd7669e5 (nightsword)
Could not unload undefined prefab 0x1daa5ab7 (turf_carpetfloor)
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 0x378bda50 (wall_wood_item)
Could not unload undefined prefab 0xb1fa364d (pickaxe)
Could not unload undefined prefab 0x34fb4f82 (pitchfork)
Could not unload undefined prefab 0xdf13a0c1 (ruins_bat)
Could not unload undefined prefab 0xe490ce6b (book_tentacles)
Could not unload undefined prefab 0x3f5176c5 (firepit)
Could not unload undefined prefab 0x8a462465 (firepit_placer)
Could not unload undefined prefab 0xe16c07d0 (ruinshat)
Could not unload undefined prefab 0x3d4d1dc6 (bedroll_straw)
Could not unload undefined prefab 0xadfdb7ae (armor_sanity)
Could not unload undefined prefab 0x3edae42e (multitool_axe_pickaxe)
Could not unload undefined prefab 0x76d26529 (bugnet)
Could not unload undefined prefab 0x5ce426c4 (blowdart_fire)
Could not unload undefined prefab 0xc3bf310c (blueamulet)
Could not unload undefined prefab 0x36768a92 (orangestaff)
Could not unload undefined prefab 0xa0c84037 (wall_moonrock_item)
Could not unload undefined prefab 0x1c48b877 (campfire)
Could not unload undefined prefab 0xdfe3a33 (campfire_placer)
Could not unload undefined prefab 0x1153dbb9 (pottedfern)
Could not unload undefined prefab 0xf2102a71 (pottedfern_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 0x2ca456a0 (orangeamulet)
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 0x739fbe3c (homesign)
Could not unload undefined prefab 0x33fdbd2e (homesign_placer)
Could not unload undefined prefab 0xa8b25abc (wall_ruins_item)
Could not unload undefined prefab 0xe6af29d2 (compass)
Could not unload undefined prefab 0x21bf03b1 (thulecite)
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 0xcda99af6 (winterhat)
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 0x2e264dbc (blowdart_pipe)
Could not unload undefined prefab 0x2e54b535 (cane)
Could not unload undefined prefab 0xfa14dec6 (birdtrap)
Could not unload undefined prefab 0xe2bfa46 (tophat)
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 0x75370b6 (papyrus)
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 0x3f6c9ebb (diviningrod)
Could not unload undefined prefab 0x86860bc2 (boomerang)
Could not unload undefined prefab 0x761a1799 (gunpowder)
Could not unload undefined prefab 0x1cd9e60e (razor)
Could not unload undefined prefab 0x46094f1b (beefalohat)
Could not unload undefined prefab 0x68ba7100 (researchlab2)
Could not unload undefined prefab 0x3386a16a (researchlab2_placer)
Could not unload undefined prefab 0xec43b9f4 (sewing_kit)
Could not unload undefined prefab 0x68370bd6 (trap_teeth)
Could not unload undefined prefab 0x9a99c7b7 (armorgrass)
Could not unload undefined prefab 0x8bbc7f55 (beemine)
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 0xfb180669 (blowdart_sleep)
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 0x111db7ae (footballhat)
Could not unload undefined prefab 0x80cb1e18 (featherhat)
Could not unload undefined prefab 0x5a59f5cc (goldenshovel)
Could not unload undefined prefab 0xbea16a01 (hambat)
Could not unload undefined prefab 0xc4101586 (hammer)
Could not unload undefined prefab 0x4685284 (umbrella)
Could not unload undefined prefab 0x6f21e747 (piggyback)
Could not unload undefined prefab 0xe87e06c0 (icebox)
Could not unload undefined prefab 0xf2bd1baa (icebox_placer)
Could not unload undefined prefab 0x41ba89b5 (nightmarefuel)
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 0xcceee6c3 (cutstone)
Could not unload undefined prefab 0xfbaefa0e (rainometer)
Could not unload undefined prefab 0xeea990dc (rainometer_placer)
Could not unload undefined prefab 0x89c20b1b (telebase)
Could not unload undefined prefab 0x868a468f (telebase_placer)
Could not unload undefined prefab 0x3cb06493 (healingsalve)
Could not unload undefined prefab 0xe5936c6a (firestaff)
Could not unload undefined prefab 0x37c31aa6 (lantern)
Could not unload undefined prefab 0x9d92cce (purpleamulet)
Could not unload undefined prefab 0x7fcb037d (greenstaff)
Could not unload undefined prefab 0xa90e8c50 (lifeinjector)
Could not unload undefined prefab 0x7f2d088c (armorwood)
Could not unload undefined prefab 0x7f46d7c0 (batbat)
Could not unload undefined prefab 0x62a5e7fe (nightlight)
Could not unload undefined prefab 0x185806ec (nightlight_placer)
Could not unload undefined prefab 0xb6201ac9 (onemanband)
Could not unload undefined prefab 0xf0330963 (panflute)
Could not unload undefined prefab 0x3c935451 (eyeturret_item)
Could not unload undefined prefab 0x22ec3802 (wall_stone_item)
Could not unload undefined prefab 0x4d9a964d (trap)
Could not unload undefined prefab 0xbd603add (reviver)
Could not unload undefined prefab 0xda1f7edf (winterometer)
Could not unload undefined prefab 0x955229cb (winterometer_placer)
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 0xdac7fbf5 (birdcage)
Could not unload undefined prefab 0xe1f9b335 (birdcage_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)
Unload BE done
Mod: The Darkend (The Darkened) Registering prefabs
Mod: The Darkend (The Darkened)  Registering prefab file: prefabs/lighter2
Mod: The Darkend (The Darkened)    lighter2
Mod: The Darkend (The Darkened)  Registering default mod prefab
Mod: workshop-361911655 (Menu Colors) Registering prefabs
Mod: workshop-361911655 (Menu Colors)  Registering default mod prefab
Mod: workshop-358966231 (Compass HUD) Registering prefabs
Mod: workshop-358966231 (Compass HUD)  Registering default mod prefab
Mod: workshop-347360448 (DST Where's My Beefalo?) Registering prefabs
Mod: workshop-347360448 (DST Where's My Beefalo?)  Registering default mod prefab
Mod: workshop-369544255 (Shovel Knight) Registering prefabs
Mod: workshop-369544255 (Shovel Knight)  Registering prefab file: prefabs/winston
Mod: workshop-369544255 (Shovel Knight)    winston
Mod: workshop-369544255 (Shovel Knight)  Registering prefab file: prefabs/shovelblade
Mod: workshop-369544255 (Shovel Knight)    shovelblade
Mod: workshop-369544255 (Shovel Knight)    goldenshovelblade
Mod: workshop-369544255 (Shovel Knight)  Registering default mod prefab
Load FE
Load FE: done
platform_motd table: 13344EC8
SimLuaProxy::QueryServer()
update_date table: 13A49B80
SimLuaProxy::QueryServer()
ModIndex: Load sequence finished successfully.
 
Reset() returning
../mods/workshop-358966231/images/arrow-style1.tex is 100x100 but compressed textures must have power of 2 dimensions.
../mods/workshop-358966231/images/arrow-style2.tex is 100x100 but compressed textures must have power of 2 dimensions.
platform_motd table: 1A7DC450
update_date table: 1A7DD300
Account Communication Success (6)
[ACCOUNT_ACTION_TOKEN_PURPOSE] Received UserId from TokenPurpose: KU_3QWJKj_z
QueryServerComplete no callback
Downloaded server listings - full: 3942 filtered: 1847
4
Network tick rate: U=15(2), D=0
Setting up socket descriptors
Server Started
Creating Steam Room
Console_CreateRoom: roomName The Holy world created for id 109775241762407356
SendHandShakeServerListing
SaveIndex:StartSurvivalMode!: false
unloading prefabs for mod MOD_The Darkend
unloading prefabs for mod MOD_workshop-361911655
unloading prefabs for mod MOD_workshop-358966231
unloading prefabs for mod MOD_workshop-347360448
unloading prefabs for mod MOD_workshop-369544255
Collecting garbage...
lua_gc took 0.02 seconds
~NetworkLuaProxy()
~SimLuaProxy()
lua_close took 0.03 seconds
ReleaseAll
ReleaseAll Finished
cGame::StartPlaying
LOADING LUA
DoLuaFile scripts/main.lua
DoLuaFile loading buffer scripts/main.lua
scripts/main.lua(167,1) running main.lua
 
loaded modindex
ModIndex: Beginning normal load sequence.
 
WARNING loading modinfo.lua: workshop-351203429 does not specify if it is compatible with Don't Starve Together. It may not work properly.
ModIndex:GetModsToLoad inserting moddir, The Darkend
ModIndex:GetModsToLoad inserting moddir, workshop-347360448
ModIndex:GetModsToLoad inserting moddir, workshop-358966231
ModIndex:GetModsToLoad inserting moddir, workshop-361911655
ModIndex:GetModsToLoad inserting moddir, workshop-369544255
Could not load mod_config_data/modconfiguration_The Darkend
Loading mod: The Darkend (The Darkened)
Could not load mod_config_data/modconfiguration_workshop-347360448
Loading mod: workshop-347360448 (DST Where's My Beefalo?)
Could not load mod_config_data/modconfiguration_workshop-358966231
Loading mod: workshop-358966231 (Compass HUD)
loaded mod_config_data/modconfiguration_workshop-361911655
Loading mod: workshop-361911655 (Menu Colors)
Could not load mod_config_data/modconfiguration_workshop-369544255
Loading mod: workshop-369544255 (Shovel Knight)
Mod: The Darkend (The Darkened) Loading modworldgenmain.lua
Mod: The Darkend (The Darkened)  Mod had no modworldgenmain.lua. Skipping.
Mod: The Darkend (The Darkened) Loading modmain.lua
Mod: workshop-361911655 (Menu Colors) Loading modworldgenmain.lua
Mod: workshop-361911655 (Menu Colors)  Mod had no modworldgenmain.lua. Skipping.
Mod: workshop-361911655 (Menu Colors) Loading modmain.lua
Mod: workshop-358966231 (Compass HUD) Loading modworldgenmain.lua
Mod: workshop-358966231 (Compass HUD)  Mod had no modworldgenmain.lua. Skipping.
Mod: workshop-358966231 (Compass HUD) Loading modmain.lua
Mod: workshop-347360448 (DST Where's My Beefalo?) Loading modworldgenmain.lua
Mod: workshop-347360448 (DST Where's My Beefalo?)  Mod had no modworldgenmain.lua. Skipping.
Mod: workshop-347360448 (DST Where's My Beefalo?) Loading modmain.lua
Mod: workshop-369544255 (Shovel Knight) Loading modworldgenmain.lua
Mod: workshop-369544255 (Shovel Knight)  Mod had no modworldgenmain.lua. Skipping.
Mod: workshop-369544255 (Shovel Knight) Loading modmain.lua
LOADING LUA SUCCESS
PlayerDeaths loaded morgue 5274
loaded profile
bloom_enabled false
loaded saveindex
OnFilesLoaded()
OnUpdatePurchaseStateComplete
Load Slot: ... generating new world
WorldSim::SimThread::SimThread()
WorldSim::SimThread::SimThread() complete
THREAD - started 'WorldSim' (9036)
WorldSim::SimThread::Main()
DoLuaFile scripts/worldgen_main.lua
DoLuaFile loading buffer scripts/worldgen_main.lua
ModIndex: Load sequence finished successfully.
 
Reset() returning
DLC enabled : false
ModIndex:GetModsToLoad inserting modname, workshop-358966231
ModIndex:GetModsToLoad inserting modname, The Darkend
ModIndex:GetModsToLoad inserting modname, workshop-347360448
ModIndex:GetModsToLoad inserting modname, workshop-361911655
ModIndex:GetModsToLoad inserting modname, workshop-369544255
Loading mod: workshop-358966231 (Compass HUD)
Loading mod: The Darkend (The Darkened)
Loading mod: workshop-347360448 (DST Where's My Beefalo?)
Loading mod: workshop-361911655 (Menu Colors)
Loading mod: workshop-369544255 (Shovel Knight)
Mod: workshop-358966231 (Compass HUD) Loading modworldgenmain.lua
Mod: workshop-358966231 (Compass HUD)  Mod had no modworldgenmain.lua. Skipping.
Mod: workshop-361911655 (Menu Colors) Loading modworldgenmain.lua
Mod: workshop-361911655 (Menu Colors)  Mod had no modworldgenmain.lua. Skipping.
Mod: workshop-347360448 (DST Where's My Beefalo?) Loading modworldgenmain.lua
Mod: workshop-347360448 (DST Where's My Beefalo?)  Mod had no modworldgenmain.lua. Skipping.
Mod: The Darkend (The Darkened) Loading modworldgenmain.lua
Mod: The Darkend (The Darkened)  Mod had no modworldgenmain.lua. Skipping.
Mod: workshop-369544255 (Shovel Knight) Loading modworldgenmain.lua
Mod: workshop-369544255 (Shovel Knight)  Mod had no modworldgenmain.lua. Skipping.
scripts/worldgen_main.lua(77,1) running worldgen_main.lua
 
scripts/worldgen_main.lua(79,1) SEED = 1420933950
scripts/worldgen_main.lua(456,1) WORLDGEN PRESET: SURVIVAL_TOGETHER
scripts/worldgen_main.lua(464,1) WORLDGEN LEVEL ID: 1
scripts/worldgen_main.lua(471,1) 
#######
#
# Generating Normal Mode Together Forever Level
#
#######
 
Creating story...
LinkNodesByKeys
Baking map... 425
Map Baked!
Encoding...
Encoding... DONE
Checking Tags
Populating voronoi...
Done forest map gen!
scripts/worldgen_main.lua(245,1) Checking map...
scripts/worldgen_main.lua(599,1) Generation complete
WorldSim::SimThread::Main() complete
Unload FE
Unload FE done
Mod: The Darkend (The Darkened) Registering prefabs
Mod: The Darkend (The Darkened)  Registering prefab file: prefabs/lighter2
Mod: The Darkend (The Darkened)    lighter2
Mod: The Darkend (The Darkened)  Registering default mod prefab
Mod: workshop-361911655 (Menu Colors) Registering prefabs
Mod: workshop-361911655 (Menu Colors)  Registering default mod prefab
Mod: workshop-358966231 (Compass HUD) Registering prefabs
Mod: workshop-358966231 (Compass HUD)  Registering default mod prefab
Mod: workshop-347360448 (DST Where's My Beefalo?) Registering prefabs
Mod: workshop-347360448 (DST Where's My Beefalo?)  Registering default mod prefab
Mod: workshop-369544255 (Shovel Knight) Registering prefabs
Mod: workshop-369544255 (Shovel Knight)  Registering prefab file: prefabs/winston
Mod: workshop-369544255 (Shovel Knight)    winston
Mod: workshop-369544255 (Shovel Knight)  Registering prefab file: prefabs/shovelblade
Mod: workshop-369544255 (Shovel Knight)    shovelblade
Mod: workshop-369544255 (Shovel Knight)    goldenshovelblade
Mod: workshop-369544255 (Shovel Knight)  Registering default mod prefab
../mods/workshop-358966231/images/arrow-style1.tex is 100x100 but compressed textures must have power of 2 dimensions.
../mods/workshop-358966231/images/arrow-style2.tex is 100x100 but compressed textures must have power of 2 dimensions.
LOAD BE
Could not preload undefined prefab 0x20e21d7a (puppet_wes)
Could not preload undefined prefab 0x20e21d7a (puppet_wes)
LOAD BE: done
Begin Session: 0580001BD337E022
saving to server/0580001BD337E022/server_save
MiniMapComponent::AddAtlas( minimap/minimap_data.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/koalefant_winter.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/koalefant_summer.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/babybeefalo.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/beefalo.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/Goose.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/dragonfly.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/deerclops.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/bearger.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/carrot_planted.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/chester_eyebone.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/flint.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/rabbithole.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/rocky.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/red_mushroom.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/green_mushroom.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/blue_mushroom.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/lightninggoat.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/mandrake.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-347360448/minimap/molehill.xml )
MiniMapComponent::AddAtlas( ../mods/workshop-369544255/images/map_icons/winston.xml )
Loading Nav Grid
1 uploads added to server. From server/0580001BD337E022
Telling Client our new session identifier: 0580001BD337E022
Attempting to send resume request
ReceiveResumeRequest
Received request to resume from: session/0580001BD337E022/KU_3QWJKj_z
OnResumeRequestLoadComplete - UserID KU_3QWJKj_z
DeleteUserSession session/0580001BD337E022/KU_3QWJKj_z
Received request to spawn as wilson from Shakes[Host]
 
[scatter] SPAWNING PLAYER AT: (2.76, 0.00, 1.75)
Serialize session to session/0580001BD337E022/KU_3QWJKj_z
Deserialize local session session/0580001BD337E022/KU_3QWJKj_z
Failed to load minimap from session data: session/0580001BD337E022/KU_3QWJKj_z_minimap
WARNING! Could not find region 'lighter2.tex' from atlas 'images/inventoryimages.xml'. Is the region specified in the atlas?
Looking for default texture '(null)' from atlas 'images/inventoryimages.xml'.
images/inventoryimages.xml
LUA ERROR stack traceback:
        scripts/widgets/image.lua(30,1) in function 'SetTexture'
        scripts/widgets/image.lua(11,1) in function '_ctor'
        scripts/class.lua(181,1) in function 'Image'
        scripts/widgets/itemtile.lua(38,1) in function '_ctor'
        scripts/class.lua(181,1) in function 'ItemTile'
        scripts/widgets/inventorybar.lua(922,1) in function 'OnItemEquip'
        scripts/widgets/inventorybar.lua(75,1) in function 'fn'
        scripts/entityscript.lua(877,1) in function 'PushEvent'
        scripts/components/inventory.lua(690,1) in function 'Equip'
        scripts/actions.lua(182,1) in function 'fn'
        scripts/bufferedaction.lua(20,1) in function 'Do'
        scripts/entityscript.lua(1187,1) in function 'PerformBufferedAction'
        scripts/stategraphs/SGwilson.lua(1748,1) in function 'fn'
        scripts/stategraph.lua(549,1) in function 'UpdateState'
        scripts/stategraph.lua(588,1) in function 'Update'
        scripts/stategraph.lua(123,1) in function 'Update'
        scripts/update.lua(167,1)
images/inventoryimages.xml
LUA ERROR stack traceback:
        scripts/widgets/image.lua(30,1) in function 'SetTexture'
        scripts/widgets/image.lua(11,1) in function '_ctor'
        scripts/class.lua(181,1) in function 'Image'
        scripts/widgets/itemtile.lua(38,1) in function '_ctor'
        scripts/class.lua(181,1) in function 'ItemTile'
        scripts/widgets/inventorybar.lua(922,1) in function 'OnItemEquip'
        scripts/widgets/inventorybar.lua(75,1) in function 'fn'
        scripts/entityscript.lua(877,1) in function 'PushEvent'
        scripts/components/inventory.lua(690,1) in function 'Equip'
        scripts/actions.lua(182,1) in function 'fn'
        scripts/bufferedaction.lua(20,1) in function 'Do'
        scripts/entityscript.lua(1187,1) in function 'PerformBufferedAction'
        scripts/stategraphs/SGwilson.lua(1748,1) in function 'fn'
        scripts/stategraph.lua(549,1) in function 'UpdateState'
        scripts/stategraph.lua(588,1) in function 'Update'
        scripts/stategraph.lua(123,1) in function 'Update'
        scripts/update.lua(167,1)
SCRIPT ERROR! Showing error screen
QueryServerComplete no callback
QueryServerComplete no callback
Force aborting...

Share this post


Link to post
Share on other sites
Aquaterion    821

Try changing the last line in ligher2.lua to:

return Prefab("common/lighter", fn, assets, prefabs)

maybe that's the problem.

 

Edit: I'm headin to bed so If you need something else, I won't be able to help, but hopefully someone else will.

Edited by Aquaterion

Share this post


Link to post
Share on other sites
DarkCrafter    6

Try changing the last line in ligher2.lua to:

return Prefab("common/lighter", fn, assets, prefabs)

maybe that's the problem.

This broke it.  But i noticed that the lua error after it had a error with the inventory bar:post-284391-0-92494600-1420935612_thumb.

 

Share this post


Link to post
Share on other sites
Aquaterion    821

Ok I got it working, you were kinda right.

 

modmain.lua:

PrefabFiles = {    "lighter2"}GLOBAL.STRINGS.NAMES.LIGHTER2 = "Lighter" -- This Changes it's name when hovered overGLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.LIGHTER2 = "A Broken Lighter." -- This Changes the item's description.

lighter2.lua:

local assets ={    Asset("ANIM", "anim/lighter.zip"),	Asset("ANIM", "anim/swap_lighter.zip"),}  local function onequip(inst, owner)    owner.AnimState:OverrideSymbol("swap_object", "swap_lighter", "swap_lighter")    owner.AnimState:Show("ARM_carry")     owner.AnimState:Hide("ARM_normal")     inst.SoundEmitter:PlaySound("dontstarve/wilson/lighter_LP")endlocal function onunequip(inst,owner)    owner.AnimState:Hide("ARM_carry")     owner.AnimState:Show("ARM_normal") end local function fn()        local inst = CreateEntity()         inst.entity:AddTransform()        inst.entity:AddAnimState()        inst.entity:AddNetwork()		inst.entity:AddSoundEmitter()         MakeInventoryPhysics(inst)         inst.AnimState:SetBank("lighter")        inst.AnimState:SetBuild("lighter")        inst.AnimState:PlayAnimation("idle")		        if not TheWorld.ismastersim then            return inst        end         inst.entity:SetPristine()         inst:AddComponent("inspectable")        --inst:AddComponent("stackable")        --inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM        -- Remove the -- from the 2 lines above to make this item able to stack more than 1, TUNING.STACK_SIZE_SMALLITEM is 20 I believe.        inst:AddComponent("inventoryitem")		inst:AddComponent("equippable")		inst.components.equippable:SetOnEquip(onequip)		inst.components.equippable:SetOnUnequip(onunequip)				inst.components.inventoryitem.imagename = "lighter" --index name on default inventoryimages.		inst.components.inventoryitem.atlasname = "images/inventoryimages.xml"         MakeHauntableLaunch(inst)         return instend return Prefab("common/lighter2", fn, assets, prefabs)

Share this post


Link to post
Share on other sites
DarkCrafter    6

Ok I got it working, you were kinda right.

 

modmain.lua:

PrefabFiles = {    "lighter2"}GLOBAL.STRINGS.NAMES.LIGHTER2 = "Lighter" -- This Changes it's name when hovered overGLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.LIGHTER2 = "A Broken Lighter." -- This Changes the item's description.

lighter2.lua:

local assets ={    Asset("ANIM", "anim/lighter.zip"),	Asset("ANIM", "anim/swap_lighter.zip"),}  local function onequip(inst, owner)    owner.AnimState:OverrideSymbol("swap_object", "swap_lighter", "swap_lighter")    owner.AnimState:Show("ARM_carry")     owner.AnimState:Hide("ARM_normal")     inst.SoundEmitter:PlaySound("dontstarve/wilson/lighter_LP")endlocal function onunequip(inst,owner)    owner.AnimState:Hide("ARM_carry")     owner.AnimState:Show("ARM_normal") end local function fn()        local inst = CreateEntity()         inst.entity:AddTransform()        inst.entity:AddAnimState()        inst.entity:AddNetwork()		inst.entity:AddSoundEmitter()         MakeInventoryPhysics(inst)         inst.AnimState:SetBank("lighter")        inst.AnimState:SetBuild("lighter")        inst.AnimState:PlayAnimation("idle")		        if not TheWorld.ismastersim then            return inst        end         inst.entity:SetPristine()         inst:AddComponent("inspectable")        --inst:AddComponent("stackable")        --inst.components.stackable.maxsize = TUNING.STACK_SIZE_SMALLITEM        -- Remove the -- from the 2 lines above to make this item able to stack more than 1, TUNING.STACK_SIZE_SMALLITEM is 20 I believe.        inst:AddComponent("inventoryitem")		inst:AddComponent("equippable")		inst.components.equippable:SetOnEquip(onequip)		inst.components.equippable:SetOnUnequip(onunequip)				inst.components.inventoryitem.imagename = "lighter" --index name on default inventoryimages.		inst.components.inventoryitem.atlasname = "images/inventoryimages.xml"         MakeHauntableLaunch(inst)         return instend return Prefab("common/lighter2", fn, assets, prefabs)

I had already got this working yesterday at like 10 am. It needed the picture :/

Share this post


Link to post
Share on other sites
DarkCrafter    6

OK so now I've get everything edited to work how it is supposed to, except i have a problem. I need the item to have a common chance of being destroyed when it is haunted (Not always. And most of the time). The current code:

 

local assets ={	Asset("ANIM", "anim/darkendsoul.zip"),		Asset("IMAGE", "images/inventoryimages/darkendsoul.tex"),	Asset("ATLAS", "images/inventoryimages/darkendsoul.xml"),}local function onhaunt(inst)	inst.components.resurrector.active = true	inst.SoundEmitter:PlaySound("dontstarve/common/resurrectionstone_activate")endlocal function fn()		local inst = CreateEntity()     inst.entity:AddTransform()    inst.entity:AddAnimState()    inst.entity:AddSoundEmitter()    inst.entity:AddNetwork()     MakeInventoryPhysics(inst)     inst.AnimState:SetBank("nightmarefuel")    inst.AnimState:SetBuild("darkendsoul")    inst.AnimState:PlayAnimation("idle_loop")    inst.AnimState:SetMultColour(1, 1, 1, 0.5)     if not TheWorld.ismastersim then        return inst    end		inst.entity:SetPristine()		inst:AddComponent("resurrector")     inst:AddComponent("inspectable")		inst:AddComponent("hauntable")	inst.components.hauntable:SetHauntValue(TUNING.HAUNT_INSTANT_REZ)		    inst:AddComponent("inventoryitem")	inst.components.inventoryitem.atlasname = "images/inventoryimages/darkendsoul.xml"	    return instend return Prefab("common/inventory/darkendsoul", fn, assets)

Share this post


Link to post
Share on other sites
DarkXero    2892

Use MakeHauntableLaunchAndSmash, a global function from standard components.

function MakeHauntableLaunchAndSmash(inst, launch_chance, smash_chance, speed, cooldown, launch_haunt_value, smash_haunt_value)

So you add:

MakeHauntableLaunchAndSmash(inst, 1, 0.8)

Share this post


Link to post
Share on other sites
DarkCrafter    6

 

Use MakeHauntableLaunchAndSmash, a global function from standard components.

function MakeHauntableLaunchAndSmash(inst, launch_chance, smash_chance, speed, cooldown, launch_haunt_value, smash_haunt_value)

So you add:

MakeHauntableLaunchAndSmash(inst, 1, 0.8)

 

Where, and which one?

Share this post


Link to post
Share on other sites
DarkXero    2892

I didn't read that you already had another hauntable component. My bad.

Basically want you want is a portable sometimes-breakable touchstone item?

Share this post


Link to post
Share on other sites
DarkXero    2892

local function onhaunt(inst)

inst.components.resurrector.active = true

inst.SoundEmitter:PlaySound("dontstarve/common/resurrectionstone_activate")

if math.random() <= 0.8 then

inst:Remove()

end

end

Share this post


Link to post
Share on other sites
DarkXero    2892

@DarkXero, I tried it about 10 times and it never broke. 

 

You are missing something:

    inst:AddComponent("hauntable")    inst.components.hauntable:SetHauntValue(TUNING.HAUNT_INSTANT_REZ)    inst.components.hauntable:SetOnHauntFn(onhaunt)

And you may want to replace 0.8 with 0.2 or it will break often.

Edited by DarkXero

Share this post


Link to post
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
Sign in to follow this