• Content Count

  • Joined

  • Last visited

 Content Type 




Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

Everything posted by Malacath

  1. @ZupaleX, I'm confused as well. Never did that and still don't do it. But I will write it in the tutorial to make sure noone has problems. @BaconAndRibs, yes, an EventListener is definitely more efficient. But I don't know if an according even is pushed anywhere in the code, so it's up to you to either find that event or use PostInit's to create it yourself.
  2. @BaconAndRibs, the only thing I can think about is modifying the player stategraph or doing a periodic task to check every frame. But I don't really have the time to try it myself. If you try it with a task then don't forget to cancel the task. -- In OnEquipinst.task = inst:DoPeriodicTask(0, UpdateAnim)-- In OnUnEquipinst.task:Cancel()isnt.task = nilAnd function UpdateAnim will check the facing and change the animation accordingly. It's easy but really suboptimal. @ZupaleX, that's only if you want to ovveride the default pivot, which is not necessary if you want to make just a weapon. If you want to do an armor or helmet then you need to do it.
  3. @BaconAndRibs, it doesn't work because you are accessing the same entity all the time. In your code there is only one inst, and I assume that that is the weapon since you (presumably) don't crash on inst.components.equippable:IsEquipped(). So instead you want to get the owner local owner = inst.components.inventoryitem.ownerAnd access the AnimState of this guy.
  4. @DerpTime, as long as the lootdropper component is not being removed on death, which I am pretty sure it isn't, then I don't believe you need to worry about that. So in general anything that you slap onto the player prefab stays there when the player dies. And since data.afflicter is the is the entity of what killed the player you can use most of DarkXero's code. Instead for checking in the table valid_murders you can instead check for tags of data.afflicter and decide upon that. And if I understand your dagger correctly, then you can either use DoTaskInTime after adding the tag to the target, there are many examples of this in the code, or you can listen for the event "losttarget". See what is more convinient for you and go with it. @DarkXero, I don't know what you mean. The code that I posted was a purely didactical example not meant to be ever used in anyone's code. So I don't see a problem with anything I did. And using _G is not actually a "bad habit", it just makes for more natural coding for me when using Lua.
  5. @Aurata,not really. There are many small things that could have gone wrong, so check every little detail with the tutorial, folder structure, spelling mistakes, and also check the log file. A common mistake is the following folder structure: mymod\exported\myitem\swap_myitem\swap_myitem\swap_myitem.png There is twice a folder named "swap_myitem" and that has to be like this! If you don't manage after sincerely trying you can upload the mod in a *.zip file and I can take a look.
  6. @BaconAndRibs, from my understanding you would need multiple files since the scml-compiler will create only one swappable anim file from one scml. If you manage with one file let me know though
  7. If you mean that A and B should be specific player/prefabs, the event "death" get's pushed with some data, see health.lua: self.inst:PushEvent("death", { cause = cause, afflicter = afflicter })So you can listen like this: _G = GLOBAL // A habit, I keep it in this post so the other posts makes sense ^^ inst:ListenForEvent("death", function(data) if data.cause == _G.ThePlayer then inst.components.lootdropper:DropLoot(inst:GetPosition()) end end)I can't promise you that cause will give the prefab that caused it, or if it says something like "combat" but I'm sure with some trial and error you will find out. Maybe you'll want to use afflicter instead.
  8. This clearly says that there is something wrong in your modmain.lua at line 45. Additionally this seems to me like you did something wrong with a filepath, maybe misspelled? Since you are adding a recipe it could simply be that the game is trying to open a file for the little recipe icon. So you possibly need to fix that. If you can't manage it you should probably post your modmain.lua alongside the error. Also in general be more descriptive when asking for help, on other sites people might not bother to answer if there is literally no information given. Tell us what you are trying to do, what you tried to fix it, what results you had from your own attempts, etc.
  9. @DarkXero, lots of "No"'s That's why it's important for me to ask. Thank you immensely for explaining me all of this! And sorry for making you explain all of this! When I was searching I couldn't really find some of the information you gave me in such a clear language, so it really helps a lot. And yes, since I am essentially recreating a crafting menu-of-sorts I am positive that I can reuse quite some existing code. And to summarize in short, more for myself: -Use the technique given up there to PushScreen on Client -Use Netvars to properly handle all screen elements and Client interaction -Use SendModRPC to tell the server the results of the Client interaction
  10. @Corrosive, Thanks for helping many many people in my abandoned tutorials! You're awesome @BaconAndRibs,unfortunately: No and no. Both could in theory be achieved by completely recreating the animations and using different symbols. But the amount of work to do for both of these is immense and I am not even going to attempt it. The second can also be achieved by swaping the symbol in the code, using some PeriodicTask and swaping every now and then. But that is tedious as well and needs to be hardcoded, an artist is not going to enjoy that. Both options are not really optimal, I would not do either (at least not a second time xD)
  11. @DarkXero, cool, first and foremost thank you a lot! I feel like my beginnings in DS modding though, so if you don't mind I will try to be more specific and ask some more question. Essentially what your code does is call the function doFunc for the respective player when attacking with a spear. Good so far? inst.pushmyscreen = GLOBAL.net_event(inst.GUID, "player.pushmyscreen")This registeres a network event on the player classified. Using the player classified here because it is designed for this I guess? if not GLOBAL.TheWorld.ismastersim then inst:ListenForEvent("player.pushmyscreen", doFunc)endThis here just because we can handle the serverside call of doFunv explicitly, like you mention later. attacker.player_classified.pushmyscreen:push()This is "essentially" resulting in a call of attacker:PushEvent("player.pushmyscreen") on the clientside? But can I easily pass data as one would expect? data = {target = target}attacker.player_classified.pushmyscreen:push(data)Resulting in something like attacker:PushEvent("player.pushmyscreen", data)? Then I can PushScreen in doFunc, needing to pay attention with that screen in may case because it accesses players components and what not. I guess I will need to tinker a lot here, but essentially I can just attach some more net_vars to player_classified and use those to communicate between server and client of what I need to properly represent the screen. Or is it a bad idea to clutter player_classified with more net_vers? Maybe there is some more appropriate way to do this?
  12. @DarkXero, to be honest, that is still a bit to vague for me. Do you know where I could see something similar in action? I just started looking into DST modding on thursday last week, so I am not really familiar with replicas. But if that is a safe way to do it I will need to learn it I guess.
  13. I wanted to port just one Mod from DS to DST. As expected I found a lot of difficulties, but except for this one I could luckily manage to solve them all by myself. What is happening in this mod is that a prefab has a component from which (on activation) a screen is opened via TheFrontEnd:PushScreen(...). Naturally though this pushes the screen to the server instead of the appropriate player (the activator). I was searching through the code and could not find an instance where anything else than PushScreen was used, neither did I find any indication of "switching" to the appropriate player before pushing screens. I also checked the screen codes themselves to see if my screen might be missing anything that could relate. Everything to no avail unfortunately. Can anyone point me in the right direction? I don't want any fleshed out code (unless necessary), just clues, maybe other mods that do something similar, etc. If I could manage pushing the screen there I woul "just" need to send whatever happens within the screen to the server, but I have a much better idea of how to do that.
  14. It's just one line at the end of your items file, i.e. return Prefab( "common/inventory/spelltome", fn, assets), MakePlacer("common/spelltome_placer", "spelltome", "spelltome", "idle")Where the strings are Bank, Build and Animation. Edit: That question doesn't really fit in this thread. You can search the forums or create your own thread instead when you have a question.
  15. You can simply upload a *.zip file to a post you make by choosing "More Reply Options". I will not check out your file for now, I don't want to create an account on the website. But as Foxrai said in the post bellow, if you follow my tutorial exactly then you will succeed. I skipped over that part. But pretty much every other mod you can download gives an example of how to do that. The easiest route is to add directly into modmain GLOBAL.STRINGS.NAMES.MY_ITEM = "Name Of My Item"Note that the name of your item has to be in capital letters here. And as for the recipe image, I know that it works like this and it is not necessary to add a second image for the silhouette. Since the image contains alpha information the engine simply blackens all the non-transparent parts. You can upload your mod if you want, but in general this thread is not really the place for that. I am alos pretty sure that you can find a topic that already settled this problem somewhere on the forums. EDIT: In fact you find a LOT of those threads. Here's one of the first threads that explain it
  16. @Foxrai, when you have multiple mods that work independently of each other you pretty much just need to merge their modmain.lua in an arbitrary way (I mean it doesn't usually matter where what goes) and modinfo.lua and copy all other files over. Regarding the Hound Mound you will have to create an image for since the hound mound only has an animation and that can't be used (not as far as I know at least) for displaying in the crafts tab. So just copy the hound mound from the atlas of the animation and put it into, for example, "hound_mound.png". Then you'll need to use the code as follows local houndmoundrecipe = GLOBAL.Recipe( BlahBlahBlah) -- this code you already havehoundmoundrecipe.atlas = "images/hound_mound.xml"
  17. Version 0.0


    This is just a sample of a spriter file which creates an anim that is compatible with hats.
  18. Scaling the image inside Spriter will not work since the game engine takes only the symbol inside the player animations and replaces it by the image you created. This means that the player animations determine the size of the image (as is the same for position and rotation, for these it is just more obvious) This means that if you want a bigger item in your hand you will need to scale up the image file.
  19. What you need to do is rename the entity to "swap_swissblade" and the animation to "BUILD", both inside spriter. It's explained in the tutorial, thus I don't see the need upload the version I made (which I already deleted anyway)
  20. @irongollem, I can't help you here. In the file you uploaded you still didn't correctly set up the swap file and when I do it then the autocompiler converts it and it works ingame (baring the issue that the pivot is off).
  21. I'm sorry, but I don't know why your autocompiler freaks out, the only thing I can suggest is to reinstall them. As for the scml files you created, I converted them and one works the other doesn't, but I will just assume you didn't finish the swap file yet. Since you got the invimage working I guess you also figured out why it was complaining about "swissblade" not being found. And lastly, the console just swallows some letters for me too recently.
  22. If you have a problem please provide your files, otherwise it is nearly impossible to give you proper help.