Jump to content

(Un)Official Small modding/programming questions thread


Rosten

Recommended Posts

Hopefully this'll help reduce the clutter of random questions in the mods subforum

Well, this is pretty self explanatory, I've made a thread where people can ask small(ish) questions about modding (for instance, questions which would require only a couple of sentences to answer rather than a long winded debate) 

Rules are:

1 - No asking people to write code for you, asking for help with something is fine, but don't expect someone to write out your mod in full

2 - Try to refrain from asking questions that will span over 5-6 posts, if your question is that large, then you should either take it to PM with someone, or make a new thread for it

3 - No "how do i get into lua?" questions. There are tons of resources online that'll help you start programming all it takes is a google search.

4 - Anyone can ask questions, and anyone (provided they know what they're doing) can answer them

5 - Please no derailing

 

Sound good? Alright, then, let the questions commence!

Link to comment
Share on other sites

Hm... Usually these threads get abominal quickly, but let's give it a shot. The modding section is rather serious anyways.

 

What does AnimState:OverrideSymbol do? More precisely, does it slap a texture over the prefab, or change the prefabs current anim-state? And if the former, how does one undo that? (the latter, you'd just play the default animation, I guess) There is a AnimState:ClearOverrideSymbol in wilson.lua, so I guess this falls through.

 

For reference, I found that thing in bird traps (idk what it's for), as well as runic statues (gems).

 

EDIT: It's called OverrideSymbol, not OverRide...

 

EDIT2: Solved one question myself, due to its appearance in wilson.lua

Link to comment
Share on other sites

Extremely new to modding.

Well noone has posted here, so Im giving it a shot. I wanted to make may character eat certain foods. I found how I need to do that, but I don't necessarily know where I put the component line in. Do I just put it in my main LUA? or Does it go somewhere else? And does it matter where I put it in? 

Link to comment
Share on other sites

What does AnimState:OverrideSymbol do?

 

As I understand it, it replaces a single sprite within an animation.  It leaves all other animation data intact (which makes sense, because if it didn't, you'd have to re-animate every action of every character when you wanted to make a custom body-equipped item, for example.)

Link to comment
Share on other sites

Extremely new to modding.

Well noone has posted here, so Im giving it a shot. I wanted to make may character eat certain foods. I found how I need to do that, but I don't necessarily know where I put the component line in. Do I just put it in my main LUA? or Does it go somewhere else? And does it matter where I put it in? 

 

I'm unclear on exactly what you're wanting to achieve... do you want a character to be able to eat ONLY certain foods, or do you want them to be able to eat items that normally aren't considered foods?

Link to comment
Share on other sites

I'm unclear on exactly what you're wanting to achieve... do you want a character to be able to eat ONLY certain foods, or do you want them to be able to eat items that normally aren't considered foods?

Only eat certain foods, :

 

function Eater:SetVegetarian()
    self.foodprefs = { "VEGGIE" }
end
 
Think that's what I need to put in the main lua file, right?
 
LOL, being new, I have 30 tabs opened trying to find answers to all my questions. I learn a few things everyday, while I fail at getting my toon together, which is making me better, since I troubleshoot all my stuff. (been working on it for about a week now, 4-6 hours or so a night.)
Link to comment
Share on other sites

This will be easier. 

So, I started making a Flapjack representation for Don't Starve and DST.  Right now I'm learning how to make him customized to his persona as best as I can. Since in the show, he only eats candy, I assume he would only be a vegetarian. On top of that I want his sugar type food (berries, honey and advanced food recipes) to give him a sanity boost. While other foods decrease his sanity.

Right now I'm using Dana's basic tutorial, and I've ran into a few iissues, mostly because since it was written, there have been updates on how Don't starve is modded.  But that's irrelevant right now, since I'm learning very basic concepts at the moment. 

 

Once I feel comfortable about FlapJack being a basic character, I plan on adding a container pet (knuckles) as well. Once I get to that point, I plan on diving a little more into item creation, since I want to get him his own crafting recipe for candy mugs, and his bottle of syrup that he drinks regularly on the show. 

 

So I just basically have questions on where to put the stuff, or find tutorial resources for now. I plan to fail alot, since this is my first attempt, but honestly when it comes to learning to mod, failure sometimes is the best way to learn how something works (or doesnt work depending)

 

But I do want to hurry this project up a bit, I'm doing this for my step daughter. My wife wants me to do a toon for her, and at some point I want to work on my own creation for DST.  Either or, I have been enjoying creating, but I'm so brand new out of the box, I get confused easily. So noone jiggle anything shiny this way, It'll distract me!

 

 

Link to comment
Share on other sites

 

function Eater:SetVegetarian()
    self.foodprefs = { "VEGGIE" }
end
 
Think that's what I need to put in the main lua file, right?

 

 

Eater is a component, which means that it gets added to your prefab's components table.  I haven't made a custom character before, so I can't guarantee this will work, but I'm fairly sure it should.  That "foodprefs" variable is what you're interested in. You can modify it in (your equivalent of) this function from the sample character mod:

local fn = function(inst)        -- choose which sounds this character will play    inst.soundsname = "wolfgang"    -- a minimap icon must be specified    inst.MiniMapEntity:SetIcon( "wilson.png" )    inst.components.eater.foodprefs = { "VEGGIE" }end

Note that you'll still have the "eat" option on non veggie foods, but your character will refuse when you try, stating that he can't eat it.  If you would prefer to remove the eat option from other foods, also add inst.components.eater.ablefoods = { "VEGGIE" }

 

Personally, I would change foodprefs to be { "VEGGIE", "SEEDS" }, unless your character objects to eating baby plants.

 

Edit: forgot code tag

Link to comment
Share on other sites

Eater is a component, which means that it gets added to your prefab's components table.  I haven't made a custom character before, so I can't guarantee this will work, but I'm fairly sure it should.  That "foodprefs" variable is what you're interested in. You can modify it in (your equivalent of) this function from the sample character mod:

 

Thank you so much for your help! 

Link to comment
Share on other sites

I'm very new to this and have been getting through mostly by comparing other things to my current set up (and dumb luck). I have found a problem I've failed to find anywhere else though:

 

Increasing fire damage for a specific character.

 

I'm customizing a character who dislikes heat, but likes the cold. I gave him permanent insulation (60) so that during summer he should overheat quicker, and during winter he should freeze a little slower. My only issue with that is in non-RoG it is not a downside, only an upside. So I wanted to increase fire damage on him so it could at least pose a potential problem there.

 

Thank you for any help you can offer in advance.

 

P.S. There is more to the character than that, but this is my current stumbling block.

Link to comment
Share on other sites

scripts/modindex.lua(386,1) Could not load mod_config_data/modconfiguration_FlapJack
scripts/mods.lua(152,1) Loading mod: FlapJack
scripts/mods.lua(179,1) Mod: FlapJack Loading modworldgenmain.lua
scripts/mods.lua(187,1) Mod: FlapJack Mod had no modworldgenmain.lua. Skipping.
scripts/mods.lua(179,1) Mod: FlapJack Loading modmain.lua
LOADING LUA SUCCESS
scripts/playerdeaths.lua(79,1) PlayerDeaths loaded morgue 4713
scripts/playerprofile.lua(480,1) loaded profile
scripts/playerprofile.lua(544,1) bloom_enabled false
scripts/saveindex.lua(99,1) loaded saveindex
scripts/gamelogic.lua(1172,1) OnFilesLoaded()
scripts/gamelogic.lua(1161,1) OnUpdatePurchaseStateComplete
scripts/gamelogic.lua(111,1) FE assets already loaded
...m/steamapps/common/dont_starve/data/scripts/util.lua:276: Could not find an asset matching anim/FPJ.zip in any of the search paths.
LUA ERROR stack traceback:
=[C] in function 'assert'
F:/steam/steamapps/common/dont_starve/data/scripts/util.lua(276,1) in function 'resolvefilepath'
F:/steam/steamapps/common/dont_starve/data/scripts/mainfunctions.lua(52,1) in function 'RegisterPrefabs'
F:/steam/steamapps/common/dont_starve/data/scripts/mainfunctions.lua(79,1) in function 'LoadPrefabFile'
F:/steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(113,1) in function 'LoadAssets'
F:/steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1153,1) in function 'DoResetAction'
F:/steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1168,1) in function 'complete_callback'
F:/steam/steamapps/common/dont_starve/data/scripts/upsell.lua(27,1) in function 'UpdateGamePurchasedState'
F:/steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1173,1)
=[C] in function 'SetPersistentString'
F:/steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(85,1) in function 'Save'
...
=[C] in function 'GetPersistentString'
F:/steam/steamapps/common/dont_starve/data/scripts/saveindex.lua(91,1) in function 'Load'
F:/steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1189,1) in function 'callback'
F:/steam/steamapps/common/dont_starve/data/scripts/playerprofile.lua(574,1) in function 'Set'
F:/steam/steamapps/common/dont_starve/data/scripts/playerprofile.lua(458,1)
=[C] in function 'GetPersistentString'
F:/steam/steamapps/common/dont_starve/data/scripts/playerprofile.lua(456,1) in function 'Load'
F:/steam/steamapps/common/dont_starve/data/scripts/gamelogic.lua(1188,1) in main chunk
=[C] in function 'require'
F:/steam/steamapps/common/dont_starve/data/scripts/mainfunctions.lua(652,1)
scripts/frontend.lua(723,1) SCRIPT ERROR! Showing error screen
scripts/modindex.lua(85,1) ModIndex: Load sequence finished successfully.

Reset() returning

 

Force aborting...

 

My next big problem, what did I do? (or not do?) looking for the answer now, but if anyone has run across this, please let me know what the answer is, or  link to fix it. 

Link to comment
Share on other sites

@RedRock911,

 

"Could not find an asset matching anim/FPJ.zip in any of the search paths."

 

Are you sure you put the files in the correct directory?

It may also be an issue with how the asset was compiled. Someone had a similar problem and re-compiling it with the correct settings fixed it.

I'm almost positive I think it was something I did. could be the way it was compiled, all the data is in the correct folder. working on it now, if I find out what I did to fix it, or the "how" of how I broke it, ill let the community know

Link to comment
Share on other sites

@RedRock911,

 

"Could not find an asset matching anim/FPJ.zip in any of the search paths."

 

Are you sure you put the files in the correct directory?

It may also be an issue with how the asset was compiled. Someone had a similar problem and re-compiling it with the correct settings fixed it.

 

Got it fixed. Ditched the files and started over. Everything technically works fine, I just have some problems with the face and arms not lining up. Speaking of, anyone have a link to any tools or tutorials for ways to line up characters? or do we just edit the png file and run trial and errors until we resolve it? 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
×
  • Create New...