Registered Users
  • Content count

  • Joined

  • Last visited

Community Reputation

320 Excellent


About Serpens

  • Rank
    Senior Member
  1. You can force the most settings within modworldgenmain.lua (create it in your modfile where also modmain.lua is). There you add: AddTaskSetPreInitAny(function(tasksetdata) if tasksetdata.location == "forest" then tasksetdata.overrides={ world_size = "small", wormhole_prefab = "wormhole", layout_mode = "LinkNodesByKeys", season_start = "autumn", autumn = "veryshortseason", winter = "veryshortseason", spring = "veryshortseason", summer = "veryshortseason", } end end) I noticed you always have to include wormhole_prefab and layout_mode, otherwise game will crash. All other things are optionally. You can find the possible options here: Don't Starve Together\data\scripts\map\customise.lua ______________________________________________________________________________ Setting game mode and if caves should be active is a bit more complicated. For caves I added this workaround: if tasksetdata.location=="cave" then tasksetdata.tasks = {"CaveExitTask1"} tasksetdata.numoptionaltasks = 0 tasksetdata.optionaltasks = {} tasksetdata.set_pieces = {} tasksetdata.valid_start_tasks = {"CaveExitTask1"} tasksetdata.overrides={ world_size = "small", wormhole_prefab = "wormhole", layout_mode = "LinkNodesByKeys", } end This means, even if cave will exist, it will be totally empty. The workaround for the mode was to let the game crash, if the wrong mode is active if _G.TheNet:GetServerGameMode() ~= "adventure" then print("You have to choose adventure as game mode!! "..errortoabortgame) -- errortoabortgame is nil and can't be added to a string, it will cause a crash end From what I know you can't set the mode, but you can change the mode details. So instead forcing to use survival, you can change any choosen mode to work like survival: I copied this code somewhere: -----------spawn mode------------------------------------------------ -- local SpawnMode = GetModConfigData("spawn_mode") -- GLOBAL.GAME_MODES["custom_game"].spawn_mode = SpawnMode ----------ghost sanity drain-------------------------------------------- -- local GhostSanityDrain = GetModConfigData("ghost_sanity_drain") -- GLOBAL.GAME_MODES["custom_game"].ghost_sanity_drain = GhostSanityDrain -----------ghost enabled------------------------------------------------ -- local GhostEnabled = GetModConfigData("ghost_enable") -- GLOBAL.GAME_MODES["custom_game"].ghost_enabled = GhostEnabled ----------------reset timer----------------------------- -- local ResetTime = GetModConfigData("reset_time") -- if ResetTime then -- GLOBAL.GAME_MODES["custom_game"].reset_time = { time = 120, loadingtime = 180 } -- end -------------------------poratl revival------------------------------ -- local PortalRez = GetModConfigData("portal_rez") -- GLOBAL.GAME_MODES["custom_game"].portal_rez = PortalRez -----------------banned items----------------------------------------- -- local BanResItems = GetModConfigData("ban_rez") -- if BanResItems then -- GLOBAL.GAME_MODES["custom_game"].invalid_recipes = { "reviver", "lifeinjector", "amulet", "resurrections" } -- end
  2. Workshop errors

    do you have more? A friend of mine tried everything, but nothing worked... Everytime any mod is updating, he has to delete it by going into windows safe mode. Of course he hates doing this everytime, so he stopped playing DST because of that stupid issue. Is there nothing steam or Klei can do? Why this problem suddenly appeared while it was not there some months ago?!
  3. Sand storm help

    Example from my questmod. It is to change the text colour from talking pigking also for clients: local function OnDirtyEventQuestRGB(inst) -- function called for client, when rgb value is changed for a questgiver inst.components.talker.colour = GLOBAL.Vector3(inst["mynetvarQuestsR"]:value()/255, inst["mynetvarQuestsG"]:value()/255, inst["mynetvarQuestsB"]:value()/255) end AddPrefabPostInit("pigking",function(inst) inst["mynetvarQuestsR"] = GLOBAL.net_byte(inst.GUID, "QuestsRNetStuff", "DirtyEventQuestsR") inst["mynetvarQuestsR"]:set(255) inst["mynetvarQuestsG"] = GLOBAL.net_byte(inst.GUID, "QuestsGNetStuff", "DirtyEventQuestsG") inst["mynetvarQuestsG"]:set(255) inst["mynetvarQuestsB"] = GLOBAL.net_byte(inst.GUID, "QuestsBNetStuff", "DirtyEventQuestsB") inst["mynetvarQuestsB"]:set(255) inst:ListenForEvent("DirtyEventQuestsR", OnDirtyEventQuestRGB) inst:ListenForEvent("DirtyEventQuestsG", OnDirtyEventQuestRGB) inst:ListenForEvent("DirtyEventQuestsB", OnDirtyEventQuestRGB) end So when the server is somewhere now doing: inst["mynetvarQuestsB"]:set(100) to change this value, the value is also changed at client AND the OnDirtyEventQuestRGB function is called. With inst["mynetvarQuestsR"]:value() you can get the actual value. And of course you do not need 3 of them, only one. You can use any names you want, but see which ones are identical in my example. Instead of net_byte you use net_bool, as CarlZalph wrote. The value for this is only true and false, no numbers. This way you can start the sandstorm in the "OnDirty.." function if it is true, or stop it, if it is false. I think you should add the netvars to the players, so AddPlayerPostInit. Then "inst" is in your OnDirty function the player. I'm not 100% sure if you need to check if player is the server or not... depends on if sandstorm can be started twice, if you start it on server and addtionally on the player.
  4. thanks, hope it works well
  5. Then go to text.lua and see what it is line 180 There you will see the function function Text:SetHAlign(anchor) Search for this function in the DoInit code and you will see there is one with ANCHOR_RIGHT , which is not GLOBAL yet. It could be that after everything of the code works, that it is also not compatible to your translation mod. You should take a look in files of translation mod what it is changing in playerstatusscreen file. edit: you already fixed it, but I also fixed it in my doinit code above. The first line was "function(" instead of "function(self)"
  6. There might be a better way, but in the code above I simply replaced the whole DoInit function. I just copied the original, but replaced the relevant part with your code to show the profile. Since we are in modmain now, you have to add to alot of things "GLOBAL." in front of it, I did not do this yet, so you have to. Also there could be other local functions that are not accesable via modmain. In this case also copy them into modmain. This is not a nice solution, cause it will confilict with game updates and other mods, but it is better then nothing. Another more simpler way would be to completely replace the playerstatusscreen file. So you copy the whole file and place it into scripts/screens/playerstatusscreen.lua of your mod folder.
  7. I edited a bit into my previous post. AddClassPostConstruct works the same like AddComponentPostInit, except that you have to add the folder name, so in this case screens, AddClassPostConstruct("screens/playerstatusscreen",function..." Here an example of how to use it for builder replica. You can use self and such stuff the same way:
  8. Ok, I have no clue about screens, but maybe this is the right way to go: Use AddClassPostConstruct("screens/playerstatusscreen",function..." to be able to change the playerstatusscreen object. When you have this object as "self", it should be possible to just change (i is the index of player): self.player_widgets[i].viewprofile:SetOnClick(...) edit: this is just my first guess. I'm sure it is not that easy also everytime the update function is called it might be resett... so... hmmm edit2: this Update function is called one time in DoInit and it seems always when self.scroll_list = self.list_root:AddChild(ScrollableList(ClientObjs, 380, 370, 60, 5, UpdatePlayerListing, self.player_widgets, nil, nil, nil, -15)) To run your change after DoInit, you simply change the DoInit function to call DoInit and after that do your change. But I don't know how to change the scroll_list thing that way, that your change is also present each time it calls update... The only way I know at the moment would be to write your own UpdatePlayerListing function and replace self.scroll_list to use your new function.
  9. great. But again you missed to describe what you already know/can do. Eg. do you already know what to put somewhere, to get the steam profil and are only looking for where to place the code? If you already have part of the code, it will attract more users to help, since then you already did most of the work.
  10. From what I read about your questions I can tell you: You questions most of the time sounds quite easy, but important information is missing. And if I ask you about more information it turns out that the whole thing behind your question is ultra complex and difficult Maybe it is because I have no knowledge about screens and this lua script, but I don't know what you mean by "functions at screen". And what do you want to do? Do you want to change the status widgets like hunger while the game is already running? I fear I don't have an answer, but this explanation might help to get an answer from someone who knows.
  11. so your question is solved? Could you share your solution?
  12. In my unfinished adventure mod, the first world you start is only swamp (start location is small forest). The code is in modworldgenmain (I edited the code from my mod, so it could be that there are few mistakes, I did not test it): AddTaskSetPreInitAny(function(tasksetdata) tasksetdata.tasks = {"Tentacle-Blocked Spider Swamp"} -- world only contains this task and the start location tasksetdata.numoptionaltasks = 0 tasksetdata.optionaltasks = {} tasksetdata.set_pieces = {} tasksetdata.required_prefabs = {"spawnpoint_master"} -- if these miss, the world will reload. By default it contains pigking, so you have to make it at least empty, to remove pigking tasksetdata.overrides={ world_size = "small", wormhole_prefab = "wormhole", layout_mode = "LinkNodesByKeys", season_start = "autumn", autumn = "veryshortseason", winter = "veryshortseason", spring = "veryshortseason", summer = "veryshortseason", } end) I'm not sure anymore what will happen, if you make tasks emtpy... The way it is above it should spawn default start location and the swamp around it. This would be the best way I know of, to make a small world.
  13. the easiest way would be to store your modsetting in TUNING. So in modmain you do GLOBAL.TUNING.MYMODNAME_SPEED = GetModConfigData("characterspeed") and then use TUNING.MYMODNAME_SPEED in your other game files.
  14. [RELEASE] Quest Mod

    The Quest mod is actually a result of my plans to make an Adventure mod: But even this Questmod is such a big task, that I can't do it alone. That's why development of questmod is stuck, cause no one is interested in helping or even testing/balance ideas/story ideas. Adventure mod is even bigger, and I don't have enough time and knowledge to finish that ever alone, that's why I uploaded my unfinished version, so in case someone would like to continue, he can do. Questsmod: There are not that many world gen mods out there. Usually the game is forcing to spawn pigking, so a modder would need to explicit remove pigking. And in this case I think there is a good reason for modder to not spawn pigking. But I could add a check, if pigking is there. If he is not, I could spawn another questgiver instead. About my teleportato mod: Recently someone asked about teleportato in caves at steam. He wrote me at Klei forum and it seems he is going to work on it, to make teleportato parts also spawned in caves. If he succeeds I will incooperate his work in teleportato mod. In this Enhanced Desert mod: The teleportato mod has a function that check, if all parts are in the world. If not it should spawn them randomly in the world. So it should work with "desert only". But this check is also the reason why parts are not spawning in caves yet. Cause I can't communicate between caves and overworld, to see if the parts are in one of these.
  15. Can't get rid of Mods. Help.

    Anyone found a permanent solution? I friend of mine always have to delete mods in safe mode (and delete mods) to update any mods... steam does not start automatically (this was suggested somewhere) and he already set up all the folder rights he was able to find. But problem is there are like 3 different right menus with alot of different "users", 5 times himself and all in all it is just a big mess. So it would help alot if someone knows exactly "make this and that setting there".