• Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral

About rawii22

  • Rank
    Junior Member

Recent Profile Visitors

80 profile views
  1. What did the crash screen say? Also you can delete these lines: inst.components.armor:InitCondition(TUNING.ARMOR_WATHGRITHRHAT, TUNING.ARMOR_WATHGRITHRHAT_ABSORPTION) inst.components.insulator:SetSummer() Also, change all the times you see the word "inst" to "prefab". Also also, just to supplement what we're trying here, try to look for a simple mod that changes something about a prefab and check out its modmain file.
  2. This might be a tiny bit more complicated than most prefabs since all the hats are held in one file, but it could work. If you are familiar with AddPrefabPostInit, see if you can add a function to the prefab "beefalohat" that adds a certain tag or component. You can make a hat in game to see if your desired properties exist. After thinking about it for a another minute, this should work since when the game loads up, all the hat prefabs are already compiled and considered their own entities. In any case, the components you're looking for are the "armor" and "insulator" components. Your function might look like this: AddPrefabPostInit("beefalohat", function(prefab) prefab:AddComponent("armor") prefab.components.armor:InitCondition(*health of the hat as a number*, *damage absorption number*) --inst.components.armor:InitCondition(TUNING.ARMOR_WATHGRITHRHAT, TUNING.ARMOR_WATHGRITHRHAT_ABSORPTION) --The line above is an example so you can look at what the numbers normally look like in tuning.lua prefab:AddComponent("insulator") inst.components.insulator:SetSummer() --not sure what this does; I copied it from hats.lua. You probably don't need it. Look in insulator.lua for more functions inst.components.insulator:SetInsulation(TUNING.INSULATION_SMALL) --You can look in tuning.lua to see what value this is and put in your own. end) If you're interested in other properties or components, you can always look for examples in the prefabs folder for when they use AddTag or AddComponent. Also I don't know how much you know, but you can also use RemoveTag or RemoveComponent just as simply.
  3. I think if you put the files in an "exported" folder, the modTools will automatically recompile them when the game runs.
  4. If it's just a simple icon you can just put in u1="0" u2="1" v1="0" v2="1" since it's proportional to the image size.
  5. There's probably a sanity aura that's activated in the tent prefab you can check out. Maybe you can add a prefab post init that puts in a different sanity aura value...
  6. Would you mind showing me the other code just for reference? As for changing that line specifically, the only thing on that line should look like this: GLOBAL.TUNING.SCHOOL_SPAWNER_MAX_FISH = *number here* Also, since this is in modmain, don't forget to remove the commas. In tuning, all the variables are defined in a list so they need separation, but in modmain, all the changes are declared one by one on a new line, so I wonder if that's what the "unexpected symbol" is.
  7. Are you asking for the grass not to disappear when the gekko spawns? If so, this should be a very simple fix. In the prefab file for grass, they call the transition from grass to a grass gecko a morph. In the function onmorphtimer in grass.lua, they call inst:Remove() on the grass after spawning a grass gekko, so I'm pretty sure we could circumvent this somehow by adding a prefab post init. The fn() function for this doesn't directly call onmorphtimer so you might have to do some maneuvering to work the altered code in. Buuut, I still don't know if that's what you're asking... If you want equal probabilities of berry bushes to juicy berry bushes and twiggy trees vs sapplings, then I think you might be interested in scripts/map/rooms and terrain_grass and terrain_forest. You might also find the other rooms interesting since they list the probabilities of having certain plants and animals. My brother and I attempted to make changes to probabilities when we started working on a wheat mod, so I'll post our worldmodgenmain.lua here to give you an example of how to do this.
  8. Version 1.0.0


    This is the modworldgenmain for our work-in-progress wheat mod. I'm sharing it as an example for altering rooms and worldgen stuff.
  9. I took a look at it's prefab file and probably the only thing of interest it that is has a combat component. I'm pretty sure that tallbirds attack anything that gets close to their nests. The first thing I would think to do is to find some way of modifying some function in the combat component, probably a targeting system, to check if the one attacking is a tallbird and if the target is a grass gecko and then cancel the rest of the actions. I think a good place to look for examples would be the eyeplant and wormwood. Eyeplants attack everyone except wormwood, so maybe there's a system of tags or a series of checks in one of the two files or component. Just whatever enemy/mob you can think of that has an exception (like webber and spiders)
  10. In a modmain, you could alter some variables in the tuning.lua file. This process should be no different for dedicated servers, all you have to do is make sure that the mod goes in the right folder, C:\Program Files (x86)\Steam\steamapps\common\Don't Starve Together Dedicated Server\mods. I took a quick look to find some variables that might interest you: FISHING_CATCH_CHANCE = 0.4, MAX_FISH_SCHOOL_SIZE = 2, SCHOOL_SPAWN_DELAY = {min=0.5*seg_time, max=2*seg_time}, SCHOOL_SPAWNER_FISH_CHECK_RADIUS = 30, SCHOOL_SPAWNER_MAX_FISH = 5, SCHOOL_SPAWNER_BLOCKER_MOD = 1/3, -- 3 or more blockers will prevent spawning SCHOOL_SPAWNER_BLOCKER_LIFETIME = total_day_time, You can either spawn more fish, or make them more likely to be caught by a fishing rod by checking out the OCEANFISHING_LURE section. Chaning them in modmain might look something like this: GLOBAL.TUNING.FISHING_CATCH_CHANCE = .8 Remember that since you're in modmain, you won't need the commas at the end of each line since you're not in a list. Chaning something from the OCEANFISHING_LURE section would be like this: GLOBAL.TUNING.OCEANFISHING_LURE.HOOK = {charm = 0.5, reel_charm = 0.1, radius = 5, style = "hook", timeofday = {day = 1, dusk = 1, night = 1}, dist_max = 0 } I changed some values here, but I'm not sure what the timeofday and dist_max values do so I didn't change them. You can experiment with some crazy value to see what they do. Hope this helps...
  11. Well, there are many layers to this goal. You have the animations(maybe), the fusing of the stats, and what happens to the players. Animation could be as simple as doing ThePlayer:Hide() If you want something more intricate, you can either see if there are any existing player animations that will work, or go deep into the rabbit hole of custom animations using spriter which is a program in the Don't Starve Mod Tools. Fusing the stats should be the easiest part. If you just want to add them up, all you have to do is call a bunch of Get methods. If you want to combine their max stats, I'm pretty sure the SetMax functions will work. Perks will probly be a little harder, but there may be some components involved, in which case it will be as easy as adding them. As for the players, what will happen, will one player lose control and the other take over? If so, then this might be the hardest part, as in it will take the most research in the game files as to how controls work and how to make one player follow another constantly (or at least while fused). You'd have to constantly be moving one player to another. Upon reconsideration, constantly moving one player to another isn't really that hard (you can check out how the c_move and c_goto functions work in consolecommands.lua), but it may severely affect performance. If they can un-fuse, you'll have to do some math with the un-fused player's stats. Hope this was useful in some way!
  12. There's a guide here that might help do what you want. He mentions something about making food items inedible, but there's something to learned about food there that can help with making something edible. You'll have to give nightmarefuel the edible component and make sure that only your character can eat it. This is done by altering the CanEat function in the eater component. Food values are also mentioned here.
  13. The sanity aura for players seems to be fine. As for removing sanity, the first idea that comes to mind is to add an AddPlayerPostInit which should work for all players. You could use some system of events and trigger the loss of sanity. I just tested out some events but they didn't work. I tried listening for entity_death, which is apparently only used for players, but it did not work; and the event "death" is local to only the player that dies and others cannot hear it. If you were to use events, one solution could be to add a custom event to the health component for when a player dies (this is checked in the SetVal function) and listen for it in modmain.
  14. I think you're best bet would be to figure out how to implement the DoPeriodicTask(seconds, function) to your character. EDIT: I just looked at shedder, it's pretty short, but it does what I meant. There's a function StartShedding(interval) where interval is the seconds between sheds. Also, you'll want to set the properties (shedItemPrefab and shedHeight) to the appropriate values for your character. As @Well-met said, bearger is perfect for seeing how that is implemented.