Jump to content

Recommended Posts

Mip-mapping is good to check because ipsquiggle has said so, but probably less important.What mip-mapping does is it creates various scaled down images of the texture to store along with it. This means that it can create better looking images at smaller sizes. If the mipmaps aren't generated, then it is up to your video card to either create them or do extra work when they resize the images.Since it's unusual for a texture to be seen at a much lower resolution than it's created at, it's probably less important. However, if that does happen, it could lead to ugly or incorrect looking scaling. Video cards will mostly handle this fine. However, you'll probably get more reliable results if the mipmaps are pre-generated. I'd still check it though, it will make things work more reliably and doesn't hurt anything, except maybe make the file slightly larger.

You are so nice to teach me such things! I used to be confused by them but it's much better now. And someone told me that the white lines generated and something else got wrong because the image is bigger than 15KB, is it right?

Oops, I'm sorry.

http://rapidshare.com/files/618663850/armor_sanity.zip

http://rapidshare.com/files/1368123724/swap_nightsword.zip

http://rapidshare.com/files/3035861950/nightsword.zip

Edit: Well, I did edit the files thousands times and not sure whether the screenshots come from the files, but at least the armor_sanity one.

Here Downloads

post-34080-13764595170467_thumb.jpg

Hello :)I added an item to restore sanity. It uses a recipe to create it. Everything works so far (the ingredients are used) - but Wilson can't pick it up (?) He keeps saying "I can't do that" every time i want to create the item ?Edit:It works now, but the inventoryimage is not available :/

Edited by mautschi

Hello :)I added an item to restore sanity. It uses a recipe to create it. Everything works so far (the ingredients are used) - but Wilson can't pick it up (?) He keeps saying "I can't do that" every time i want to create the item ?Edit:It works now, but the inventoryimage is not available :/

Make sure that there is a texture called inventoryimages/prefab_name.texMake sure it's defined as an asset in modmain like:
Assets = {	Asset("IMAGE", "inventoryimages/prefab_name.tex"),}

Hello :)I added an item to restore sanity. It uses a recipe to create it. Everything works so far (the ingredients are used) - but Wilson can't pick it up (?) He keeps saying "I can't do that" every time i want to create the item ?Edit:It works now, but the inventoryimage is not available :/

I have the same question. Maybe the problem of one of the anim files or the image files will cause its happening.

Make sure that there is a texture called inventoryimages/prefab_name.texMake sure it's defined as an asset in modmain like:

Assets = {	Asset("IMAGE", "inventoryimages/prefab_name.tex"),}
And what about having an inventory image but no "on the ground" image?It drives me nuts that it won't work...Edit: I have of course made an asset for the anim/prefab.zip and the game doesn't seem to care about not finding an image Edited by Malacath

The on the ground image is going to be an anim. You need to set the bank and build and play an animation.Take a look at grass.lua:

local assets={	Asset("ANIM", "data/anim/grass.zip"),}local function makefn(stage) local function fn(Sim)--snip--local anim = inst.entity:AddAnimState()--snip--anim:SetBank("grass")anim:SetBuild("grass1")anim:PlayAnimation("idle",true)--snip--end end
For live grass it's that.For picked grass it does;
inst.AnimState:PlayAnimation("picked")
It works the same way for an inventory item as a world item. It uses the tex in inventoryimages for the inventory itemtile as well as the recipe tab, and it uses the anim for the worldentity. You need to have an anim, have the asset declared in the Assets table, load it, set it's bank, build, and play an animation when the prefab is initialized.

You need to set the bank and build and play an animation.

Geez, I even hadinst.AnimState:SetBank()inst.AnimState:SetBuild()in there and didn't fill in the parenthesis xD Thanks a lot! without your help I would've overlooked that for at least another two hours ^^

Hello guys , im new to this forum and to modding dont starve. I have to say ds is such an amazing game and i alrdy have some very nice ideas and plans going on. Couple of questions though first. Is there some sort API I could find to know which functions mean what ,and are there any coding suggestions or modsuggestions in general? thx! :)Any ideas / suggestions for luacoding? Books ,links?

  • Developer

@Ipsquiggle

Can you separate, presets from levels.lua file?

It would be good if presets were in separate file so we don't have to overwrite whole levels.lua file and can make custom preset a little easier to handle.

Does this do the trick for you?

-- modmain.luaGLOBAL.require("map/levels")-- find an existing preset:local darknes = nilfor k,level in ipairs(GLOBAL.levels.sandbox_levels) do	if level.id == "COMPLETE_DARKNESS" then		darkness = level		break	endend-- do some kind of modification, like adding a new tasktable.insert(darkness.tasks, "Guarded For a nice walk")-- add a preset:local my_preset = GLOBAL.Level({	id = "MY_PRESET",	name = "My lovely preset!",	tasks = {			"Make a pick",			"Easy Blocked Dig that rock",			"Great Plains",			"Guarded Speak to the king",	},})table.insert(GLOBAL.levels.sandbox_levels, my_preset)
  • Developer

Hello guys , im new to this forum and to modding dont starve. I have to say ds is such an amazing game and i alrdy have some very nice ideas and plans going on. Couple of questions though first. Is there some sort API I could find to know which functions mean what ,and are there any coding suggestions or modsuggestions in general? thx! :)Any ideas / suggestions for luacoding? Books ,links?

Hey, welcome to the forum! :)Depending on your level of skill: If you've programmed before in other languages, the Lua Manual is a good place to start for understanding the language. http://www.lua.org/manual/5.1/If you've never programmed, I recommend http://www.codecademy.com/ for an introduction to the basics.As far as the Don't Starve API, well, there isn't really one... modders have access to basically any function in the game, so the best way to learn is to find an existing object in the game or a mod that's similar to what you envision, and start picking it apart. Start with something simple, not your boldest plan, and see if you can make it happen. As you work with the system it'll start becoming more clear to you how things are accomplished and where to look for functions and features.Also, don't be afraid to ask specific questions in these forums!

Does this do the trick for you?

-- modmain.luaGLOBAL.require("map/levels")-- find an existing preset:local darknes = nilfor k,level in ipairs(GLOBAL.levels.sandbox_levels) do	if level.id == "COMPLETE_DARKNESS" then		darkness = level		break	endend-- do some kind of modification, like adding a new tasktable.insert(darkness.tasks, "Guarded For a nice walk")-- add a preset:local my_preset = GLOBAL.Level({	id = "MY_PRESET",	name = "My lovely preset!",	tasks = {			"Make a pick",			"Easy Blocked Dig that rock",			"Great Plains",			"Guarded Speak to the king",	},})table.insert(GLOBAL.levels.sandbox_levels, my_preset)
Thank You.What else is in that GLOBAL thing?From the time the whole mod system got implemented we got this:GLOBALTable that points to the global environment of the gameWhat is in this global environment?
  • Developer

Thank You.What else is in that GLOBAL thing?From the time the whole mod system got implemented we got this:GLOBALTable that points to the global environment of the gameWhat is in this global environment?

So I had to rearrange some world gen stuff, but in the next version you'll be able to override and add presets like that. For the time being you just have to brute-force it, sorry.Basically we run modmain.lua in it's own global space. It makes it easier and quicker to do common mod-specific tasks, and also makes it harder for mods to accidentally overwrite data from the main game.So there are two environments, like this:
GLOBAL            YOUR MOD======            ========a = 1             a = 2print(a) -- 1     print(a) -- 2                  print(GLOBAL.a) -- 1
So if you want to use or set something that exists outside of your mod, you use GLOBAL to say, "yes, I actually mean to set this in the main game."

This is similar to how WX78 works, and how Wolfgang works. Have a look at them for a start.

From WX78 this gives him his perk: inst.components.eater.ignoresspoilage = trueBut it's limited to food that didn't turn into rot. Idon't know how to make rot give hunger to my character.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...