Jump to content

Help with an item with areas of effect when left on the ground


Recommended Posts

Hey guys! So, I've been trying my hand on this mod that creates different types of areas of effect when dropped on the ground. 

Intended effect as of the moment: Spawns flowers in a small radius around it. 

 

But the thing is, for this particular item, I tried toying around with its prefab.lua and these were the following results:

1.) The item was doing its effect even when it wasn't placed on the ground.

2.) The item wasn't initially doing its effect, upon ground placement, effect fired but kept doing so.

3 and current iteration.) Not doing its effect at all.

 

 

These were the following topics that I used as reference in developing this mod: 

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

File attachments:

 

flutterfly.lua

Edited by Aelia
Link to comment
Share on other sites

So, first of all, to trigger the effect you should put the "flutter" function call inside the "local function OnDropped(inst)" function, so it will trigger onDropped.

Second, it will start and won't stop since it doesnt have any "escape gate", if you want to make it trigger only once you could change the "DoPeriodicTask' to "DoTaskInTime" that will trigger only once, or create some "escape gate" inside the "flutter" function to disable after X executes.

Link to comment
Share on other sites

5 minutes ago, caioketo said:

So, first of all, to trigger the effect you should put the "flutter" function call inside the "local function OnDropped(inst)" function, so it will trigger onDropped.

Second, it will start and won't stop since it doesnt have any "escape gate", if you want to make it trigger only once you could change the "DoPeriodicTask' to "DoTaskInTime" that will trigger only once, or create some "escape gate" inside the "flutter" function to disable after X executes.

 

Thanks for the extremely quick reply! I'll go and do those now and will update you on the results! 

@caioketo

 

Alright! I did as you advised and it seemed to start firing again when I removed the flutter function and started with the DoPeriodicTask trigger but it's a repeat of scenario 2 wherein it didn't stop firing, although it was intended to fire more than once, it should cease to produce flowers when put inside the inventory though, is there anyway to create that scenario?

 

Current iteration:

flutterfly.lua

Link to comment
Share on other sites

Updated the iterations and tested a lot of coding, none are still producing the expected results

 

Current Iteration (Flowers do not spawn at all):

flutterfly.lua

 

Previous try (Crashed, error: function argument expected near "=" on the ' inst.flowerpower = inst.DoPeriodicTask (2, flutter) ' line

File for previous try 

flutterfly.lua

Edited by Aelia
Link to comment
Share on other sites

If you succeed on firing it when dropped, you could listen for the pick event to stop the "firing".

I'm not sure about the function you will have to call to stop the task, but I'm pretty sure this would be the best aproach, listening for the event of picking item, and if it matches it stop the task.

Link to comment
Share on other sites

I tried to use a onpickfn on him but I have no idea how to call out the flower spawning function. When I tried to assign a variable, I got an error:

[00:00:00]: 
System Memory:
	Memory Load: 57%
	Available Physical Memory: 1206m/2858m
	Available Page File: 2961m/5714m
	Available Virtual Memory: 2465m/2559m
	Available Extended Virtual Memory: 0m
[00:00:00]: 
Process Memory:
	Peak Working Set Size: 26m
	Working Set Size: 25m
	Quota Peak Page Pool Usage: 178k
	Quota Page Pool Usage: 173k
	Quota Peak Non Paged Pool Usage:7k
	Quota Non Paged Pool Usage: 6k
	Page File Usage: 4m
	Peak Page File Usage: 5m
[00:00:00]: PersistRootStorage is now APP:Klei//DoNotStarveTogether/ 
[00:00:00]: Starting Up
[00:00:00]: Version: 248955
[00:00:00]: Current time: Mon Jan 08 14:46:36 2018

[00:00:00]: Don't Starve Together: 248955 WIN32_STEAM
[00:00:00]: Build Date: 2621
[00:00:00]: Parsing command line
[00:00:00]: Command Line Arguments: 
[00:00:00]: Initializing distribution platform
[00:00:00]: Initializing Minidump handler
[00:00:00]: ....Done
[00:00:00]: Steam AppBuildID: 2410564
[00:00:00]: ....Done
[00:00:00]: Fixing DPI
[00:00:00]: ...Done
[00:00:00]: THREAD - started 'GAClient' (2472)
[00:00:00]: CurlRequestManager::ClientThread::Main()
[00:00:00]: Mounting file system databundles/shaders.zip successful.
[00:00:00]: Mounting file system databundles/fonts.zip successful.
[00:00:00]: Mounting file system databundles/anim_dynamic.zip successful.
[00:00:00]: Mounting file system databundles/bigportraits.zip successful.
[00:00:00]: Mounting file system databundles/images.zip successful.
[00:00:00]: Mounting file system databundles/scripts.zip successful.
[00:00:04]: ProfileIndex:6.11
[00:00:04]: [Connect] PendingConnection::Reset(true)
[00:00:04]: Network tick rate: U=15(2), D=0
[00:00:04]: Authorized application D:\Steam\steamapps\common\Don't Starve Together\bin\dontstarve_steam.exe is enabled in the firewall.
[00:00:04]: WindowsFirewall - Application already authorized
[00:00:04]: THREAD - started 'StreamInput' (4464)
[00:00:04]: loaded ping_cache
[00:00:04]: Offline user ID: OU_76561198203855285
[00:00:04]: SteamID: 76561198203855285
[00:00:04]: HardwareStats:
  OS                        
    name                      Microsoft Windows 7 Ultimate 
    version                   6.1.7600
    architecture              32-bit
    platformSpecific          SP 0.0
  CPU                       
    numCores                  2
    features                  SSE,SSE2,SSE3,SSSE3,SSE41,SSE42,AVX
    name                      Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
    manufacturer              GenuineIntel
    clockSpeed                2301
  RAM                       
    megsOfRam                 4096
  GPU                       
    name                      Intel(R) HD Graphics 3000
    driverDate                20131031000000.000000-000
    megsOfRam                 1365
    refreshRate               60
    videoModeDescription      1366 x 768 x 4294967296 colors
    driverVersion             9.17.10.3347

[00:00:04]: cGame::InitializeOnMainThread
[00:00:04]: WindowManager::Initialize
[00:00:04]: CreateWindow: Requesting 1366,706 - 5/6/5 - -1/-1/-1 - 0
[00:00:04]: CreateEGLContext: 16 configs found
[00:00:04]:      0: 8/8/8 -  0/ 0/ 0 - 0
[00:00:04]:      1: 8/8/8 -  0/16/ 0 - 0
[00:00:04]:      2: 8/8/8 -  0/24/ 0 - 0
[00:00:04]:      3: 8/8/8 -  0/24/ 8 - 0
[00:00:04]:      4: 5/5/5 -  0/ 0/ 0 - 0
[00:00:04]:      5: 5/5/5 -  1/ 0/ 0 - 0
[00:00:04]:      6: 5/5/5 -  0/16/ 0 - 0
[00:00:04]:      7: 5/5/5 -  1/16/ 0 - 0
[00:00:04]:      8: 5/5/5 -  0/24/ 0 - 0
[00:00:04]:      9: 5/5/5 -  1/24/ 0 - 0
[00:00:04]:     10: 5/5/5 -  0/24/ 8 - 0
[00:00:04]:     11: 5/5/5 -  1/24/ 8 - 0
[00:00:04]:     12: 8/8/8 -  8/ 0/ 0 - 0
[00:00:04]:     13: 8/8/8 -  8/16/ 0 - 0
[00:00:04]:     14: 8/8/8 -  8/24/ 0 - 0
[00:00:04]:     15: 8/8/8 -  8/24/ 8 - 0
[00:00:04]: RestoreWindowPosition
[00:00:04]:    Saved Client Pos (8 x 54)
[00:00:04]:    Adjusted Window Pos (0 x 24)
[00:00:04]: EnsureWindowOnScreen
[00:00:04]:    All good.
[00:00:04]: GLInfo
[00:00:04]: ~~~~~~
[00:00:04]: GL_VENDOR: Google Inc.
[00:00:04]: GL_RENDERER: ANGLE (Intel(R) HD Graphics 3000)
[00:00:04]: GL_VERSION: OpenGL ES 2.0 (ANGLE 1.0.0.2249)
[00:00:04]: GL_SHADING_LANGUAGE_VERSION: OpenGL ES GLSL ES 1.00 (ANGLE 1.0.0.2249)
[00:00:04]: THREAD - started 'WindowsInputManager' (7584)
[00:00:04]: OpenGL extensions (19, 19):
[00:00:04]: GL_ANGLE_depth_texture
[00:00:04]: GL_ANGLE_framebuffer_blit
[00:00:04]: GL_ANGLE_framebuffer_multisample
[00:00:04]: GL_ANGLE_instanced_arrays
[00:00:04]: GL_ANGLE_pack_reverse_row_order
[00:00:04]: GL_ANGLE_texture_compression_dxt3
[00:00:04]: GL_ANGLE_texture_compression_dxt5
[00:00:04]: GL_ANGLE_texture_usage
[00:00:04]: GL_ANGLE_translated_shader_source
[00:00:04]: GL_EXT_read_format_bgra
[00:00:04]: GL_EXT_robustness
[00:00:04]: GL_EXT_texture_compression_dxt1
[00:00:04]: GL_EXT_texture_format_BGRA8888
[00:00:04]: GL_EXT_texture_storage
[00:00:04]: GL_OES_get_program_binary
[00:00:04]: GL_OES_packed_depth_stencil
[00:00:04]: GL_OES_rgb8_rgba8
[00:00:04]: GL_OES_standard_derivatives
[00:00:04]: GL_OES_texture_npot
[00:00:04]: GL_MAX_TEXTURE_SIZE = 8192
[00:00:04]: GL_MAX_TEXTURE_IMAGE_UNITS = 16
[00:00:04]: GL_MAX_RENDERBUFFER_SIZE = 8192
[00:00:04]: GL_MAX_VIEWPORT_DIMS = 8192, 8192
[00:00:04]: GL_MAX_VARYING_VECTORS = 10
[00:00:04]: GL_MAX_VERTEX_ATTRIBS = 16
[00:00:04]: GL_MAX_VERTEX_UNIFORM_VECTORS = 254
[00:00:04]: GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 4
[00:00:04]: GL_MAX_FRAGMENT_UNIFORM_VECTORS = 221
[00:00:04]: 4 compressed texture formats
[00:00:04]: texture format 0x83f0
[00:00:04]: texture format 0x83f1
[00:00:04]: texture format 0x83f2
[00:00:04]: texture format 0x83f3
[00:00:05]: Renderer initialize: Okay
[00:00:05]: AnimManager initialize: Okay
[00:00:05]: Buffers initialize: Okay
[00:00:06]: cDontStarveGame::DoGameSpecificInitialize()
[00:00:06]: GameSpecific initialize: Okay
[00:00:06]: cGame::StartPlaying
[00:00:06]: LOADING LUA
[00:00:06]: DoLuaFile scripts/main.lua
[00:00:06]: DoLuaFile loading buffer scripts/main.lua
[00:00:06]:   taskgrouplist:	default	Together	
[00:00:06]:   taskgrouplist:	classic	Classic	
[00:00:06]:   taskgrouplist:	cave_default	Underground	
[00:00:06]:   taskgrouplist:	lavaarena_taskset	The Forge	
[00:00:06]: running main.lua
	
[00:00:06]: loaded modindex	
[00:00:06]: ModIndex: Beginning normal load sequence.
	
[00:00:11]: LOADING LUA SUCCESS
[00:00:11]: PlayerDeaths loaded morgue	5719	
[00:00:11]: PlayerHistory loaded player_history	2020	
[00:00:11]: bloom_enabled	false	
[00:00:11]: loaded saveindex	
[00:00:11]: OnFilesLoaded()	
[00:00:11]: OnUpdatePurchaseStateComplete	
[00:00:16]: 	Load FE	
[00:00:21]: 	Load FE: done	
[00:00:21]: THREAD - started 'FilesExistAsyncThread' (7124)
[00:00:21]: FilesExistAsyncThread started (13210 files)...
[00:00:21]: OnLoadPermissionList: APP:Klei//DoNotStarveTogether/client_save/blocklist.txt (Success)
[00:00:21]: OnLoadPermissionList: APP:Klei//DoNotStarveTogether/client_save/adminlist.txt (Failure)
[00:00:21]: OnLoadUserIdList: APP:Klei//DoNotStarveTogether/client_save/whitelist.txt (Failure)
[00:00:21]: ModIndex: Load sequence finished successfully.	
[00:00:21]: Reset() returning
[00:00:24]: [Steam] Auth Session Ticket requested...
[00:00:24]: [Steam] Got Auth Session Ticket
[00:00:25]: SimLuaProxy::QueryServer()
[00:00:26]: QueryStats: { "req":"modrank", "field":"Session.Loads.Mods.list", "fieldop":"unwind", "linkpref":"external", "limit": 20}
[00:00:26]: Frontend-Unloading mod 'all'.	
[00:00:26]: FrontendLoadMod	William	
[00:00:26]: Could not load mod_config_data/modconfiguration_William	
[00:00:26]: Fontend-Loading mod: William (a.William) Version:0.2	
[00:00:26]: Mod: William (a.William)	Loading modworldgenmain.lua	
[00:00:26]: Mod: William (a.William)	  Mod had no modworldgenmain.lua. Skipping.	
[00:00:32]: Could not load mod_config_data/modconfiguration_William	
[00:00:32]: Network tick rate: U=15(2), D=0
[00:00:32]: ModWorkshop::CancelDownloads clearing all unfinished downloads
[00:00:32]: About to start a server with the following settings:
[00:00:32]:   Dedicated: false
[00:00:32]:   Online: false
[00:00:32]:   Passworded: false
[00:00:32]:   ServerPort: 10999
[00:00:32]:   SteamAuthPort: 8766
[00:00:32]:   SteamMasterServerPort: 27016
[00:00:32]:   ClanID: false
[00:00:32]:   ClanOnly: false
[00:00:32]:   ClanAdmin: false
[00:00:32]:   LanOnly: true
[00:00:32]:   FriendsOnly: false
[00:00:32]:   EnableAutosaver: true
[00:00:32]:   EncodeUserPath: true
[00:00:32]:   PVP: false
[00:00:32]:   MaxPlayers: 6
[00:00:32]:   GameMode: survival
[00:00:32]:   OverridenDNS: 
[00:00:32]:   PauseWhenEmpty: true
[00:00:32]:   IdleTimeout: 1800s
[00:00:32]:   VoteEnabled: false
[00:00:32]:   InternetBroadcasting: true
[00:00:32]:   Intent: cooperative
[00:00:32]: [Warning] Could not confirm port 10999 is open in the firewall. 
[00:00:32]: Could not load mod_config_data/modconfiguration_William	
[00:00:32]: Lan Server Started on port: 10999
[00:00:32]: Collecting garbage...
[00:00:32]: lua_gc took 0.03 seconds
[00:00:32]: ~ShardLuaProxy()
[00:00:32]: ~ItemServerLuaProxy()
[00:00:32]: ~InventoryLuaProxy()
[00:00:32]: ~NetworkLuaProxy()
[00:00:32]: ~SimLuaProxy()
[00:00:32]: Cancelling LuaQueryCallback handle [6]
[00:00:32]: ModWorkshop::CancelDownloads clearing all unfinished downloads
[00:00:32]: FilesExistAsyncThread aborted.
[00:00:32]: ... FilesExistAsyncThread complete
[00:00:32]: lua_close took 0.26 seconds
[00:00:32]: ReleaseAll
[00:00:32]: ReleaseAll Finished
[00:00:32]: cGame::StartPlaying
[00:00:32]: LOADING LUA
[00:00:32]: DoLuaFile scripts/main.lua
[00:00:32]: DoLuaFile loading buffer scripts/main.lua
[00:00:33]:   taskgrouplist:	default	Together	
[00:00:33]:   taskgrouplist:	classic	Classic	
[00:00:33]:   taskgrouplist:	cave_default	Underground	
[00:00:33]:   taskgrouplist:	lavaarena_taskset	The Forge	
[00:00:33]: running main.lua
	
[00:00:33]: loaded modindex	
[00:00:33]: ModIndex: Beginning normal load sequence.
	
[00:00:33]: ModIndex:GetModsToLoad inserting moddir, 	William	
[00:00:33]: Could not load mod_config_data/modconfiguration_William	
[00:00:33]: Loading mod: William (a.William) Version:0.2	
[00:00:33]: Mod: William (a.William)	Loading modworldgenmain.lua	
[00:00:33]: Mod: William (a.William)	  Mod had no modworldgenmain.lua. Skipping.	
[00:00:33]: Mod: William (a.William)	Loading modmain.lua	
[00:00:33]: Warning: Calling Recipe from a mod is now deprecated. Please call AddRecipe from your modmain.lua file.	
[00:00:33]: Warning: Calling Recipe from a mod is now deprecated. Please call AddRecipe from your modmain.lua file.	
[00:00:33]: LOADING LUA SUCCESS
[00:00:33]: PlayerDeaths loaded morgue	5719	
[00:00:33]: PlayerHistory loaded player_history	2020	
[00:00:33]: bloom_enabled	false	
[00:00:33]: loaded saveindex	
[00:00:33]: OnFilesLoaded()	
[00:00:33]: OnUpdatePurchaseStateComplete	
[00:00:33]: Loading world: session/05DE2C618EE43C8F/0000000002	
[00:00:33]: Save file is at version 4.77	
[00:00:33]: 	Unload FE	
[00:00:33]: 	Unload FE done	
[00:00:35]: Mod: William (a.William)	Registering prefabs	
[00:00:35]: Mod: William (a.William)	  Registering prefab file: prefabs/william	
[00:00:35]: Mod: William (a.William)	    william	
[00:00:35]: Mod: William (a.William)	  Registering prefab file: prefabs/william_none	
[00:00:35]: Mod: William (a.William)	    william_none	
[00:00:35]: Mod: William (a.William)	  Registering prefab file: prefabs/wilbeart	
[00:00:35]: Mod: William (a.William)	    wilbeart	
[00:00:35]: Mod: William (a.William)	  Registering prefab file: prefabs/flutterfly	
[00:00:35]: error calling LoadPrefabFile in mod William (a.William): 
[string "scripts/mainfunctions.lua"]:146: Error loading file prefabs/flutterfly
[string "../mods/William/scripts/prefabs/flutterfly.lua"]:51: function arguments expected near '='
LUA ERROR stack traceback:
        =[C] in function 'assert'
        scripts/mainfunctions.lua(146,1)
        =(tail call) ?
        =[C] in function 'xpcall'
        scripts/mods.lua(158,1)
        scripts/mods.lua(598,1) in function 'RegisterPrefabs'
        scripts/gamelogic.lua(263,1) in function 'LoadAssets'
        scripts/gamelogic.lua(847,1) in function 'cb'
        scripts/saveindex.lua(285,1)
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(267,1) in function 'GetSaveDataFile'
	...
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(250,1) in function 'Load'
        scripts/gamelogic.lua(1039,1) in function 'callback'
        scripts/playerprofile.lua(977,1) in function 'Set'
        scripts/playerprofile.lua(838,1)
        =[C] in function 'GetPersistentString'
        scripts/playerprofile.lua(836,1) in function 'Load'
        scripts/gamelogic.lua(1038,1) in main chunk
        =[C] in function 'require'
        scripts/mainfunctions.lua(873,1)	
[00:00:35]: Disabling William (a.William) because it had an error.	
[00:00:35]: [string "scripts/mainfunctions.lua"]:146: Error loading file prefabs/flutterfly
[string "../mods/William/scripts/prefabs/flutterfly.lua"]:51: function arguments expected near '='
LUA ERROR stack traceback:
        =[C] in function 'assert'
        scripts/mainfunctions.lua(146,1)
        =(tail call) ?
        =[C] in function 'xpcall'
        scripts/mods.lua(158,1)
        scripts/mods.lua(598,1) in function 'RegisterPrefabs'
        scripts/gamelogic.lua(263,1) in function 'LoadAssets'
        scripts/gamelogic.lua(847,1) in function 'cb'
        scripts/saveindex.lua(285,1)
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(267,1) in function 'GetSaveDataFile'
	...
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(250,1) in function 'Load'
        scripts/gamelogic.lua(1039,1) in function 'callback'
        scripts/playerprofile.lua(977,1) in function 'Set'
        scripts/playerprofile.lua(838,1)
        =[C] in function 'GetPersistentString'
        scripts/playerprofile.lua(836,1) in function 'Load'
        scripts/gamelogic.lua(1038,1) in main chunk
        =[C] in function 'require'
        scripts/mainfunctions.lua(873,1)
[00:00:35]: [string "scripts/mainfunctions.lua"]:146: Error loading file prefabs/flutterfly
[string "../mods/William/scripts/prefabs/flutterfly.lua"]:51: function arguments expected near '='
LUA ERROR stack traceback:
        =[C] in function 'assert'
        scripts/mainfunctions.lua(146,1)
        =(tail call) ?
        =[C] in function 'xpcall'
        scripts/mods.lua(158,1)
        scripts/mods.lua(598,1) in function 'RegisterPrefabs'
        scripts/gamelogic.lua(263,1) in function 'LoadAssets'
        scripts/gamelogic.lua(847,1) in function 'cb'
        scripts/saveindex.lua(285,1)
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(267,1) in function 'GetSaveDataFile'
	...
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(250,1) in function 'Load'
        scripts/gamelogic.lua(1039,1) in function 'callback'
        scripts/playerprofile.lua(977,1) in function 'Set'
        scripts/playerprofile.lua(838,1)
        =[C] in function 'GetPersistentString'
        scripts/playerprofile.lua(836,1) in function 'Load'
        scripts/gamelogic.lua(1038,1) in main chunk
        =[C] in function 'require'
        scripts/mainfunctions.lua(873,1)	
[00:00:35]: Mod: William (a.William)	  Registering default mod prefab	
[00:00:38]: Could not preload undefined prefab (flutterfly)
[00:00:38]: 	LOAD BE	
[00:01:14]: Could not preload undefined prefab (flutterfly)
[00:01:21]: 	LOAD BE: done	
[00:01:22]: Begin Session: 05DE2C618EE43C8F
[00:01:22]: saving to server_temp/server_save	
[00:01:24]: MiniMapComponent::AddAtlas( minimap/minimap_data.xml )
[00:01:24]: MiniMapComponent::AddAtlas( ../mods/William/images/map_icons/wilbeart.xml )
[00:01:24]: MiniMapComponent::AddAtlas( ../mods/William/images/map_icons/william.xml )
[00:01:34]: Loading Nav Grid	
[00:01:50]: Reconstructing topology	
[00:01:50]: 	...Sorting points	
[00:01:50]: 	...Sorting edges	
[00:01:50]: 	...Connecting nodes	
[00:01:50]: 	...Validating connections	
[00:01:50]: 	...Housekeeping	
[00:01:50]: 	...Done!	
[00:01:50]: 1 uploads added to server. From server_temp
[00:01:50]: Telling Client our new session identifier: 05DE2C618EE43C8F
[00:01:50]: ModIndex: Load sequence finished successfully.	
[00:01:50]: Reset() returning

 

Still have no idea on how to call out the flower spawning function on my mod item, I checked the pickable.lua on the components folder and only got a few ways to fire the event I want. 

flutterfly.lua

Link to comment
Share on other sites

EDIT:

The way you did should work too, just change "inst:flowerpower = inst:DoPeriodicTask(2, flutter)" to "inst.flowerpower = inst:DoPeriodicTask(2, flutter)".

In lua the ":" is used to call the functions, while "." is used to refer the variables inside inst.

 

 

So, I took a look in the "scheduler.lua" file, which executes the tasks, and inside the entityscript.lua its calling the periodictask like this:

local per = scheduler:ExecutePeriodic(time, fn, nil, initialdelay, self.GUID, self, ...)

And the scheduler has a function to remove all task with the GUID

function Scheduler:KillTasksWithID(id)

So you should be able to call scheduler:KillTasksWithID(inst.GUID) inside the "OnPickup" function, but it will kill all tasks of that specific item, assuming the only task this item does is the spawns, it should work fine.

Edited by caioketo
Link to comment
Share on other sites

Hi again! So I did as you said but I got another error mixed into the equation:

 

[00:00:00]: 
System Memory:
	Memory Load: 48%
	Available Physical Memory: 1467m/2858m
	Available Page File: 3758m/5714m
	Available Virtual Memory: 2465m/2559m
	Available Extended Virtual Memory: 0m
[00:00:00]: 
Process Memory:
	Peak Working Set Size: 26m
	Working Set Size: 26m
	Quota Peak Page Pool Usage: 178k
	Quota Page Pool Usage: 173k
	Quota Peak Non Paged Pool Usage:7k
	Quota Non Paged Pool Usage: 6k
	Page File Usage: 5m
	Peak Page File Usage: 6m
[00:00:00]: PersistRootStorage is now APP:Klei//DoNotStarveTogether/ 
[00:00:00]: Starting Up
[00:00:00]: Version: 248955
[00:00:00]: Current time: Mon Jan 08 19:29:36 2018

[00:00:00]: Don't Starve Together: 248955 WIN32_STEAM
[00:00:00]: Build Date: 2621
[00:00:00]: Parsing command line
[00:00:00]: Command Line Arguments: 
[00:00:00]: Initializing distribution platform
[00:00:00]: Initializing Minidump handler
[00:00:00]: ....Done
[00:00:01]: Steam AppBuildID: 2410564
[00:00:01]: ....Done
[00:00:01]: Fixing DPI
[00:00:01]: ...Done
[00:00:01]: Mounting file system databundles/shaders.zip successful.
[00:00:01]: THREAD - started 'GAClient' (4008)
[00:00:01]: Mounting file system databundles/fonts.zip successful.
[00:00:01]: Mounting file system databundles/anim_dynamic.zip successful.
[00:00:01]: Mounting file system databundles/bigportraits.zip successful.
[00:00:01]: Mounting file system databundles/images.zip successful.
[00:00:01]: Mounting file system databundles/scripts.zip successful.
[00:00:01]: CurlRequestManager::ClientThread::Main()
[00:00:16]: ProfileIndex:5.70
[00:00:16]: [Connect] PendingConnection::Reset(true)
[00:00:16]: Network tick rate: U=15(2), D=0
[00:00:16]: Authorized application D:\Steam\steamapps\common\Don't Starve Together\bin\dontstarve_steam.exe is enabled in the firewall.
[00:00:16]: WindowsFirewall - Application already authorized
[00:00:16]: THREAD - started 'StreamInput' (4544)
[00:00:16]: loaded ping_cache
[00:00:16]: Offline user ID: OU_76561198203855285
[00:00:16]: SteamID: 76561198203855285
[00:00:16]: HardwareStats:
  OS                        
    name                      Microsoft Windows 7 Ultimate 
    version                   6.1.7600
    architecture              32-bit
    platformSpecific          SP 0.0
  CPU                       
    numCores                  2
    features                  SSE,SSE2,SSE3,SSSE3,SSE41,SSE42,AVX
    name                      Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
    manufacturer              GenuineIntel
    clockSpeed                2301
  RAM                       
    megsOfRam                 4096
  GPU                       
    name                      Intel(R) HD Graphics 3000
    driverDate                20131031000000.000000-000
    megsOfRam                 1365
    refreshRate               60
    videoModeDescription      1366 x 768 x 4294967296 colors
    driverVersion             9.17.10.3347

[00:00:16]: cGame::InitializeOnMainThread
[00:00:16]: WindowManager::Initialize
[00:00:16]: CreateWindow: Requesting 1366,706 - 5/6/5 - -1/-1/-1 - 0
[00:00:17]: CreateEGLContext: 16 configs found
[00:00:17]:      0: 8/8/8 -  0/ 0/ 0 - 0
[00:00:17]:      1: 8/8/8 -  0/16/ 0 - 0
[00:00:17]:      2: 8/8/8 -  0/24/ 0 - 0
[00:00:17]:      3: 8/8/8 -  0/24/ 8 - 0
[00:00:17]:      4: 5/5/5 -  0/ 0/ 0 - 0
[00:00:17]:      5: 5/5/5 -  1/ 0/ 0 - 0
[00:00:17]:      6: 5/5/5 -  0/16/ 0 - 0
[00:00:17]:      7: 5/5/5 -  1/16/ 0 - 0
[00:00:17]:      8: 5/5/5 -  0/24/ 0 - 0
[00:00:17]:      9: 5/5/5 -  1/24/ 0 - 0
[00:00:17]:     10: 5/5/5 -  0/24/ 8 - 0
[00:00:17]:     11: 5/5/5 -  1/24/ 8 - 0
[00:00:17]:     12: 8/8/8 -  8/ 0/ 0 - 0
[00:00:17]:     13: 8/8/8 -  8/16/ 0 - 0
[00:00:17]:     14: 8/8/8 -  8/24/ 0 - 0
[00:00:17]:     15: 8/8/8 -  8/24/ 8 - 0
[00:00:17]: RestoreWindowPosition
[00:00:17]:    Saved Client Pos (0 x 22)
[00:00:17]:    Adjusted Window Pos (-8 x -8)
[00:00:17]: EnsureWindowOnScreen
[00:00:17]:    All good.
[00:00:17]: GLInfo
[00:00:17]: ~~~~~~
[00:00:17]: GL_VENDOR: Google Inc.
[00:00:17]: GL_RENDERER: ANGLE (Intel(R) HD Graphics 3000)
[00:00:17]: GL_VERSION: OpenGL ES 2.0 (ANGLE 1.0.0.2249)
[00:00:17]: GL_SHADING_LANGUAGE_VERSION: OpenGL ES GLSL ES 1.00 (ANGLE 1.0.0.2249)
[00:00:17]: THREAD - started 'WindowsInputManager' (5892)
[00:00:17]: OpenGL extensions (19, 19):
[00:00:17]: GL_ANGLE_depth_texture
[00:00:17]: GL_ANGLE_framebuffer_blit
[00:00:17]: GL_ANGLE_framebuffer_multisample
[00:00:17]: GL_ANGLE_instanced_arrays
[00:00:17]: GL_ANGLE_pack_reverse_row_order
[00:00:17]: GL_ANGLE_texture_compression_dxt3
[00:00:17]: GL_ANGLE_texture_compression_dxt5
[00:00:17]: GL_ANGLE_texture_usage
[00:00:17]: GL_ANGLE_translated_shader_source
[00:00:17]: GL_EXT_read_format_bgra
[00:00:17]: GL_EXT_robustness
[00:00:17]: GL_EXT_texture_compression_dxt1
[00:00:17]: GL_EXT_texture_format_BGRA8888
[00:00:17]: GL_EXT_texture_storage
[00:00:17]: GL_OES_get_program_binary
[00:00:17]: GL_OES_packed_depth_stencil
[00:00:17]: GL_OES_rgb8_rgba8
[00:00:17]: GL_OES_standard_derivatives
[00:00:17]: GL_OES_texture_npot
[00:00:18]: GL_MAX_TEXTURE_SIZE = 8192
[00:00:18]: GL_MAX_TEXTURE_IMAGE_UNITS = 16
[00:00:18]: GL_MAX_RENDERBUFFER_SIZE = 8192
[00:00:18]: GL_MAX_VIEWPORT_DIMS = 8192, 8192
[00:00:18]: GL_MAX_VARYING_VECTORS = 10
[00:00:18]: GL_MAX_VERTEX_ATTRIBS = 16
[00:00:18]: GL_MAX_VERTEX_UNIFORM_VECTORS = 254
[00:00:18]: GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 4
[00:00:18]: GL_MAX_FRAGMENT_UNIFORM_VECTORS = 221
[00:00:18]: 4 compressed texture formats
[00:00:18]: texture format 0x83f0
[00:00:18]: texture format 0x83f1
[00:00:18]: texture format 0x83f2
[00:00:18]: texture format 0x83f3
[00:00:18]: Renderer initialize: Okay
[00:00:19]: AnimManager initialize: Okay
[00:00:19]: Buffers initialize: Okay
[00:00:19]: cDontStarveGame::DoGameSpecificInitialize()
[00:00:19]: GameSpecific initialize: Okay
[00:00:19]: 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:20]:   taskgrouplist:	default	Together	
[00:00:20]:   taskgrouplist:	classic	Classic	
[00:00:20]:   taskgrouplist:	cave_default	Underground	
[00:00:20]:   taskgrouplist:	lavaarena_taskset	The Forge	
[00:00:20]: running main.lua
	
[00:00:20]: loaded modindex	
[00:00:20]: WARNING: icon paths for mod workshop-1217265680 (Tord) are not valid. Got icon_atlas="modicon.xml" and icon="modicon.tex".
Please ensure that these point to valid files in your mod folder, or else comment out those lines from your modinfo.lua.	
[00:00:21]: ModIndex: Beginning normal load sequence.
	
[00:00:29]: LOADING LUA SUCCESS
[00:00:29]: PlayerDeaths loaded morgue	5719	
[00:00:29]: PlayerHistory loaded player_history	2020	
[00:00:29]: bloom_enabled	false	
[00:00:30]: loaded saveindex	
[00:00:30]: OnFilesLoaded()	
[00:00:30]: OnUpdatePurchaseStateComplete	
[00:00:35]: 	Load FE	
[00:00:38]: 	Load FE: done	
[00:00:38]: THREAD - started 'FilesExistAsyncThread' (2856)
[00:00:38]: FilesExistAsyncThread started (13210 files)...
[00:00:38]: OnLoadPermissionList: APP:Klei//DoNotStarveTogether/client_save/blocklist.txt (Success)
[00:00:38]: OnLoadPermissionList: APP:Klei//DoNotStarveTogether/client_save/adminlist.txt (Failure)
[00:00:38]: OnLoadUserIdList: APP:Klei//DoNotStarveTogether/client_save/whitelist.txt (Failure)
[00:00:38]: ModIndex: Load sequence finished successfully.	
[00:00:38]: Reset() returning
[00:00:42]: ... FilesExistAsyncThread complete
[00:00:51]: [Steam] Auth Session Ticket requested...
[00:00:52]: [Steam] Got Auth Session Ticket
[00:00:52]: SimLuaProxy::QueryServer()
[00:00:56]: QueryStats: { "req":"modrank", "field":"Session.Loads.Mods.list", "fieldop":"unwind", "linkpref":"external", "limit": 20}
[00:00:56]: Frontend-Unloading mod 'all'.	
[00:00:59]: FrontendLoadMod	William	
[00:00:59]: Could not load mod_config_data/modconfiguration_William	
[00:00:59]: Fontend-Loading mod: William (a.William) Version:0.2	
[00:00:59]: Mod: William (a.William)	Loading modworldgenmain.lua	
[00:00:59]: Mod: William (a.William)	  Mod had no modworldgenmain.lua. Skipping.	
[00:01:06]: Could not load mod_config_data/modconfiguration_William	
[00:01:06]: Network tick rate: U=15(2), D=0
[00:01:06]: ModWorkshop::CancelDownloads clearing all unfinished downloads
[00:01:06]: About to start a server with the following settings:
[00:01:06]:   Dedicated: false
[00:01:06]:   Online: false
[00:01:06]:   Passworded: false
[00:01:06]:   ServerPort: 10999
[00:01:06]:   SteamAuthPort: 8766
[00:01:06]:   SteamMasterServerPort: 27016
[00:01:06]:   ClanID: false
[00:01:06]:   ClanOnly: false
[00:01:06]:   ClanAdmin: false
[00:01:06]:   LanOnly: true
[00:01:06]:   FriendsOnly: false
[00:01:06]:   EnableAutosaver: true
[00:01:06]:   EncodeUserPath: true
[00:01:06]:   PVP: false
[00:01:06]:   MaxPlayers: 6
[00:01:06]:   GameMode: survival
[00:01:06]:   OverridenDNS: 
[00:01:06]:   PauseWhenEmpty: true
[00:01:06]:   IdleTimeout: 1800s
[00:01:06]:   VoteEnabled: false
[00:01:06]:   InternetBroadcasting: true
[00:01:06]:   Intent: cooperative
[00:01:06]: [Warning] Could not confirm port 10999 is open in the firewall. 
[00:01:06]: Could not load mod_config_data/modconfiguration_William	
[00:01:06]: Lan Server Started on port: 10999
[00:01:06]: Collecting garbage...
[00:01:06]: lua_gc took 0.04 seconds
[00:01:06]: ~ShardLuaProxy()
[00:01:06]: ~ItemServerLuaProxy()
[00:01:06]: ~InventoryLuaProxy()
[00:01:06]: ~NetworkLuaProxy()
[00:01:06]: ~SimLuaProxy()
[00:01:06]: Cancelling LuaQueryCallback handle [6]
[00:01:06]: ModWorkshop::CancelDownloads clearing all unfinished downloads
[00:01:06]: lua_close took 0.04 seconds
[00:01:06]: ReleaseAll
[00:01:06]: ReleaseAll Finished
[00:01:06]: cGame::StartPlaying
[00:01:06]: LOADING LUA
[00:01:06]: DoLuaFile scripts/main.lua
[00:01:06]: DoLuaFile loading buffer scripts/main.lua
[00:01:06]:   taskgrouplist:	default	Together	
[00:01:06]:   taskgrouplist:	classic	Classic	
[00:01:06]:   taskgrouplist:	cave_default	Underground	
[00:01:06]:   taskgrouplist:	lavaarena_taskset	The Forge	
[00:01:06]: running main.lua
	
[00:01:06]: loaded modindex	
[00:01:06]: WARNING: icon paths for mod workshop-1217265680 (Tord) are not valid. Got icon_atlas="modicon.xml" and icon="modicon.tex".
Please ensure that these point to valid files in your mod folder, or else comment out those lines from your modinfo.lua.	
[00:01:06]: ModIndex: Beginning normal load sequence.
	
[00:01:07]: ModIndex:GetModsToLoad inserting moddir, 	William	
[00:01:07]: Could not load mod_config_data/modconfiguration_William	
[00:01:07]: Loading mod: William (a.William) Version:0.2	
[00:01:07]: Mod: William (a.William)	Loading modworldgenmain.lua	
[00:01:07]: Mod: William (a.William)	  Mod had no modworldgenmain.lua. Skipping.	
[00:01:07]: Mod: William (a.William)	Loading modmain.lua	
[00:01:07]: Warning: Calling Recipe from a mod is now deprecated. Please call AddRecipe from your modmain.lua file.	
[00:01:07]: Warning: Calling Recipe from a mod is now deprecated. Please call AddRecipe from your modmain.lua file.	
[00:01:07]: LOADING LUA SUCCESS
[00:01:07]: PlayerDeaths loaded morgue	5719	
[00:01:07]: PlayerHistory loaded player_history	2020	
[00:01:07]: bloom_enabled	false	
[00:01:07]: loaded saveindex	
[00:01:07]: OnFilesLoaded()	
[00:01:07]: OnUpdatePurchaseStateComplete	
[00:01:07]: Loading world: session/05DE2C618EE43C8F/0000000002	
[00:01:07]: Save file is at version 4.77	
[00:01:07]: 	Unload FE	
[00:01:07]: 	Unload FE done	
[00:01:09]: Mod: William (a.William)	Registering prefabs	
[00:01:09]: Mod: William (a.William)	  Registering prefab file: prefabs/william	
[00:01:09]: Mod: William (a.William)	    william	
[00:01:09]: Mod: William (a.William)	  Registering prefab file: prefabs/william_none	
[00:01:09]: Mod: William (a.William)	    william_none	
[00:01:09]: Mod: William (a.William)	  Registering prefab file: prefabs/wilbeart	
[00:01:09]: Mod: William (a.William)	    wilbeart	
[00:01:09]: Mod: William (a.William)	  Registering prefab file: prefabs/flutterfly	
[00:01:09]: error calling LoadPrefabFile in mod William (a.William): 
[string "scripts/mainfunctions.lua"]:146: Error loading file prefabs/flutterfly
[string "../mods/William/scripts/prefabs/flutterfly.lua"]:55: cannot use '...' outside a vararg function near '...'
LUA ERROR stack traceback:
        =[C] in function 'assert'
        scripts/mainfunctions.lua(146,1)
        =(tail call) ?
        =[C] in function 'xpcall'
        scripts/mods.lua(158,1)
        scripts/mods.lua(598,1) in function 'RegisterPrefabs'
        scripts/gamelogic.lua(263,1) in function 'LoadAssets'
        scripts/gamelogic.lua(847,1) in function 'cb'
        scripts/saveindex.lua(285,1)
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(267,1) in function 'GetSaveDataFile'
	...
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(250,1) in function 'Load'
        scripts/gamelogic.lua(1039,1) in function 'callback'
        scripts/playerprofile.lua(977,1) in function 'Set'
        scripts/playerprofile.lua(838,1)
        =[C] in function 'GetPersistentString'
        scripts/playerprofile.lua(836,1) in function 'Load'
        scripts/gamelogic.lua(1038,1) in main chunk
        =[C] in function 'require'
        scripts/mainfunctions.lua(873,1)	
[00:01:09]: Disabling William (a.William) because it had an error.	
[00:01:09]: [string "scripts/mainfunctions.lua"]:146: Error loading file prefabs/flutterfly
[string "../mods/William/scripts/prefabs/flutterfly.lua"]:55: cannot use '...' outside a vararg function near '...'
LUA ERROR stack traceback:
        =[C] in function 'assert'
        scripts/mainfunctions.lua(146,1)
        =(tail call) ?
        =[C] in function 'xpcall'
        scripts/mods.lua(158,1)
        scripts/mods.lua(598,1) in function 'RegisterPrefabs'
        scripts/gamelogic.lua(263,1) in function 'LoadAssets'
        scripts/gamelogic.lua(847,1) in function 'cb'
        scripts/saveindex.lua(285,1)
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(267,1) in function 'GetSaveDataFile'
	...
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(250,1) in function 'Load'
        scripts/gamelogic.lua(1039,1) in function 'callback'
        scripts/playerprofile.lua(977,1) in function 'Set'
        scripts/playerprofile.lua(838,1)
        =[C] in function 'GetPersistentString'
        scripts/playerprofile.lua(836,1) in function 'Load'
        scripts/gamelogic.lua(1038,1) in main chunk
        =[C] in function 'require'
        scripts/mainfunctions.lua(873,1)
[00:01:09]: [string "scripts/mainfunctions.lua"]:146: Error loading file prefabs/flutterfly
[string "../mods/William/scripts/prefabs/flutterfly.lua"]:55: cannot use '...' outside a vararg function near '...'
LUA ERROR stack traceback:
        =[C] in function 'assert'
        scripts/mainfunctions.lua(146,1)
        =(tail call) ?
        =[C] in function 'xpcall'
        scripts/mods.lua(158,1)
        scripts/mods.lua(598,1) in function 'RegisterPrefabs'
        scripts/gamelogic.lua(263,1) in function 'LoadAssets'
        scripts/gamelogic.lua(847,1) in function 'cb'
        scripts/saveindex.lua(285,1)
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(267,1) in function 'GetSaveDataFile'
	...
        =[C] in function 'GetPersistentString'
        scripts/saveindex.lua(250,1) in function 'Load'
        scripts/gamelogic.lua(1039,1) in function 'callback'
        scripts/playerprofile.lua(977,1) in function 'Set'
        scripts/playerprofile.lua(838,1)
        =[C] in function 'GetPersistentString'
        scripts/playerprofile.lua(836,1) in function 'Load'
        scripts/gamelogic.lua(1038,1) in main chunk
        =[C] in function 'require'
        scripts/mainfunctions.lua(873,1)	
[00:01:09]: Mod: William (a.William)	  Registering default mod prefab	
[00:01:11]: Could not preload undefined prefab (flutterfly)
[00:01:12]: 	LOAD BE	
[00:01:35]: Could not preload undefined prefab (flutterfly)
[00:01:42]: 	LOAD BE: done	
[00:01:42]: Begin Session: 05DE2C618EE43C8F
[00:01:42]: saving to server_temp/server_save	
[00:01:42]: MiniMapComponent::AddAtlas( minimap/minimap_data.xml )
[00:01:42]: MiniMapComponent::AddAtlas( ../mods/William/images/map_icons/wilbeart.xml )
[00:01:42]: MiniMapComponent::AddAtlas( ../mods/William/images/map_icons/william.xml )
[00:01:43]: Loading Nav Grid	
[00:01:49]: Reconstructing topology	
[00:01:49]: 	...Sorting points	
[00:01:49]: 	...Sorting edges	
[00:01:49]: 	...Connecting nodes	
[00:01:49]: 	...Validating connections	
[00:01:49]: 	...Housekeeping	
[00:01:49]: 	...Done!	
[00:01:49]: 1 uploads added to server. From server_temp
[00:01:49]: Telling Client our new session identifier: 05DE2C618EE43C8F
[00:01:49]: ModIndex: Load sequence finished successfully.	
[00:01:49]: Reset() returning
[00:03:14]: Could not unload undefined prefab (flutterfly)
[00:03:14]: unloading prefabs for mod MOD_William	
[00:03:14]: ModWorkshop::CancelDownloads clearing all unfinished downloads
[00:03:14]: Collecting garbage...
[00:03:14]: lua_gc took 0.09 seconds
[00:03:14]: ~ShardLuaProxy()
[00:03:14]: ~ItemServerLuaProxy()
[00:03:14]: ~InventoryLuaProxy()
[00:03:14]: ~NetworkLuaProxy()
[00:03:14]: ~SimLuaProxy()
[00:03:14]: ModWorkshop::CancelDownloads clearing all unfinished downloads
[00:03:15]: lua_close took 0.21 seconds
[00:03:15]: ModWorkshop::CancelDownloads clearing all unfinished downloads
[00:03:16]: [Steam] Auth ticket cancelled
[00:03:16]:  Manager - ORPHANED UNKNOWN RESOURCES:
[00:03:16]: shaders/ui_yuv.ksh - 1
[00:03:16]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:16]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:16]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:16]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:16]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:16]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:16]: Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 
[00:03:16]: CurlRequestManager::ClientThread::Main() complete
[00:03:16]: HttpClient2 discarded 0 callbacks.
[00:03:17]: Shutting down

 

Is there any way that I can make use of the Flutter function inside the on dropped and the on pick up functions? If so, I have no idea how to cancel the flutter function when the pick up function fires.

 

 

flutterfly.lua

Link to comment
Share on other sites

So basically the error is because you are calling "local per = scheduler:ExecutePeriodic(time, fn, nil, initialdelay, self.GUID, self, ...)" but there is no "..." params in the onPick function.
Anyway, I think if you replace your onPick function with this, it should work:
 

local function OnPickup(inst)
	scheduler:KillTasksWithID(inst.GUID)
end

Not sure if it's nescessary to add require to scheduler, but I think not.

Link to comment
Share on other sites

Good news! I can finally enter the game again! The bad news is it seems to stop spawning the flowers!

So we're a step away from the intended effect!

 

Really, though thank you so much for all your effort!

Edited by Aelia
Link to comment
Share on other sites

2 minutes ago, Aelia said:

Good news! I can finally enter the game again! The bad news is it seems to stop spawning the flowers!

So we're a step away from the intended effect!

 

Really, though thank you so much for all your effort!

It should still spawns flower, since we didnt change the onDrop function. Try to erase the onPick function and see if it start spawning, if so there is a problem there, if it doesnt, send me the code you got so I can check for errors.

I'm glad I can help out ^^

Link to comment
Share on other sites

So, it dont produce flowers, cause you added a parameter called flutter in the OnDrop function "local function OnDropped(inst, flutter)", so when you call the periodictask referencing the "flutter" it references the paramtere one which is probably nil, if you remove the "flutter" from the parameters and let only the inst one, it should work fine. Also you can uncomment the onPick function to test it out since its not whats causing the error.

Link to comment
Share on other sites

13 minutes ago, Aelia said:

That's odd. It seems that it produced the same results as where we started today. Item still produces flowers while in inventory. 

ugh, this is so hard. sorry! 

flutterfly.lua

It's fine, it just means that the

scheduler:KillTasksWithID(inst.GUID)

is not working as intended, if you could put one print before, to print out GUID, just to check if its right, also print the GUID onDrop so we can compare and make sure they are the same. if the onPick GUID is diferent than onDrop, try to change the "inst.GUID" to "self.GUID".

I'll try to look out the best way to stop the task, maybe I can find something better than killtaskswithid.

EDIT: found out another function that should work properly, change the KillTasks call to "inst:KillTasks()" should do the trick

Edited by caioketo
Link to comment
Share on other sites

I tried your most recent suggestion, it still yielded the same results. 

 

Perhaps looking for an alternative way to make use of this item, making it not pickable but destroyable with hammers should offer a similar gameplay fantasy than I wanted it to be. I'll try to do that while also looking out for a way to cancel out the flutter function on pick up event.

Link to comment
Share on other sites

The "inst:KillTasks()" still yields the same results? Would have to print variables to check out what is wrong.

There is a lot of ways to make something like that, but everysingle one you will have to cancel the tasks otherwise it will still spawns flowers after "destroyed".

If you want, post the whole mod folder so I can test it out here and hopefully find the error and fix it ^^

Link to comment
Share on other sites

So I found out whats causing the error, the scheduler KillTask only works on Tasks and not Periodics, since periodics have the Cancel function its not needed.

So I changed to grab the reference to the periodic, and than call cancel when pickedup, already tried that out and its working as intended.
The only file I changed was the flutterfly.lua < here is the fixed version.
Glad I could fix that for you ^^

Link to comment
Share on other sites

1 minute ago, Aelia said:

Just tested it out and it worked as intended, yes!

 

Oh my god! Thank you so much for the help! I would never figured this out on my own!

No problem, i'm glad that i'm helping.

I want to see more "usefull" mods on this game, as I'm developing one my own, I try to help out whoever I can too, luckly we can make a good community here!

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