• Content Count

  • Joined

  • Last visited

 Content Type 




Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

Everything posted by Amalleus

  1. Try to look into combat_replica.lua. There is some tagging about shadowcreatures and possibility to attack them. I will edit it tomorrow if you will not find your answer about it yet
  2. I like when people asking question and then answer on it themselves
  3. You may just get some of default (or custom from workshop) character prefabs and see their code. F.e. Wendy has next string of code inst.components.sanity.neg_aura_mult = TUNING.WENDY_SANITY_MULT It reduces sanity decrement from negative auras. But in your case code will be harder. I may write you step by step algorithm how would i make it: Put DoPeriodicTask in your character prefab and in this task scan area around you for prefabs. If prefab would be some player or animals your character would have sanity regen dependent on amount of these matches (or filter it other way). F.e. you have 2 animals and 1 player around yourself then you would have sanity regen increase by your_default_amount*3. And if you will not have any matches under your filter then you will have sanity regen increase by your_default_amount*0 = 0. Since DoPeriodicTask runs code every X seconds this would mean logic will be like that: inst.mysanityregen = 0 inst:DoPeriodicTask(0.2, function() --1. delete previous sanity regen amount. inst.components.sanity.dapperness = inst.components.sanity.dapperness - inst.mysanityregen --2. filter your entities around you how you like it and -- calculate your new sanity regen amount. inst.mysanityregen = ....... --3. Finally apply it to your character. inst.components.sanity.dapperness = inst.components.sanity.dapperness + inst.mysanityregen end) I hope this would help you.
  4. 1. don't put component ("finiteuses") on your weapon and it will be infinite. 2. put your item prefab in your character inventory on start.
  5. it is not another error. it is same error but on 21 line. can't you really read it?
  6. Costumes which you get from presents? No it won't be deleted. It is steam items. This error message like you wrote doesn't seem like error message. Get us Documents/Klei/DontStarveTogether/log.txt to see what caused crash. But first imitate it and just after it will crash send us this log.txt
  7. so check all your { and }. it must be beginning { and closing }. error log says that you lost closing } on line 7. since formatting is weird i can't normally read this code
  8. no good formattin and no crash log. sorry. for formatting use "code" <> sign. and log.txt is in documents/klei/dontstarve/
  9. I would give you one advice - never move anything in spriter .scml file and save. Animation will be broken in game since it works weird. Try to draw it like you see.
  10. AoE will be something like that: local pt = TheInput:GetWorldPosition() local ents = TheSim:FindEntities(pt, 4) for k, v in pairs(ents) do --filtering entities by your choise --and applying your spell end this is in Spell function
  11. bump. Really need help with this. Projectile:RotateToTarget seems not working on my picture. It might be depended on pivot or something else
  12. This will refer to host. And AddSimPostInit initializes on current player itself
  13. Could you also drop us your green_backpack.lua? GiveItem doesn't see the item which you gives to it as argument. probably SpawnPrefab doesn't summon your green_backpack
  14. 1. Get entity under your cursor and if it will be player then do stuff which you need. (Point) 2. Get your cursor position and find entities in these position in some radius. Filter these entities and if it will be player then do stuff which you need. (AoE)
  15. Hello. I occured some strange problem while exploring how to make animation. I made custom picture. Let's say it is a campfire fire (attached file). When i try to use it, it doesn't rotate like dart from blow dart. Dart is always directed to target but my animation picture is always forwarding right since i painted it and posted in sprite like so. BUT blowdart dart is forwarding same direction in sprite like my picture and it is rotating! Dart fly uses inst.AnimState:PlayAnimation("dart_pipe") And my animation is actually "action-animation" which uses next code ....... --making function of action "throw" projectile myaction.fn = function(act) act.doer.AnimState:PlayAnimation("throw") act.doer:DoTaskInTime(7*GLOBAL.FRAMES, function() local projectile = GLOBAL.SpawnPrefab("campFire_projectile") projectile:AddComponent("weapon") projectile.components.weapon.damage=0 projectile.Transform:SetPosition(act.doer.Transform:GetWorldPosition()) projectile.components.projectile:Throw(act.doer, end) return true end AddAction(myaction) Am i doing it wrong way? Is it possible to rotate it directing target?
  16. Crash doesn't appear yet. Probably it is fixed, but ofcourse i not sure, because it appears randomly. But still, after adding lines to modmain no crashes happen
  17. as Kzisor said, you better to not overwrite. Just modify some strings, functions etc. which you want. That's how f.e. AddRecipe works - it just modify recipes (adds one more), but not overwrite the whole file. + you can replace the whole function with your custom one, or just replace some strings. f.e. Spear uses is 150 (can't remember). You may add strings to just increase uses: inst.components.finiteuses:SetMaxUses(TUNING.SPEAR_USES * 2) inst.components.finiteuses:SetUses(TUNING.SPEAR_USES * 2)it will replace the old strings
  18. I used load and save functions for my character and they work fine. Save - only when you come out of server. Load - only when you join the server. So, save doesn't work on joining for me, probably you have bug
  19. another crash without this line. I thought if client can't find .tex or/and .xml of swords then i will add them to Assets in modmain.lua (I don't yet know if it will fix the problem), have no time to test right now EDIT: attached file
  20. this is just pointers. In this example: Inst points to the item. Owner points to the guy. Components points to "folder" of components. Talker points to specific components - not every entity has it, like item can't have Health component (so you can't use for item) :Say - function from component Talker, you can read about it, what it does
  21. I doubt that the error because of this. But i will try to change and test. Any other thoughts? or only this EDIT: Still crashing, even after posting it before. error as previous, no atlas/texture :
  22. Hello. I have 2 custom items, difference is just in OnAttack event and tags. Here is the code of one: So, about the problem. This item was put in Chester. After about one day, my friend opened chester and got error: - this happen if somebody open Chester with this custom item, but not host. Host is fine. Sometimes this error not appear. F.e. if i reload server after this crash, guys can easily open and close chester with item. Anybody knows, why it can't find texture/atlas ? And yes, i have all .tex and .xml
  23. Thank you for help. Yesterday i thought about save/load functions, and i found solution without spells. First of all, the potion is possible to use by certain character. So, oneat function of potion i added eater.potionresttime = 60--+ more hunger lossand in character inst i added: inst:DoPeriodicTask...... --every 1 second restores health and decreases inst.potionresttime by 1 --when inst.potionresttime == 0 then return previous hungerrate and stop decreasing of variablesave/load functions loading and saving potionresttime
  24. Am i right that ThePlayer - is always the host player and not the current? But what about choose somebody else? And sorry, I just started to understand DST programming =/
  25. yes, you are right. but i have several items (not only this item) which using "spell" - i don't want to lose effect after reloading. also i need functions OnStart OnFinish and SpellFunction to make some manipulations As i can see, OnStart and OnFinish is in the OnTarget function. Hm... you have pretty nice algorithmical thinking. I think this code will work. I will check EDIT: there is no resume function. so after reloading spell just dissapears and that's it