Jump to content

Random/Dynamic inspect sentence?


QuickShot010

Recommended Posts

Is this for all items, or just one item in particular? A custom item perhaps? Writing 20 descriptions for each item be taxing :p. Or is it he will say one of 20 things regardless of what the item actually is? Some more details would be helpful.

 

For a single custom item, I'd suggest using the GetStatus function (its part of the inspectable component). See the compass or heat stone prefab to see it in action. Then in Drok's prefab, include a GetStatus function and just get it to return a random integer between 1 and 20 as a string. Then label each of Drok's descriptions in his speech file with numbers between one and twenty (for an example, see wilson's speech file to see how it handles the compass or heat stone descriptions depending on its status).

Link to comment
Share on other sites

Is this for all items, or just one item in particular? A custom item perhaps? Writing 20 descriptions for each item be taxing :razz:. Or is it he will say one of 20 things regardless of what the item actually is? Some more details would be helpful.

 

For a single custom item, I'd suggest using the GetStatus function (its part of the inspectable component). See the compass or heat stone prefab to see it in action. Then in Drok's prefab, include a GetStatus function and just get it to return a random integer between 1 and 20 as a string. Then label each of Drok's descriptions in his speech file with numbers between one and twenty (for an example, see wilson's speech file to see how it handles the compass or heat stone descriptions depending on its status).

 

No, it's not for all items. But it's for one custom item. 

I'll check the heat stone prefab for some inspiration!

 

But i'm not sure if this is going to work because the item doesn't have stages like the heat stone (cold, normal, warm [...])

 

But i'll let you know if i need more help!

Thanks a lot! :D

Link to comment
Share on other sites

But i'm not sure if this is going to work because the item doesn't have stages like the heat stone (cold, normal, warm [...])

 

But that's the beauty of it, you don't need to use "cold", "hot" etc, you can replace these names with strings consisting of numbers, "1", "2", "3" , as many as you like ;) So long as the  GetStatus function returns a string, its happy. 

 

Eg.

 

local function GetStatus()

 

local n = math.random(1,20)

 

n = tostring(n)

 

return n

 

end

Link to comment
Share on other sites

But that's the beauty of it, you don't need to use "cold", "hot" etc, you can replace these names with strings consisting of numbers, "1", "2", "3" , as many as you like ;) So long as the  GetStatus function returns a string, its happy. 

 

Eg.

 

local function GetStatus()

 

local n = math.random(1,20)

 

n = tostring(n)

 

return n

 

end

 

mm okay, so i the mod won't load when i do this...

 

This is my lua file for the object i want described:

 

local Assets ={	Asset("ANIM", "anim/wigstan.zip"),    Asset("ATLAS", "images/inventoryimages/wigstan.xml"),    Asset("IMAGE", "minimap/wigstan.tex"),    Asset("ATLAS", "minimap/wigstan.xml"),}local function GetStatus()    local n = math.random(1,20)    n = tostring(n)    return n endlocal function fn(Sim)	local inst = CreateEntity()	inst.entity:AddTransform()    local minimap = inst.entity:AddMiniMapEntity()    minimap:SetIcon( "wigstan.tex" )	inst.entity:AddAnimState()    MakeInventoryPhysics(inst)        inst.AnimState:SetBank("wigstan")    inst.AnimState:SetBuild("wigstan")    inst.AnimState:PlayAnimation("idle", true)        inst:AddComponent("inventoryitem")	inst.components.inventoryitem.atlasname = "images/inventoryimages/wigstan.xml"    inst.components.inventoryitem.imagename = "wigstan"	inst:AddComponent("inspectable")    inst.components.inspectable.getstatus = GetStatus        inst:AddComponent("sanityaura")    inst.components.sanityaura.aura = TUNING.SANITYAURA_TINY    return instendSTRINGS.NAMES.WIGSTAN = "Wigstan"--STRINGS.CHARACTERS.GENERIC.DESCRIBE.WIGSTAN = "Drok friend."return Prefab( "common/inventory/wigstan", fn, Assets)

 

and this is a part of the speech lua for the character:

 

DESCRIBE ={		WIGSTAN =		{		    1 = "1",		    2 = "2",		    3 = "3",		    4 = "4",		    5 = "5",		    6 = "6",		    7 = "7",		    8 = "8",		    9 = "9",		    10 = "10",		    11 = "11",		    12 = "12",		    13 = "13",		    14 = "14",		    15 = "15",		    16 = "16",		    17 = "17",		    18 = "18",		    19 = "19",		    20 = "20",		},(LOTS of other stuff)

 

any idea what i'm doing wrong?

thanks!

 

EDIT:

This is my log file:

Starting upDon't Starve: 110570 WIN32_STEAMBuild Date: 2014-09-11_10-12-49THREAD - started 'GAClient' (3896)HttpClient::ClientThread::Main()cGame::InitializeOnMainThreadWindowManager::InitializeWindowManager::SetFullscreen(0, 1920, 1080, 60)GLInfo~~~~~~GL_VENDOR: Google Inc.GL_RENDERER: ANGLE (NVIDIA GeForce GTX 660)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_textureGL_ANGLE_framebuffer_blitGL_ANGLE_framebuffer_multisampleGL_ANGLE_instanced_arraysGL_ANGLE_pack_reverse_row_orderGL_ANGLE_texture_compression_dxt3GL_ANGLE_texture_compression_dxt5GL_ANGLE_texture_usageGL_ANGLE_translated_shader_sourceGL_EXT_read_format_bgraGL_EXT_robustnessGL_EXT_texture_compression_dxt1GL_EXT_texture_format_BGRA8888GL_EXT_texture_storageGL_OES_get_program_binaryGL_OES_packed_depth_stencilGL_OES_rgb8_rgba8GL_OES_standard_derivativesGL_OES_texture_npotTHREAD - started 'WindowsInputManager' (2764)GL_MAX_TEXTURE_SIZE = 16384GL_MAX_TEXTURE_IMAGE_UNITS = 16GL_MAX_RENDERBUFFER_SIZE = 16384GL_MAX_VIEWPORT_DIMS = 16384, 16384GL_MAX_VARYING_VECTORS = 10GL_MAX_VERTEX_ATTRIBS = 16GL_MAX_VERTEX_UNIFORM_VECTORS = 254GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 4GL_MAX_FRAGMENT_UNIFORM_VECTORS = 2214 compressed texture formatstexture format 0x83f0texture format 0x83f1texture format 0x83f2texture format 0x83f3cDontStarveGame::DoGameSpecificInitialize()cGame::StartPlayingLOADING LUADoLuaFile scripts/main.luaDoLuaFile loading buffer scripts/main.luascripts/main.lua(161,1) running main.lua	scripts/modindex.lua(311,1) loaded modindex	scripts/modindex.lua(75,1) ModIndex: Beginning normal load sequence.	LOADING LUA SUCCESSscripts/playerdeaths.lua(74,1) PlayerDeaths could not load morgue	scripts/playerprofile.lua(477,1) loaded profile	scripts/playerprofile.lua(541,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	scripts/gamelogic.lua(133,1) 	Load FE	HttpClientWriteCallback (0x06795EC7, 1, 16, 0x0697F70C)HttpClientWriteCallback READ 16 (16 total)scripts/gamelogic.lua(135,1) 	Load FE: done	scripts/screens/mainscreen.lua(575,1) platform_motd	table: 0F422940	SimLuaProxy::QueryServer()scripts/modindex.lua(85,1) ModIndex: Load sequence finished successfully.	Reset() returningQueryServerComplete no callbackHttpClientWriteCallback (0x06795EC7, 1, 16, 0x0697F70C)HttpClientWriteCallback READ 16 (16 total)QueryServerComplete no callbackQueryStats: { "req":"modrank", "field":"Session.Loads.Mods.list", "fieldop":"unwind", "linkpref":"external", "limit": 20}GetCachedUGCCount 0EnumerateUserSubscribedFiles(0)OnEnumerateUserSubscribedFilesResult    EResult 1, results 0/0Enum complete. Found 0 mods.DeleteUnsubscribedFiles [../mods]FindDirectoriesMatching [../mods/workshop-*]SteamWorkshop::CompleteCallback (success, Refreshing mods complete. None found.) setSimLuaProxy::OnUpdateWorkshopModsComplete(ok., Refreshing mods complete. None found.)scripts/screens/modsscreen.lua(888,1) Reloading Mod Info Prefabs	scripts/screens/modsscreen.lua(875,1) Loading Mod Info Prefabs	scripts/screens/modsscreen.lua(880,1) Unloading Mod Info Prefabs	HttpClientWriteCallback (0x06795E24, 1, 1007, 0x0697F70C)HttpClientWriteCallback READ 1007 (1007 total)scripts/screens/mainscreen.lua(575,1) platform_motd	table: 0D838850	HttpClientWriteCallback (0x06795EC9, 1, 2343, 0x0697F70C)HttpClientWriteCallback READ 2343 (2343 total)scripts/screens/modsscreen.lua(880,1) Unloading Mod Info Prefabs	Collecting garbage...lua_gc took 0.01 seconds~SimLuaProxy()lua_close took 0.01 secondsReleaseAllReleaseAll FinishedcGame::StartPlayingLOADING LUADoLuaFile scripts/main.luaDoLuaFile loading buffer scripts/main.luascripts/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_Drok	scripts/mods.lua(152,1) Loading mod: Drok	scripts/mods.lua(179,1) Mod: Drok	Loading modworldgenmain.lua	scripts/mods.lua(187,1) Mod: Drok	  Mod had no modworldgenmain.lua. Skipping.	scripts/mods.lua(179,1) Mod: Drok	Loading modmain.lua	LOADING LUA SUCCESSscripts/playerdeaths.lua(74,1) PlayerDeaths could not load morgue	scripts/playerprofile.lua(477,1) loaded profile	scripts/playerprofile.lua(541,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(112,1) 	FE assets already loaded	scripts/mods.lua(269,1) Mod: Drok	Registering prefabs	scripts/mods.lua(275,1) Mod: Drok	  Registering prefab file: prefabs/drok	scripts/mods.lua(17,1) error calling LoadPrefabFile in mod Drok: error loading module 'speech_drok' from file '..\mods\Drok\scripts\speech_drok.lua':	..\mods\Drok\scripts\speech_drok.lua:90: '}' expected (to close '{' at line 89) near '='LUA ERROR stack traceback:        =[C] ?        =[C] in function 'require'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/../mods/Drok/scripts/prefabs/drok.lua(105,1) in function 'fn'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/mainfunctions.lua(73,1)        =(tail call) ?        =[C] in function 'xpcall'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/mods.lua(15,1)        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/mods.lua(276,1) in function 'RegisterPrefabs'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(116,1) in function 'LoadAssets'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1143,1) in function 'DoResetAction'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1158,1) in function 'complete_callback'	...        =[C] in function 'GetPersistentString'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(91,1) in function 'Load'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1179,1) in function 'callback'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/playerprofile.lua(571,1) in function 'Set'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/playerprofile.lua(455,1)        =[C] in function 'GetPersistentString'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/playerprofile.lua(453,1) in function 'Load'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1178,1) in main chunk        =[C] in function 'require'        C:/Users/Lorenzo/Games/Steam/steamapps/common/dont_starve/data/scripts/mainfunctions.lua(651,1)	scripts/mods.lua(226,1) Disabling Drok because it had an error.	scripts/frontend.lua(723,1) SCRIPT ERROR! Showing error screen	scripts/mods.lua(275,1) Mod: Drok	  Registering prefab file: prefabs/wigstan	scripts/mods.lua(279,1) Mod: Drok	    wigstan	scripts/mods.lua(275,1) Mod: Drok	  Registering prefab file: prefabs/wigstanfull	scripts/mods.lua(279,1) Mod: Drok	    wigstanfull	scripts/mods.lua(275,1) Mod: Drok	  Registering prefab file: prefabs/wigstanstone	scripts/mods.lua(279,1) Mod: Drok	    wigstanstone	scripts/mods.lua(292,1) Mod: Drok	  Registering default mod prefab	scripts/screens/mainscreen.lua(575,1) platform_motd	table: 0F7B45E0	SimLuaProxy::QueryServer()scripts/modindex.lua(85,1) ModIndex: Load sequence finished successfully.	Reset() returning../mods/Drok/images/saveslot_portraits/drok.tex is 120x104 but compressed textures must have power of 2 dimensions.../mods/Drok/images/selectscreen_portraits/drok.tex is 188x284 but compressed textures must have power of 2 dimensions.../mods/Drok/images/selectscreen_portraits/drok_silho.tex is 188x284 but compressed textures must have power of 2 dimensions.HttpClientWriteCallback (0x06795EC7, 1, 16, 0x0697F70C)HttpClientWriteCallback READ 16 (16 total)QueryServerComplete no callbackHttpClientWriteCallback (0x06795E24, 1, 1007, 0x0697F70C)HttpClientWriteCallback READ 1007 (1007 total)scripts/screens/mainscreen.lua(575,1) platform_motd	table: 0F7B4B58	Could not unload undefined prefab 0x350a87f2 (note)Could not unload undefined prefab 0x350a87f2 (note)Could not unload undefined prefab 0x350a87f2 (note)scripts/mods.lua(304,1) unloading prefabs for mod MOD_Drok	Collecting garbage...lua_gc took 0.01 seconds~SimLuaProxy()lua_close took 0.01 secondsCould not unload undefined prefab 0x350a87f2 (note)Could not unload undefined prefab 0x350a87f2 (note)Could not unload undefined prefab 0x350a87f2 (note)Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. HttpClient::ClientThread::Main() completeShutting down 

Link to comment
Share on other sites

mm okay, so i the mod won't load when i do this...

 

This is my lua file for the object i want described:

 

and this is a part of the speech lua for the character:

 

any idea what i'm doing wrong?

thanks!

 

EDIT:

This is my log file:

 

Try to use ONE = "1", TWO = "2", and so on.

Link to comment
Share on other sites

Try to use ONE = "1", TWO = "2", and so on.

 

Did this, first i changed the 1, 2 and so on in the speech lua and tried.

No crash, but my character said: "it's a thing".

 

Second i tried to change the prefab lua to this:

local function GetStatus()    local n = math.random(ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,TEN,ELEVEN,TWELVE,THIRTEEN,FOURTEEN,FIFTEEN,SIXTEEN,SEVENTEEN,EIGHTEEN,NINETEEN,TWENTY)    n = tostring(n)    return n end

No crash at startup but when i tried to ispect i got a crash:

 

post-447131-0-40542900-1411049912_thumb.

 

any ideas?

Link to comment
Share on other sites

Did this, first i changed the 1, 2 and so on in the speech lua and tried.

No crash, but my character said: "it's a thing".

 

Second i tried to change the prefab lua to this:

 

No crash at startup but when i tried to ispect i got a crash:

 

any ideas?

math.random only takes number. Here's my suggestion (make a table with the states("ONE", etc.) and pick a random one from that table, then return that one):

local nums = {"ONE", "TWO", "THREE", "and so on"}local function GetStatus()    return nums[math.random(#nums)] --the "#nums" means "as many as there are in 'nums'"end
Link to comment
Share on other sites

 

math.random only takes number. Here's my suggestion (make a table with the states("ONE", etc.) and pick a random one from that table, then return that one):

local nums = {"ONE", "TWO", "THREE", "and so on"}local function GetStatus()    return nums[math.random(#nums)] --the "#nums" means "as many as there are in 'nums'"end

 

Got it working, thanks alot mate! :D

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