• Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral


About LordBritish

  • Rank
    Junior Member

Recent Profile Visitors

1537 profile views
  1. A little late for doing this, but I figured on adding in the final code in the event someone would like to use it for a future mod project. Namely due to the code I posted lacking some vital functions that will let it work as normal on a server. And sorry if this is a little cluttered, I salvaged the code from a separate mod that gave a specific item to everyone on the server, simply modifying it to suit my character's needs. -- This complicated bit is needed to add our code into the world's prefab local world_init_fns = {} local function AddWorldPostInit(fn) table.insert(world_init_fns,fn) end local was_forest local function world_init(inst) if was_forest then return end was_forest = true for i=1,#world_init_fns do world_init_fns[i](inst) end end AddPrefabPostInit("world",world_init) -- Random item pool for reference local random_items = { items = { "axe", -- Insert whatever item prefabs you wish here, like above }, } --Checks to see if item generation is disabled. --(item_generation is a mod configuration option that chooses how many days a player must be alive for, set to 0 disables the perk) if GetModConfigData('item_generation') > 0 then local function GiveItems() local AllPlayers = GLOBAL.AllPlayers -- Influences every individual player on the server with an easy to use ipairs function for i,v in ipairs(AllPlayers) do -- A lot of these small if statements are here to prevent potential crashes. Call me paranoid, but this is for DST. if not v.components.age then v:AddComponent("age") end -- Sets our day intervals and player age. Player age is +1 since age starts at 0 while cycles don't. local daysRequired = GetModConfigData('item_generation') local playerAge = v.components.age:GetAgeInDays() + 1 -- If this is for a specific character, keep this if. If it is for all players as a server mod, remove this if if v:HasTag("exampleTag") then -- Ghosts don't get this benefit. if not v:HasTag("playerghost") then -- If the player's age divides completely into the day interval set before, give that man an item. if playerAge % daysRequired == 0 and playerAge >= 1 then --Gives the player a random item if not v.components.inventory then v:AddComponent("inventory") end -- Picks 1 random item from the table set above. Can be changed to grab more than 1 without duplicates local starting_items = GLOBAL.PickSome( 1, random_items.items ) for i, r in pairs(starting_items) do -- Takes every individual item and gives it to the player. local item = GLOBAL.SpawnPrefab(r) if item ~= nil then v.components.inventory:GiveItem( item ) --v.components.talker:Say("Got item!") end end end end end end end -- Runs GiveItems local function OnDayComplete(inst,day) GiveItems() end -- Runs GiveItems at the start of a new day AddWorldPostInit(function(w) w:WatchWorldState("cycles", OnDayComplete) end) end Hopefully it will be void of crashes and bugs in-game... ...or not and it erases your inventory visually...
  2. Thanks for that, it helped out more than I thought, turns out it had more to do with the AddWorldPostInit function. Now to see if I can fix this coding...
  3. I wish it were that easy, but everytime I try that it still crashes, however without a crash log. Maybe there's something else wrong with the code I'm not seeing.
  4. I'm currently having a problem with my code within the modmain of a custom character I was creating and I was able to isolate it down to this line here: if v.components.age:GetAgeInDays() % daysRequired = 0 then What I'm trying to accomplish is a simple RNG item giver to a specific character, but only when their time alive in the world fully divides (nothing in the decimal places) into the required day count (determined by the config data of 'gem_generation'). However, when it comes to running the code below, I always receive the same results from the game. For the line I isolated above, it always crashes saying that "then is expected near =" for said line. I'd appreciate any assistance in finding out the issue as well as how to solve it. The full code: if GetModConfigData('gem_generation') > 0 then local function GiveGems() for i,v in ipairs(AllPlayers) do local daysRequired = tonumber(GetModConfigData('gem_generation')) local playerAge = tonumber(v.components.age:GetAgeInDays()) -- If the player is example, has more than 0 health (isn't dead) and the age of the player meets the generation requirements if (v:HasTag("example")) and (v.components.health.currenthealth > 0) and (playerAge > 1) and not v:HasTag("playerghost") then if v.components.age:GetAgeInDays() % daysRequired = 0 then --Gives the player a random gem local RNG = math.random(1,36) if RNG < 7 then v.components.inventory:GiveItem("redgem") elseif RNG >= 7 and RNG < 13 then v.components.inventory:GiveItem("orangegem") elseif RNG >= 13 and RNG < 19 then v.components.inventory:GiveItem("yellowgem") elseif RNG >= 19 and RNG < 25 then v.components.inventory:GiveItem("greengem") elseif RNG >= 25 and RNG < 31 then v.components.inventory:GiveItem("bluegem") else v.components.inventory:GiveItem("purplegem") end end end end end -- Runs GiveGems local function OnDayComplete(inst,day) GiveGems() end -- Runs GiveGems at the start of a new day AddWorldPostInit(function(w) w:WatchWorldState("cycles", OnDayComplete) end) end
  5. Whelp, I have a new update for June in DST (DS update will come in time). It's a pretty hefty one but I'll sum it up simply: June now has a sanity penalty for having a follower below 25% loyalty and can gain a sanity boost for having a follower above 75%. These can stack and even negate each other in the case of multiple followers. Followers are stronger than before when above 75%, become as strong as before when above 50%, have default stats when above 25%, and have a nerf below 25%. Followers will make it easier to tell which are higher in loyalty then others. It is no longer recommended to gain as many followers as you can with June, but rather have one or a couple followers and keep them happy so they can be as strong as possible. This should be easy in the case of monster meat farming. If the changes aren't your favorite, you can easily remove them through configurations.
  6. Welp, there we go. After almost a week the Single-Player version is now out! Its features are included in the changelog (typo and all) but I'll put it here in the event it gets hidden. Compatible with Don't Starve, Reign of Giants, & Shipwrecked! 1000's of lines of custom dialogue from the DST version, with hundreds more custom lines for Shipwrecked! Wildbore's have their own perk upon befriending, they'll now attack twice as fast! June's revive on companion is gone, but to make up for that she can make a Meat Effigy at a reduced price without the need for prototyping Pigmen's perk is buffed from 15% to 25% speed boost (Also, regeneration might or might not work. I haven't tested it.) If there are any bugs or crashes, please let me know! Now go out there and try some solo with June!
  7. Oh believe me, I'd love to. Granted the revival function would be kaput since ghost-forms aren't a thing, but I'll see what I can do.
  8. Version 1.3.4


    Also available on the Steam Workshop: In Single-Player Form: June the String-Puller [DS][ROG][SW] And Multi-Player Form: June the String-Puller [DST] June is my own OC (from her own universe, not from Don't Starve). As such, please do not reupload this mod and or character without permission. Stats: Health - 110 Hunger - 100 Sanity - 300 Damage Multiplier - x0.85 Attack Interval - 0.3 Perks: Pigmen, Rabbitmen, and Wildboars gain an extra 50% loyalty time when befriended by June. Each gains unique buffs as well! Bunnymen do not aggro on her carrying meat. Starts with 3 meat in her inventory [Don't Starve Only] Can craft a Meat Effigy at the cost of 3 Meat and 3 Monster Meat without the need for prototyping! [Don't Starve Together Only] Can revive off of viable companion mobs. Will not have a max health penalty, but will respawn with only 15 health and kill the companion you haunted (viable companion mobs include Pigmen, Rabbitmen, Rock Lobsters, Chester and Glommer. This can be further modified in configuration) [Don't Starve Together Only] June is a pretty corrupt person, and the more loyal or numerous her following becomes, the more her corruption shows towards others. As such, if June has 3+ followers or at least 1 extremely loyal follower, she will emit an aura, draining other players' sanity. This can also scale up the more followers and or extremely loyal followers you have. Gameplay Style: June is a moderately weak character whose only shining point stat-wise is her immensely high sanity max of 300. Outside of this, her true strength lies when she finds a companion. For instance, feeding a Pigman or Rabbitman will increase their loyalty gained by the food item by 50%. This, combined with her starting inventory of 3 meat, gives you enough food from the start to keep one pig loyal for up to 4.5 days. Even smaller meals can give more loyalty, so you don't have to just feed them meat. Another perk of hers is that Rabbitmen will never aggro on her when she has meat in her inventory, which makes having a following comprised of both Pig and Rabbitmen more viable for her. Her final (and most influential) perk is her ability to revive off of viable companion mobs (includes Pigmen, Rabbitmen, Rock Lobsters, Chester, and Glommer). For doing this however, the companion dies and she spawns in with only 15 health, but does not gain a max-health penalty and possibly even the killed companion's food of choice, allowing you to start the follower cycle all over again. June's followers gain buffs that scale up based on how loyal they are, separated into 4 stages. At stage 1, June's followers become sick of her demands and slack, degrading June's sanity in the process. At stage 2, they are at their default stats. At stage 3, they gain a small buff. At stage 4, they gain a strong buff, passive regeneration, and even passively raise June's sanity over time. (Followers will let you know what stage they're at through comments) It is best recommended to have a small following, so that when food becomes scarce, June doesn't suffer a huge amount of lost sanity. Backstory (for those that want one): June is an anthromorph, a creature composed of both human and animal DNA. Created to live for hundreds of years and look as beautiful as if she was still young. Before her kind was given proper human rights, she was produced as a dime-a-dozen servant/slave whose sole purpose was to please her owner’s demands. However, June was a special case. Unlike other anthromorphs of her time, she was extremely intelligent and didn’t take satisfaction in pleasing her owner, so much so that when her owner got drunk one night, she fooled him into his bedroom with her, and killed him in cold blood. Of course, because of how anthromorphs were “stupid creatures who follow their master’s will,” the courts ruled out murder in favor of suicide and June got off scot free. From then on she used her mind and body to trick unknowing people into doing exactly what she wanted. Now, trapped in the world of Don’t Starve, she finds her skills of manipulation being put to the test, as she now must use them to make her way through using this world’s smartest creatures… believe me… that isn’t saying much. If you've downloaded June off of this page and not the Steam Workshop and suffer from a game-crashing bug, please make sure to check and see if your version is up to date before reporting. Currently June's version is: 1.3.4 for Don't Starve Together (see changelog for more information) 1.1.3 for Don't Starve (see changelog for more information) Known Bugs: [Don't Starve Only] When saving a game and re-loading it, any companions you currently have will have their loyalty reset to 100% (50% in the case of June's loyalty increasing perk) if their current loyalty to June at the time of saving exceeded the maximum default loyalty. [Don't Starve Together Only] If you enable Widgette by Dragon Wolf Leo and have one player play as June with another as Widgette, the one playing as Widgette will crash (I believe this has something to do with both having lightning in their modmain... but I don't believe I can fix this since it could be June or it could be Widgette... I can't really tell from the code) Special thanks to: Dragon Wolf Leo, creator of the Extended Character Template Electroferret for help with coding and enthusiasm