Amalleus

  • Content Count

    63
  • Joined

  • Last visited

Community Reputation

13 Good

About Amalleus

  • Rank
    Junior Member
...

Recent Profile Visitors

687 profile views
  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, act.target) end) return true end AddAction(myaction) Am i doing it wrong way? Is it possible to rotate it directing target?