Malacath

  • Content Count

    780
  • Joined

  • Last visited

 Content Type 

Profiles

Forums

Downloads

Klei Bug Tracker

Game Updates

Hot Lava Bug Reporter

Everything posted by Malacath

  1. Of course, i got it... It's a tiny bit more complicated than your previous problems... a tiny bit meaning hugely xD The lootdropper is usually triggered when the entity goes into its "death" state. Since you don't have a stategraph at the moment you don't have anything that triggers it. It's advisable to use a stategraph later on, I think Cheerios creature tutorial is the best thing to start for that. But for now you can listen for the event death and then trigger the lootdrop, like inst:ListenForEvent("death", function(inst) inst.components.lootdropper:DropLoot(inst:GetPosition())end)EDIT: You might want to download _simplex_testing from simplex which enables DebugKeys and let's you kill everything by pressing CTRL+K (don't know the Mac equivalent) while hovering over it.
  2. Sorry, simplex taught me to use _G instead of GLOBAL so I have _G = GLOBALat the to of every modmain. So you can replace it with GLOBAL in your code. I don't see right now why it doesn't drop its stuff right now. If you want to upload the whole mod I can see if I find the problem.
  3. You can either write everything directly inside the code or you set up a tuning file similiar to the strings file. a) inst:AddComponent("health")inst.components.health:SetMaxHealth(300)b) inst:AddComponent("health")inst.components.health:SetMaxHealth(TUNING.RAT_HEALTH)And additionally the file "tuning_yourmod.lua" NEWTUNING = { RAT_HEALTH = 1,}return NEWTUNINGAnd in modmain TUNING = TableMerge(TUNING, GLOBAL.require("tuning_yourmod"))If you have defined the function TableMerge further up the code, which you will have done when you added the strings. Again, it looks like b) is a lot more complicated. But it allows for so much easier balancing and finetuning that I think it is totally worth the effort.
  4. ...those little things I always missed. Look at the last line return Prefab( "common/inventory/cable", fn, assets, prefabs)Here you're passing over the variable prefabs which was never declared. You don't need it so you can delete it from there, not the line, just the prefabs, like so return Prefab( "common/inventory/cable", fn, assets)
  5. Yes, that's where you'll need to put the png. Well, that sliver of code you posted is what I abbreviated with "load the assets" xD The thing I posted needs to be beneath inst:AddComponent("inventoryitem")And concerning the animation everything works the same as for the rat. Put it in "exported/anim/cable/" for example
  6. Actually, adding the artwork for the item should also be done in Spriter, so you don't need any tools but the Mod Tools. And once you get the hang of it you'll finish the conversion for a single prefab in mere minutes. The prefab looks fine for me, assuming that "cable.zip" actually exists of course ; P What you'll want to add though is the inventoryimage. Load the assets (image and atlas) and use inst.components.inventoryitem.atlasname = "images/inventoryimages/cable.xml"inst.components.inventoryitem.imagename = "cable"And the tex and xml are created by the Mod Tools if you just put your png into the right place.
  7. You can basically copy the contents of GENERIC (which is what you did, so yeah...) And what do you mean with "And how would I go about adding more prefab descriptions in the future?"? If I understand you correctly you mean: How do you add the strings for new prefabs? In that case you'll want to do modify the DESCRIBE table like this DESCRIBE = { RAT = "Look, it's a rat!", NEWPREFAB = "That's new....",},So you'll really just add a new line with the key, that's the thing before the =, being the name of the new thing in all caps and the value, after the =, being the new quote and then finish it off with a comma Same way you'll update the NAMES table.
  8. One of the most important (in my opinion the most important) things in lua is are tables. Find a good text somewhere which explains how tables work (this should be a good starting point) Because all strings are stored in a table called STRINGS. This table has a certain structure so that when you add the "inspectable" component (yes you still need it) everything get's hooked up properly. And I basically rebuilt that structure in that file so it all fits nicely. And string is a specofic data-type, which is also important to understand when coding. In Lua there are the following data-types -nil This is basically the type that means exactly "This is nothing", it's quite useful you'll find out ; ) -number Self-explanatory, they consist of 0-9 and a single dot -boolean Either true or false -string Always denoted by the " around it. Basically this is just text. -table Anything with the { } is a table. You can store any types of data in a table (also other tables) -function Well, a function is everything which you can call by putting brackets behind it like AddComponent for example I hope that wasn't overkill for you. But you basically already came in contact with each of those in one way or another and understanding them to a certain degree is important, but that should work out ; )
  9. For a bigger mod it's probably more convenient to create a file for all your strings instead of overwriting every string directly in the prefab. EWSTRINGS = { NAMES = { RAT = "Clockwork Vermin", }, CHARACTERS = { GENERIC = { DESCRIBE = { RAT = "Look, it's a rat!", }, }, WILLOW = { }, WOLFGANG = { }, WOODIE = { }, WICKERBOTTOM = { }, WENDY = { }, WX78 = { }, WAXWELL = { }, },}return NEWSTRINGS This is the basic layout of the file, just call it something like "strings_yourmodname.lua" and put it directly into the scripts. In modmain you'll want to add these lines: local function TableMerge(t1, t2) for k,v in pairs(t2) do if type(v) == "table" then if type(t1[k] or false) == "table" then TableMerge(t1[k] or {}, t2[k] or {}) else t1[k] = v end else t1[k] = v end end return t1endGLOBAL.STRINGS = TableMerge(GLOBAL.STRINGS, GLOBAL.require("strings_yourmodname")) Now you can add all the prefabs you create in all caps into the list of NAMES and DESCRIPTION for each character if you want. Just always think about adding commas of the end of the line when adding elements to tables EDIT: For a small mod it's also enough to do something like local STRINGS = GLOBAL.STRINGSSTRINGS.NAMES.RAT = "Clockwork Vermin"STRINGS.CHARACTERS.DESCRIPTION.GENERIC = "Look, it's a rat!"EDIT: And about that hitbox. It's a currently missing/buggy feature of the exporter. We shouldn't see anything change there until it's properly ported to Mac and Linux. So right now we'll have to deal with tiny boxes ; )
  10. So on running the game on your Windows PC with the mod inside the mods folder of Don't Starve you get a command line window?
  11. Well, you can put the automatic equip of a shovel directly into the fn, before any return statement of course ; ) And as for the string you can add STRINGS.CHARACTER.GENERIC.ACTIONFAIL.WHATEVERYOURACTIONISCALLED = "The ground is to hard here."Should do the trick.
  12. Take a look at bufferedaction.lua The function Do() is the part which will eventually call the ACTION.fn. I don't know what exactly you want to accomplish so I don't know what else to say : P
  13. C:\Program Files (x86)\Steam\SteamApps\common\dont_starve\mods\Something like this.
  14. That's a very dapper way of avoiding your demise : D It's great. I'll probably use it for some mod testing. But to be honest, I share your sentiments about permadeath being an integral part of the experience.
  15. So I loaded a save from Survival 1-1 and landed in Adventure 2-1. The thing crashed soon enough because I was testing a mod and it didn't happen again, but I thought you might want to know.
  16. That's not a job anyone should have to do. Why don't you ask a Windows user to convert them quickly? I'd be happy to do so when asked since it's just a minutes work, but I'm not reliably available I guess. Just think about it and whenever you need a big bunch of stuff converted summon me ; ) EDIT: I think I misunderstood that post xD Nevermind me...
  17. Okay, you win that one ^^ "Woooo" for 20k posts!
  18. Well... I thought that was counted as well.. but it was a nice coincidence with the numbers
  19. It says 19543 for me, what am I missing?
  20. None of the tutorials Cheerio linked in his thread should be incompatible ith the current version. Also not the sample mods, I use them myself so I'm qiute sure they are fine. But if you have a problem with a tutorial the best idea is to post on the respective thread anyways.
  21. Of course that would work but I don't feel that's worth if for 11 lines of code ; )
  22. I just mean there has to be one mod which overrides IsCharacterUnlocked so that mod must be anabled no matter what. That would either mean everyone who wants to play with Waverly will also have to enable the additional mod or everyone who wants to play with, let's call him, Wilfred has to enable the Waverly mod whihc contains the override of IsCharacterUnlocked
  23. I was trying exactly that before reverting to my old solution. I have no clue what stupid things I did but I got only this in log.txt Forced aborting...So I was really scared and left that idea alone. EDIT: And it would also require that the basic mod which overrides the function is enabled which will make things more complicated