Ultroman

  • Content Count

    2020
  • Joined

  • Last visited

Community Reputation

693 Excellent

About Ultroman

  • Rank
    Senior Member
...

Recent Profile Visitors

3000 profile views
  1. I'm sorry, I seem to have missed a notification for this. I'm not sure about the structure of your code, since it's broken up in pieces, but what you've shown so far, does not look like it has proper syntax and structure. You don't seem to end the doAreaDamage function before starting your hitother function. If this is still relevant, please post your full code where you've tried to implement it.
  2. You're very welcome! Yeah, a bunch of ends missing at the top of that code, which would make none of it work. I don't understand why you would make several of that food_stats-line, but if you're not familiar with Lua, I guess that makes sense xD Good to hear you got it working and learned a bunch!
  3. You don't need my permission for that Go ahead. But as I said, I do it in a way that you should keep away from. You might as well read the original game code. My code does almost the same thing, but makes it confusing with several prototypers. This sounds like a new crafting menu replacement, with filters.
  4. It's all about the builder component. It determines what shows up in your tabs. It has some functions which determine which recipes the player has access to using their own TECH + the TECH of the prototyper they are standing closest to. When I did the mod Long-range Research, I not only wanted to make it so prototypers could be used from further away, because then it would be hard to select which one was the one you wanted to interact with. I also wanted to change the way it calculates which things you can craft, so my mod reads the highest level of each TECH that it can find on the player and EVERY prototyper within range, so everything you can craft using the prototypers within the defined range, will show up in your tabs at the same time <3 My approach required completely overwriting a certain complex function, so I do not recommend doing that lightly. What you're asking for, can probably be done by extending the KnowsRecipe and/or CanCraft (or whatever the name is of those functions are) on your character's builder component and saying "return true when asked about these certain prefabs". MUCH easier and less intrusive than doing what I did. I had to, because of the multi-prototyper-thing. If you study the builder component enough, following where those functions are used, you'll quickly get a good idea of how you can do this. Don't rush into it, because there are many gotchas in there. EvaluateTechTrees is the function I replace. It's very interesting to read through, to learn how the builder component works, but again, I do not recommend messing with it, unless you're absolutely sure what you're doing. But these approaches all actually allow the player to craft the thing. If you want it to show at all times but not be craftable unless you're closest to a Shadow Manipulator, I'm not sure how I would do that.
  5. I think so. You gotta pick your battles in all aspects of life. Sometimes a mod just isn't worth the time. Oh, btw. My mod, Auto Stack and Pick Up, can lower the amount of simultaneous entities in the world by making them automatically stack with similar items next to them when they're spawned. The performance increase is most significant if you also enable the option to auto stack during world generation.
  6. That's exactly what AddPrefabPostInit was made for. It is not a waste. It is required. Each instance is spawned using the prefab (think of them as assembly instructions to build an instance of an entity).
  7. Because SetLoot is defined as such: function LootDropper:SetLoot(loots) When they're defined this way, with a colon, it's shorthand for function SetLoot(self, loots) When extending such functions like you did with a . instead of : , just add self as an "extra" first parameter.
  8. As it's under the Mods and Tools section, I'd personally like to keep it within that theme. Isn't there a section for gameplay guides like that? Otherwise, it's a great idea to create one
  9. I don't have time to make one of my usual tutorials right now, but this should lead you in the right direction. Recipe function declarations for each type of game, taken from their recipe.lua files: -- DS and RoG Recipe = Class(function(self, name, ingredients, tab, level, placer, min_spacing, nounlock, numtogive) -- SW Recipe = Class(function(self, name, ingredients, tab, level, game_type, placer, min_spacing, nounlock, numtogive, aquatic, distance) -- Hamlet Recipe = Class(function(self, name, ingredients, tab, level, game_type, placer, min_spacing, nounlock, numtogive, aquatic, distance, decor, flipable, image, wallitem, alt_ingredients) I grabbed this from the game code. I believe it is the best way to check for each kind of DLC. I think there's some difference between how to check for RoG compared to SW and Hamlet, and I don't know why. if SaveGameIndex:IsModePorkland() then -- Do Hamlet code elseif SaveGameIndex:IsModeShipwrecked() then -- Do SW code elseif IsDLCInstalled(REIGN_OF_GIANTS) then -- Do RoG code else -- Do original DS code end You can translate those if-statements to bool-variables if you prefer.
  10. I'm sorry to say, but almost none of what you wrote is accurate. Have you done the Lua Crash Course? It's linked in this newcomer post, which also introduces a bunch of tips for you to get started. After that, you should no longer be this confused You got the priority-part kind of right. It's a state-machine, so it has a hierarchy of states to check for. Each state is prioritized, but also has a function to check whether the state is valid at this moment, so you can e.g. make a hound skip looking for food if it doesn't have a leader yet, and things like that.
  11. Modinfo Guide Check that out. I think you may be missing the bools telling the game which DLCs it's compatible with.
  12. In this case, you can just leave the variable for all versions. I grabbed this from the game code. I believe it is the best way to check for each kind of DLC. I think there's some difference between how to check for RoG compared to SW and Hamlet, and I don't know why. if SaveGameIndex:IsModePorkland() then -- Do Hamlet code elseif SaveGameIndex:IsModeShipwrecked() then -- Do SW code elseif IsDLCInstalled(REIGN_OF_GIANTS) then -- Do RoG code else -- Do original DS code end You can translate those if-statements to bool-variables if you prefer.
  13. I get your frustration, but it's not really something they can just "fix". It's a multiplayer game, so you need to define how your mod should work for servers and clients. We have neat functions to split up the code, and we have RPC-calls to bridge the information sharing gap. If you want to make a mod, you need to tell the game how it should work on both the client and the server. That's just how it is when you're doing multiplayer games.
  14. Make sure all_clients_require_mod is set to true in your modinfo.lua
  15. all_clients_require_mod must be set to "true" in your modinfo.lua. Any mod that adds items, characters or other new things like texture replacements MUST be set to be automatically downloaded by the clients, otherwise they won't have your mod files.