Ultroman

  • Content count

    1,883
  • Joined

  • Last visited

Community Reputation

618 Excellent

About Ultroman

  • Rank
    Senior Member

Recent Profile Visitors

2,470 profile views
  1. You're in for an interesting study-session Open stringutil.lua and take a look around line 156 for this function declaration: function GetString(inst, stringtype, modifier) Then, search all the game code for: GetString( Have fun!
  2. Mod settings and crashing

    Check out this post. Scroll down to "Debugging". It'll tell you where the log files are located, and one of those logs can tell you which mod is broken or BEING broken by another mod. In the latter case, you're sometimes lucky that it prints both mod IDs i.e. "workshop-###########" where the #'s are the workshop ID of the mod (the numbers in the URL when you're on the mod's workshop site).
  3. Try this inst.name = "Crow McRowson"
  4. Gain Sanity from wetness?

    That should get you started.
  5. Instead of trying to paste it into every spot you can think of, you should figure out where your bees are being spawned. There is no SpawnPrefab() call in the beebox code, but if you study it a bit, you'll notice it has a component called "childspawner", which handles a population of whatever prefab you tell it to. This is code from your royalbeebox.lua. Read my comments. // REMOVE THIS - START local bee = SpawnPrefab("bee") if TheWorld.ismastersim then bee.components.pollinator.collectcount = 3 bee.components.locomotor.walkspeed = 5.5 bee.components.health:SetMaxHealth(70) bee.components.combat:SetDefaultDamage(7) bee.AnimState:SetBuild("honeybee_build") end // REMOVE THIS - END if not TheWorld.ismastersim then return inst end --------------------- inst:AddComponent("harvestable") inst.components.harvestable:SetUp("honey", 12, nil, onharvest, updatelevel) inst:ListenForEvent("childgoinghome", onchildgoinghome) ------------------- -- Your childspawner is set up here, with the prefab name of the child, etc. inst:AddComponent("childspawner") inst.components.childspawner.childname = "bee" inst.components.childspawner.allowwater = true SeasonalSpawnChanges(inst, TheWorld.state.season) inst:WatchWorldState("season", SeasonalSpawnChanges) if TheWorld.state.isday and not TheWorld.state.iswinter then inst.components.childspawner:StartSpawning() end Now, the childspawner component has a function appropriately called DoSpawnChild, which calls this line when it has spawned a child: self.onspawned(self.inst, child) The onspawned function is not used by default. It's there for you to use. That said, we never know if another mod is also using onspawned for bees, so we make sure to extend the function if there's one already. Put this in after the other inst.components.childspawner lines in master_postinit. local oldOnspawned = inst.components.childspawner.onspawned inst.components.childspawner.onspawned = function(childspawner, child) child.components.pollinator.collectcount = 3 child.components.locomotor.walkspeed = 5.5 child.components.health:SetMaxHealth(70) child.components.combat:SetDefaultDamage(7) child.AnimState:SetBuild("honeybee_build") if oldOnspawned ~= nil then oldOnspawned(inst) end end
  6. Stomach rumbling help

    Here's a Custom Character Sound Tutorial.
  7. character mod help

    Just remember that you're essentially talking to a random person (well, MANY random people) you've never met, and in this case you're asking them to solve a problem for you What would they need to know about my idea, to give me pointer on how to solve my problem? Provide context and variables and such.
  8. Added some code examples. I assumed you had made your own beebox prefab which spawns bees, either within its own code, or using a component. You should be able to make most of the same changes using the mod API (to edit existing prefabs, instead of making your own prefab). It depends on exactly which changes you want to make and which functions are public or local in the components you've edited.
  9. You can just spawn normal bees, and right after you've spawned them, you just set that value. No need for a new prefab for that. Or new brains or stategraphs or components or anything. Just like the pollinator component does for flowers: local flower = SpawnPrefab(parentFlower.prefab) flower.planted = true you can do: local bee = SpawnPrefab("bee") bee.components.pollinator.collectcount = 3
  10. Why do you need to make a new bee prefab?
  11. Your Windows Explorer window is sorting by name, ascending, instead of name descending. Just click on the "Name" tab, to the right of the checkbox, where it says "Name".
  12. Ehm...you don't need all that. You can just set the "collectcount" variable on all bees using AddPrefabPostinit. AddPrefabPostinit("bee", function(inst) if inst.components.pollinator then -- Set number of flowers needed for full pollination. Default is 5 inst.components.pollinator.collectcount = 3 end end) That's just one of the bee-prefabs, but I think it's the only one you need.
  13. character mod help

    I can't help in the capacity you're asking, but if you want anyone to respond to this, you should probably give them more to go on than "able to get overcharged". What does that mean to you?
  14. It's not DS/DST that doesn't have "continue". Lua, the scripting language we write mods in, doesn't have "continue" It has "break" and "goto", which can be used to sort of mimic a "continue" (read the two top answers AND the comments(!!!))), but those workarounds are generally disliked, so we just try to write our code in ways which do not require a "continue" (like the link shows). Usually, this results in nested if-statements and/or subsequent if-statements and the use of a bool saying whether to skip the rest of the if-statements (which all check that that bool is not true before doing their actual checks).
  15. When an item gets put into a container, instead of getting the player in the "player" parameter, you get the container, e.g., chest or backpack.