Jump to content

Recommended Posts

Hello,

 

I have been trying my hand at "modding" Don't Starve for a few days. By modding I mean just tweaking the mods I have downloaded for my own personal use. It all started when I downloaded the mod Tweak Those Tools, Tweaked. Ice was melting in the Icebox, figured I could figure it out cause I have a little background in games programming myself, but that was a long time ago. Anyway that was an easy fix; Check the tag "frozen" set the perish rate to 0.

 

Now I'm "modding" the mod Occult runes. It wasn't exactly working as advertised. Shadow creatures were being teleported away, but a few managed to get through and hit me. What I did was I changed the collision group to COLLISION.SANITY, add the line inst.Physics:CollidesWith(COLLISION.SANITY) and voila, danm shadow creatures cant get in the rune now. I was intrigued, So i tried looking for Physics, but I can't seem to find it anywhere. In entityscript.lua self.Physics is mentioned a few times but never declared or instantiated. class.lua is "required" but Physics isnt even mentioned there. I'm also having trouble finding where the function MakeObstaclePhysics() and TheSim originate, I would really love to check those out.

 

Another problem I have is with the shadowcreatures themselves. I can't find the code for when they get hit and reappear in a different place. I'm sure somewhere something is listening for the event and doing something with OnHit() or something like that but all I managed to find was the stategraph for "dissapear" and "reappear" but the code for figuring out where to "reappear" isn't there. Am I missing something here? lol.

 

I have many other questions but this post has gone on for long enough, I apologize. I should note that I don't have access to the Mod Tools; I currently do not have access to a machine running Windows.

Physics, TheSim, entity, AnimState, etc. are written and compiled as C++ code. Unless you have a way of decompiling it, you can't really check it out and have to go with what you can find in the game scripts.

 

MakeXPhysics are function declared in "standardcomponents.lua" in the scripts folder.

 

As for shadows warping when hit, it's in the "hit" state of their stategraph. As soon as the animation is over, the corresponding event fires and they transplace themselves.

 

I highly recommend you to consider a text editor capable of searching multiple files, it makes backtracking and finding examples so much easier. Notepad++ (my personal favourite for Lua) has that ability.

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...