zeropoint101

  • Content count

    125
  • Joined

  • Last visited

Community Reputation

7 Neutral

2 Followers

About zeropoint101

  • Rank
    Member

Recent Profile Visitors

617 profile views
  1. Read through the other posts in this thread.
  2. Explanation of postinit functions?

    I was about to ask you why this worked the way I described when I put it in SciTE, but as I said above, I guess I just got a lucky guess because lua is the first language I've actually done anything besides read about.
  3. Explanation of postinit functions?

    I actually only knew that because it seemed intuitive. I had no idea other languages start at 0. So kind of a lucky guess. Ok, well I'm feeling kind of proud that I actually figured something out. Thanks for the extensive help.
  4. Explanation of postinit functions?

    Ok, I think I'm catching on to this a bit now. You confused me with this though - table.insert(tbl, value) is equivalent to tbl[# tbl] = value Wouldn't this replace the last value in the table rather than adding an additional value? Let's say we have... tbl = {6, 5, 43, 720, 12} So if I then use table.insert(tbl, 453) then now tbl = {6, 5, 43, 720, 12, 453} but if I use tbl[# tbl] = 453 then tbl = {6, 5, 43, 720, 453} and you've replaced the 5th element rather than adding a 6th element because # tbl = 5 to begin with. Or am I missing something?
  5. Explanation of postinit functions?

    Ok, after looking at modutil.lua and mods.lua some more today and reading your posts again, I think maybe I'm understanding the term "keys" better. Maybe. I wanna see if I'm right. I think most of this is what you said already, but it helps me to put in my own words and see if I've got it right. So in this section of modutil. lua - 188 env.postinitfns.SimPostInit = {} 189 env.AddSimPostInit = function(fn) 190 initprint("AddSimPostInit") 191 table.insert(env.postinitfns.SimPostInit, fn) 192 end Line 188 creates a new table called SimPostInit inside the table postinitfns, and SimPostInit is also the "key" to access that table(which is an element of the table postinitfns) inside postinitfns later on, correct? Line 189 defines a new function called AddSimPostInit. This function is an element(is "element" the correct term?) of the table env. What the function does is calls the function initprint with the parameter "AddSimPostInit". Next, it(line 191)... hmm, this I think confuses me.. but it then inserts a new element at the end of the SimPostInit table. The thing it inserts is the... returned value from the AddSimPostInit function?
  6. Explanation of postinit functions?

    I think I'll have to look at this again with a fresh brain when I wake up(I'm in the US. I just have odd hours and this is "late" for me.) My brain just isn't catching onto any new concepts for the night. I can follow patterns pretty well, just in general, and from my little bit of previous coding experience, but I guess honestly I never fully caught on to object oriented languages. Or ones that act like them. Branches and loops, even complex ones, I can usually figure out, but it's when you have something that calls something else that points back to first thing and branches off to two other things, goes back to second thing and then refers to itself within itself, and so on and so forth, <--- just an example of how it feels to me. But that's when my brain just starts going haywire. I'll definitely be coming back to this post though. Anyway, very cool game you linked. Congrats on the greenlight! That's something I may actually play. I seem to see a bit of Tribes influence in there, which is my favorite current shooter.
  7. Explanation of postinit functions?

    Ok, so.. hmm. I think I understood about a third of that, but it did help quite a bit. My first, and most, programming experience comes from original BASIC when I was a kid, which I played with quite a bit. So variables, loops, basic program structure, etc., I feel pretty solid in my foundations. I learned a bit of C++ and later(about a year ago) studied Java a decent amount, so I think I also have a good foundation of object-oriented programming. But I've never taken it to a level of practical use much at all, just study and tinkering, so I've still got a ton to learn. But anyway(I tend to ramble, sorry).. the explanation about Lua not being truly object oriented is a BIG helper. That's been confusing me a ton. When I see env.postinitfns.SimPostInit, I assume env is a main class, and postinitfns is a subclass of that, and so on.. So to reword what you said, am I understanding this right? Basically Lua emulates objects and classes by putting functions as elements within tables inside tables inside tables, etc? So when I see env.postinitfns.SimPostInit, "env" is a table, "postinitfns" is a table stored inside "env", and "SimPostInit" is a function stored as one element within the table "postinitfns"? Oops, actually it looks like SimPostInit is also a table, but then AddSimPostInit is a function stored in that table....? I just got the API example mods a couple days ago and have been perusing it. It's just such slow going for me. I'm not sure I understood what you meant about the callback function, or what you mean by a "key". I feel like I'm right on the verge, but I think I'll understand better as I code more. I'm curious. I see you post a ton on here and you seem to be very knowledgable. Did you go to school to learn all this or are you self taught? Do you do it for a living or just enjoying making mods and such? Thanks again for the help
  8. I'm really trying hard to understand lua. I think I'm halfway smart at least, and I even have some experience with coding(very little in recent years, but I understand the foundations pretty well.. or thought I did) but this stuff is just confounding me. Anyway, I've tried searching in various ways to find where the AddSimPostInit and other "post init" functions are defined, and I'm having no luck. I've read through tons of forum posts, spent hours on lua tutorials, etc. I was thinking this may be a pre-defined lua function and not specific to Don't Starve, but it doesn't seem to be. Can someone explain the best they can in plain english what a "post init" is/does exactly? And AddSimPostInit and PrefabPostInit and all the various PostInit functions? Every post I can find in the forums talks about "post init" functions like they are a thing that everyone already knows and understands. Can someone really dumb it down for me? But with some good details too..
  9. I'm sorry, but I think there must be a language barrier here. If you already figured out how to do the new animation in the entity, you need to read my first response to this.
  10. You have to create a different animation in Spriter in your entity. Unfortunately though, I'm pretty sure you have to name it something specific to know what to put in your code and connect it properly with the character, and I don't know what that name would be at this point. Try making your own thread about this, or you could try asking in the second link I posted 4 posts up.
  11. No problem at all. Glad to hear you were finally able to work it out. I saw from your other posts you've been trying at it for a while.
  12. Ok, thanks again, Dana. Now I get what they mean by "layouts". I don't think I'll even try to dive in to that bug thread yet if it's that complicated, as I'm just barely beginning to understand basic lua and the file structures, but I'm glad I have a place to start if/when I get there.
  13. Ok so.. I'm just learning to mod, so forgive me if this is a dumb question, but can I change the look of the turf? I assumed this was what Tiled was for, but I haven't played with it yet, and after reading the description, I started to wonder. I see in the Up and Away mod that they are making different turfs, so I'm assuming this has to be possible. I don't need a detailed lesson because I'm still learning much more basic things, but can someone just point me in a really general direction for later when I might want to try this? Also, if that's not what Tiled is for, what exactly is a "layout"? I just didn't quite understand.
  14. I see that you've posted in another thread about this too, and the problem is that you don't have Steam, right? You have the mod tools, but can't get the autocompiler to find your files correctly? I honestly have no idea. I believe I've seen info about this somewhere, but I can't remember where. You could either try searching the forums for "autocompiler" and see if you run across an answer, or you could try posting in one of these threads with the question. Some of the devs and senior forums member are all over these threads. http://forums.kleientertainment.com/topic/27247-new-asset-tools-animations-textures-sounds-and-layouts/ http://forums.kleientertainment.com/topic/18801-modders-your-new-friend-at-klei/
  15. Sounds great to me. I've got the art for the item done for the most part(I may tweak a couple things later on), but that was such a feat for me even on such a simple thing, that now I'm just trying to get my motivation up to dive into the coding. I actually kind of enjoy it, but it's intimidating too. Plus I'm just a scatterbrain and I've always got 85 projects I've started and working on but rarely actually finish one. Hey, actually, if you wanted to try it out and just let me know what you think so far on the item itself, that would be cool. I know it's simple art, but I tweaked at it forever. I'll PM you since I'm starting to get a bit off topic for this thread.