wlayton27

  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral

About wlayton27

  • Rank
    Junior Member
...

Recent Profile Visitors

389 profile views
  1. At least we're on the same page now. Sorry about my cross-eyed code analyzing; going on a 70+ hour work week. I'd be more than happy to take the back seat on this mod if anybody likes the idea and wants to run with it themselves. It looks like the script will be about 1000 lines long, but it should be doable. I'm thinking the GLOBAL.TUNING variables can be abandoned altogether: --partial script to show example of TUNING.WILSON_HUNGER_RATE by itselffunction dayspeed(l_minutes) l_minutes = l_minutes or 24 --[[setting default to 24 minute day to reduce confusion with "Take Your Time" mod --]] local seg_time = l_minutes * 30 / 8 --[[ if set to game default (8 minutes), seg_time should be 30 seconds --]] --juicy bits follow; need to add an "if" statement to check player character is Wilson GetPlayer().components.hunger:SetRate(75 / seg_time / 16) -- drop 75 hunger per 16 segs (day)end What I like about this mod is the ability to speed up the game time rate rather than slow it down (hence the name "Speeder Upper"). It's worth trying out the "Take Your Time" mod attached below and setting the "l_minutes" (on line 9) from "24" to "4" just to see what the game is like at double time. I made it to day 24 before dying spectacularly (no hunger, no health, no sanity, no snivel gear in the dark of winter, no fuel for the campfire, and music-box hands coming for me). It really does add a new element of replayability to an already exhilarating game. Cheers. Take your time b111.zip
  2. Thanks for that Squeek. It solved the c_test( ) function at least, but unfortunately did it in such a way that doesn't work as a template for the c_dayspeed( ) function. That TUNE( ) bit was a typo because I couldn't copy/paste into this silly reply box, and when I copy/pasted back from the box, I forgot that Tune( ) isn't all-caps. Then I got confused when I was getting "nil" errors for a global function that I knew existed. I browsed around those script files some more to see where any of the other TUNING... variables fit in and haven't found a single useful one yet. So there should be a local "timeout" variable that I need to correct as well as the global _TIME variable for each one of these, and many (there are over 150 of the stinking things) of them may require a maths function to determine the appropriate timeout method. I guess I'll keep looking, but at least it's a start. Something that works. Cheers.
  3. The code I've been posting is just a test function (practice for the real deal) that should create a console command that will change the autosave interval to autosave every "l_minutes" minutes in-game. This way I can test the script quickly by going into the game and running the console command c_test(.1) to change the autosave interval from 8 minutes to 6 seconds. If the game doesn't save after waiting 6 seconds, it didn't work. If I get that to work correctly, I can change the variable from TUNING.AUTOSAVE_INTERVAL to every other tuning var that uses a seg_time, total_day_time, or other time local variable. I have the mod up and running on Steam at the moment (in beta) as "Take your time" because it does work but isn't customizeable in-game. It just makes everything go 3 times slower hunger/day/season/perish-wise. Played around with your script a bit (good to see you by the way): local default_autosave_interval = TUNING.AUTOSAVE_INTERVAL function c_test(l_minutes) local autosave_interval = l_minutes or default_autosave_interval require('tuning') --[[ entered inside the function because TUNE() isn't recognized as a function even though it works fine standalone in the console (didn't work anyways) --]] TUNING.AUTOSAVE_INTERVAL = autosave_interval TUNE() --[[ I think I need this to work in order to apply the changes. Without it, I'm pretty sure the variable just sits there being orphaned. --]]end
  4. I'd need help figuring that one out. I tried putting TUNE() in the function after the return{...}, but got an error saying it was expecting end to follow return{ }. If I put it outside the function, then it won't get called when the function is executed from the console, and you're right about me not being able to use inst:DoTaskInTime because I'm not using PostInit(function(inst)...end) ... there should be something I can throw in there to make that command wait while the function continues on ... or I should be able to get the function to set those GLOBAL variables without being forced to exit. Something easy I'm missing here ...
  5. function test(l_minutes) local l_minutes = l_minutes or 8 TUNING.AUTOSAVE_INTERVAL = l_minutes * 60 --Need a way to delay the next command so this function can return variables first TUNE() return { TUNING.AUTOSAVE_INTERVAL, OVERRIDES = TUNING.AUTOSAVE_INTERVAL }end Could this work if I can find a way to use something like DoTaskInTime (don't have an inst declared for it) to have the script run TUNE() after all the variables are in check? I feel like I'm getting there, but still not sure if this will ever work (I've had dozens of failed prototypes already -- each more promising than this idea).
  6. back@debugman18: Can you post an example using the test code I provided? Not sure how that would look. Thanks for the help by the way.
  7. @debugman18: I changed from { } to [ ] because of the error: '}' expected near '=' I also tried ( ' ' ) ... which didn't give an error. It just didn't work. That's why I completely baffled about the syntax here.
  8. Can't edit posts on this forum? I guess that's one excuse to bump a thread ... Update: I feel like I'm getting close to what I want to do, but I'm still confused about syntax: --[[test function that "should" (if all goes well) add a working console command c_test(#) which sets how many seconds the gamewill wait before executing the autosave feature. I just want this to work as a sample code so I can build a bigger function to do all time related events except autosave. AutoSaving thegame is just the easiest alteration to notice.--]]local l_savedelay = 480 --default day length function c_test(l_newdelay) l_newdelay = l_newdelay or 480 l_savedelay = l_newdelay return {l_savedelay}end local TUNING_OVERRIDES = [TUNING.AUTOSAVE_INTERVAL = l_savedelay] return {OVERRIDES = TUNING_OVERRIDES} ^^ returns error message "Expected symbol near '[' " ... as I expected because that's the part of syntax I'm completely unfamiliar with. Can't figure out how to enclose the statement for the string TUNING_OVERRIDES which contains the "=" sign.
  9. Brand spanking new to modding in Don't Starve, but I'll try not to ask questions that have already been answered to death. The mod I'm currently working on (alpha version is attached) is supposed to add a console command "c_dayspeed()" which basically changes the day length (how many real-time minutes each in-game day lasts). I'm having trouble figuring out which variables I need to declare and return in order to change the game's GLOBAL.TUNING variables having to do with time. Also having trouble getting anything involving an array variable to work in a function, even when they work just fine outside of functions. Problematic code snippet: --copied from data/scripts/tuningoverrides.lualocal tuning_backups = {} local function OverrideTuningVariables(tuning) for k, v in pairs(tuning) do tuning_backups[k] = TUNING[k] TUNING[k] = v endend local function ResetTuningVariables() for k,v in pairs(tuning_backups) do TUNING[k] = v endend c_dayspeed = function(l_minutes) local seg_time = l_minutes * 30 / 8 OverrideTuningVariables(TUNING.SEG_TIME = seg_time)endAnybody want to point out what I'm doing wrong here? Also, is this kind of mod going to be possible (or practical given my skill set in LUA)? alpha.zip