• Announcements

    • JoeW

      Support Email Error (Zendesk)   08/12/2019

      We are migrating to a new customer support ticketing system (desk.com) and unfortunately while moving over our old tickets the new system (Zendesk) sent an auto reply to "new users". We weren't aware this would happen and so and email was sent out in error. You do not need to create an account and you can ignore the email entirely. You can find more info about this over on our forums here: https://forums.kleientertainment.com/forums/topic/110413-zendesk/ Sorry for the confusion

danielpa

  • Content count

    13
  • Joined

  • Last visited

Community Reputation

4 Neutral

About danielpa

  • Rank
    Junior Member

Recent Profile Visitors

70 profile views
  1. I already do this, look at the end of the function. I use it in my mod to select the best tool for the job, I need not only the usage percent but also the armor reduction, weapon damage and others. I infer other values from the usage percent as well https://github.com/danielpza/dst-omnikey/blob/master/src/modmain.ts#L176-L185 The thing I did similar to Item Info is creating a prefab to cache it's components, I don't need/use/calculate other values like Item Info does
  2. This is my latest revision on the code: local prefabCache function getPrefabCopy(prefab) if prefabCache[prefab] == nil then local isMasterSim = GLOBAL.TheWorld.ismastersim GLOBAL.TheWorld.ismastersim = true local copy = GLOBAL.SpawnPrefab(prefab) local cache = {prefab = prefab, components = {}} if copy.components.finiteuses then local ____ = copy.components.finiteuses local current = ____.current local total = ____.total local consumption = ____.consumption cache.components.finiteuses = {current = current, total = total, consumption = consumption} end if copy.components.tool then local ____ = copy.components.tool local actions = ____.actions cache.components.tool = {actions = actions} end if copy.components.weapon then local ____ = copy.components.weapon local damage = ____.damage cache.components.weapon = {damage = damage} end if copy.components.armor then local ____ = copy.components.armor local absorb_percent = ____.absorb_percent local condition = ____.condition local maxcondition = ____.maxcondition cache.components.armor = {absorb_percent = absorb_percent, condition = condition, maxcondition = maxcondition} end if copy.components.healer then local ____ = copy.components.healer local health = ____.health cache.components.healer = {health = health} end if copy.components.edible then local ____ = copy.components.edible local healthvalue = ____.healthvalue local hungervalue = ____.hungervalue local sanityvalue = ____.sanityvalue local ismeat = ____.ismeat local foodtype = ____.foodtype cache.components.edible = {healthvalue = healthvalue, hungervalue = hungervalue, sanityvalue = sanityvalue, ismeat = ismeat, foodtype = foodtype} end copy:Remove() GLOBAL.TheWorld.ismastersim = isMasterSim prefabCache[prefab] = cache end return prefabCache[prefab] end
  3. Is there a way to make the created prefab "invisible", maybe move it very fay way in the world?
  4. How can I do this (get a component property) with RPC? do you have any examples of it besides https://forums.kleientertainment.com/forums/topic/47353-guide-getting-started-with-modding-dst-and-some-general-tips-for-ds-as-well/
  5. yes, you must remove the items, the original mods just cache the variables it needs and then destroys it.
  6. I found a workaround in other mod (Item Info), it doesn't seem the best way, but it works for me: local prefabCache function getPrefabCopy(prefab) if prefabCache[prefab] == nil then local isMasterSim = GLOBAL.TheWorld.ismastersim GLOBAL.TheWorld.ismastersim = true prefabCache[prefab] = GLOBAL.SpawnPrefab(prefab) GLOBAL.TheWorld.ismastersim = isMasterSim end return prefabCache[prefab] end -- then use getPrefabCopy("axe").components
  7. I've read the starting guides to modding and some explications for the replica and classifieds, but still haven't found a way to make it work: local healthvalue = item.components.edible && item.components.edible.healthvalue It worked when playing alone in my server, but if I'm playing multiplayer or in a game with caves it doesn't work.
  8. Version 0.4.0

    9 downloads

    OmniKey A Don't Starve Together Mod. Add keybindings to use with tools, weapons, armor and much more. Usage Keybindings can be changed in the configuration: Default Key Function G Equip best weapon by damage C Equip best armor V Equip best helmet 1 Equip best axe 2 Equip best pickaxe 3 Equip best shovel 4 Equip best scythe, requires scythes mod H Use best healing item J Eat food Also when unequiping the hand slot using the keybindings it automatically equips a cane if available Installing Download latest release from github
  9. This is my first mod, I'm not sure if it's supposed to be announced here, but here you go: EDIT: https://github.com/danielpza/dst-omnikey OmniKey A Don't Starve Together Mod. Add keybindings to use with tools, weapons, armor and much more. Usage Keybindings can be changed in the configuration: Default Key Function G Equip best weapon by damage C Equip best armor V Equip best helmet 1 Equip best axe 2 Equip best pickaxe 3 Equip best shovel H Use best healing item J Eat food Also when unequiping the hand slot using the keybindings it automatically equips a cane if available Installing Download latest release from github Made in typescript, transpiled to lua. Inspired by Fast Equipment.
  10. Anyway, here is a little improvement on the code, in case someone finds it useful function generateKeys(result, from, to) local s = string.byte(from, 1) local e = string.byte(to, 1) do local i = s while i <= e do local key = string.char(i) result[#result + 1] = {description = key, data = key} i = i + 1 end end end string = "" local keys = {} generateKeys(keys, "0", "9") generateKeys(keys, "a", "z")
  11. Like the selector don't starve provides for changing his keybindings, like attack, rotate etc...
  12. I see a lot of mods generate a list of keys when they want to add a keybinding like so: local FIRST_NUMBER = 48 local FIRST_LETTER = 65 for i = 1, 10 do local ch = string.char(FIRST_NUMBER + i - 1) keyslist[i] = {description = ch, data = ch} end for i = 11, 36 do local ch = string.char(FIRST_LETTER + i - 11) keyslist[i] = {description = ch, data = ch} end Is there a better way to assign a keybinding for your mod?