• Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Sm0k

  • Rank
    Junior Member
  1. @ZupaleX, Thanks for responding. This looks promising to me, I'll give it a shot. Does this make it trigger when anyone on the entire map kills a mandrake? I'd prefer to only do it within a local radius if possible, but I can make global work if necessary. 2) I like both of these suggestions as well, and I'll give them a shot. However, I may not have expressed just QUITE how new to coding I am. I've pieced together my code by looking at other characters who did something I wanted (or close to). But when it comes to making scripts up I'm still very new. I get the idea behind what you are saying to do, but I'm at a loss as to how to get started and how to make it work. I'll work on it on my own for sure and try to figure it out, but if someone wanted to make it simple for me I wouldn't object. Both of these methods sound good to me, but to clarify for anyone who might want to help out: 3) It was pretty late when I was asking for help and I can see now how that was confusing. Basically, I was asking if there was a way to make the "invincible" state from #2 a code on a custom character instead of the Mandrake-Hat item. The reasoning behind this being that if someone ELSE was to use the (Mandrake)Bush-Hat they would go into normal hide state, but if my custom character were to use it they would become "planted" aka "invincible". I should have mentioned the character we are making to go along with this item is a "Mandrake" character. I've worked out all the code for her already, but I was wondering if I could add a new line of code to the character instead of the item (leave the item just a re-skinned bush-hat basically), and make it where if the character uses the hat she triggers the "invincible" state. The code for 3 was all just made up code. To clarify my question in 3 a bit: Keep in mind the code in that is all made-up examples. I'm not sure of how to actually write out the lines of code to make these things I want happen. I'm not even sure if "invincible" is a state I can toggle like "hide". I am literally winging it as I go trying to make things happen. Afterthought: I'm thinking now I can maybe add a new line into the mandrake bush hat. Something similiar to Is GoToState("invincible") even a thing I can do? And why does the code use owner instead of ThePlayer? I'm getting "owner" from the hats.lua , but I wasn't sure if something like Worked the same way, or if I had to use a mixture like
  2. Thank you all for taking the time to read this. Me and my wife have taken up creating our own characters recently (she does the art, I do the coding). I'm not experienced by any means, I have almost zero experience doing anything like this, but I can read code and kind of make sense of what is going on and have been picking through other mods learning some things as I go. Here are some things I haven't been able to work out on my own yet, and I'm hoping someone out there can help me. 1. Trigger instant insanity (sanity = 0) when a mandrake is killed near her. -I tried this one for a little but I felt like there might be a simple command out there to make this work 2. She has a custom mandrake bush-hat. I'm looking to trigger an invincible state while she is hidden, aka "planted". However, I'm worried about being able to abuse invincibility in combat. The normal "hide" state doesn't stop Charlie or Hounds, and I'm trying to make this like an AFK-type mode, without someone being able to spam-hide to avoid damage (maybe something like a timer before triggering invincible state) 3. Following along the same line as #2, while I was working on the hat I started adding the tags like "equippable", "waterproofer", "insulator", etc. I was trying to make it where if I couldn't become "invincible", I could at least counter-act anything harmful that might occur during these "AFK periods". I ended up with a code that looked like this: onuse stopuse However, using owner in the stopuse caused a crash. I tried adding " local owner = inst.components.inventoryitem.owner " above local hat AND below it (mimicking the onuse code, which was the only place I could see owner called out in any way special. Removing this from the stopuse lets me see that the onuse owner.hungerrate modifier is working, but not getting removed with stopuse. (sidenote, healer is for on-use healing not health regen, which is what I am looking for, so healer component doesnt work for what i want) 3A) Is there any way I can fix this so I can call on player components in the stopuse like it did in the onuse to reset values? 3B) Is there a way I can add these things to an item so I don't have to mess with the player components? --Health Regen (over time --Insulation (Max / Min Temps), I don't want her freezing or overheating while "planted" --Hunger Rate 3C) Is there a way to bypass that altogether and set a ListenForEvent type thing with "mandrakebush_onuse" and "stopusingmandrakebush" in the character.lua? Essentially, I'm looking for something like this