Jump to content

Malacath

Registered Users
  • Posts

    780
  • Joined

  • Last visited

Reputation

125 Excellent

1 Follower

Converted

  • Modder
    http://forums.kleientertainment.com/user/245716-malacath/?tab=idm

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  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. @TheSlackPack, I can't run it myself right now, I will try later but maybe you can try this: Assets = { Asset("SOUNDPACKAGE", "sound/jake.fev"), Asset("SOUND", "sound/jake.fsb"),} RemapSoundEvent( "dontstarve/characters/jake/death_voice", "jake/characters/jake/death_voice" )RemapSoundEvent( "dontstarve/characters/jake/hurt", "jake/characters/jake/hurt" )RemapSoundEvent( "dontstarve/characters/jake/talk_LP", "jake/characters/jake/talk_LP" )Assets = { Asset( "IMAGE", "images/saveslot_portraits/jake.tex" ), Asset( "ATLAS", "images/saveslot_portraits/jake.xml" ), Asset( "IMAGE", "images/selectscreen_portraits/jake.tex" ), Asset( "ATLAS", "images/selectscreen_portraits/jake.xml" ), Asset( "IMAGE", "images/selectscreen_portraits/jake_silho.tex" ), Asset( "ATLAS", "images/selectscreen_portraits/jake_silho.xml" ), Asset( "IMAGE", "bigportraits/jake.tex" ), Asset( "ATLAS", "bigportraits/jake.xml" ), Asset( "IMAGE", "images/map_icons/jake.tex" ), Asset( "ATLAS", "images/map_icons/jake.xml" ),}You are overriding the Assets in line 10, so I guess the game can not access the sound assets anymore. This is bad, though I can't promise it is the problem. Try combining the tables like so Assets = { Asset( "IMAGE", "images/saveslot_portraits/jake.tex" ), Asset( "ATLAS", "images/saveslot_portraits/jake.xml" ), Asset( "IMAGE", "images/selectscreen_portraits/jake.tex" ), Asset( "ATLAS", "images/selectscreen_portraits/jake.xml" ), Asset( "IMAGE", "images/selectscreen_portraits/jake_silho.tex" ), Asset( "ATLAS", "images/selectscreen_portraits/jake_silho.xml" ), Asset( "IMAGE", "bigportraits/jake.tex" ), Asset( "ATLAS", "bigportraits/jake.xml" ), Asset( "IMAGE", "images/map_icons/jake.tex" ), Asset( "ATLAS", "images/map_icons/jake.xml" ), Asset("SOUNDPACKAGE", "sound/jake.fev"), Asset("SOUND", "sound/jake.fsb"),}RemapSoundEvent( "dontstarve/characters/jake/death_voice", "jake/characters/jake/death_voice" )RemapSoundEvent( "dontstarve/characters/jake/hurt", "jake/characters/jake/hurt" )RemapSoundEvent( "dontstarve/characters/jake/talk_LP", "jake/characters/jake/talk_LP" )
  6. @TheSlackPack, good luck! Let me know if you manage
  7. @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.
  8. @TheSlackPack, three things: 1) Since you did not include the actual sound files (*.wav or *.mp3) I can't fully troubleshoot this as I would like to. 2) You did not use the template this tutorial gives. I didn't do it, it was done by one of the Audio-Guys at Klei, so I don't know how significant the changes re between the default project and that template, I suggest you use the template instead. 3) Since you did not use the template your setup is different than mine. Due to how you structured your *.fdp you need to -- Not thisRemapSoundEvent( "dontstarve/characters/jake/death_voice", "jake/characters/jake/death_voice" )-- But thisRemapSoundEvent( "dontstarve/characters/jake/death_voice", "jake/jake/death_voice" ) 4) Lastly I would suggest that you test your mod-in-dev firstly with all other mods disabled. I'm sure this is not the problem here, but enabling other mods can cause unnecessary trouble due to clashes. When your mod works alone you can still try to add compatibility to certain mods if you need it. So, my suggestion is, just use the template and redo your *.fdp with the help of the tutorial. It's super straightforward and should definitely work.
  9. @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
  10. 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.
  11. 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.
  12. @TheSlackPack, with "post the project" I mean a *.zip file so I can try to run the mod myself. Imho screenshots are not a valid way to troublshoot anything, I can't even see if you have the *.fev file since are hiding known filetypes. Additionally I don't have a *.log file from you, so I can't even understand what problem the game has.
×
  • Create New...