StarmanUltra Posted July 25, 2015 Share Posted July 25, 2015 (edited) Character 1.0.8 release! Steam workshop page: https://steamcommunity.com/sharedfiles/filedetails/?id=497091310 Character mod Wog'Maw for Don't Starve Together. Character art and design modified from Kog'Maw of League of Legends.Health: 75Hunger: 1000Sanity: 125Perk 1: Ranged Attack Perk 2: Likes all food and isn't picky Perk 3: Always hungryWith or without a weapon in hand, Wog'Maw can perform a ranged attack. Weapons will upgrade the damage they deal.Wog'Maw can eat all types of food with no penalty. It gains a small sanity boost from raw meat, can eat monster food, and even doesn't care about spoilage.Wog'Maw has an insatiable hunger, however. Its hunger drain is 4 times the default amount. Various other tweaks are included, such as increased sanity drain from monsters, reduced Krampus spawn rate, and a secret bonus if you manage to fill Wog'Maw's stomach!Please let me know of any crashes, errors, or mod compatability issues.Big thanks to DarkXero and ZupaleX for help coding!Time to feast! I appreciate any feedback! ----------------------------CHANGELOG: 8/10/15 - 1.0.6 - Initial release following hotfixes 8/11/15 - 1.0.8 - Updated character portrait 8/12/15 - 1.1.0 - Bugfix with rapid fire at flying birds -fixed crash for launching projectile "nil" target -base hunger rate increased to 4x default -attack speed lowered - no more ranged stun-lock -diminishing returns on bonus damage from equipped weapons -special functionality given to ham bat! -removed extra night sanity drain, increased sanity drain from nearby monsters 8/12/15 - 1.1.1 - Bugfix with rapid fire at burrowing moleworms 8/17/15 - 1.1.2 - Diminishing returns on weapon damage buffed up - full damage with spears now -Krampus slightly more difficult to spawn now -Hunger rate lowered slightly Possible future changes:More skin colors, add to configuration options?Projectile size scaling with damage"quickeat" override when eating raw meat Fix glitch with rapid fire projectile against tentacle and birchnuts going undergroundImprove attack animation - body_swap and head_swap items slightly to moderately out of correct positionCustom sound file EDIT 1: Scriped an attack animation in Spriter, here's a preview (he shoots spit from his tongue)That's two attacks in a row, in case you're wondering. Just have to get the animation to replace the standard attacks. Not 100% sure how, but I can probably manage. I also have a simple workaround for ranged attacks (Thanks DarkXero!). I have his diet all squared away too. Just need to tweak his hunger rate and rate change due to high hunger values.My preliminary test was informative. Seems like something like 5 times hunger drain wouldn't be unreasonable, since all those birds and rabbits do give a bunch of food. Unforseen side-effect though, I spawned two Krampus within two days gathering my bird/rabbit meat. I don't mind the extra intrusions, but it'd unbalance farming his sack. So I think I'll half the drop rate on the sack.Hmm I should take some in-game shots to post as well... EDIT 2: A default hunger rate of 3 times Wilson (225 calories per day) seems to be a good amount. He receives full hunger value from raw meat, any spoiled food, and monster meat. Even without having to worry about cooking, it can be pretty tough keeping him fed. Just what I wanted Additionally, higher hunger levels increase his hunger rate, going up to 4* at 40% stomach, up to 5* at 80%. Since I needed to add in some benefit for having a full stomach, but keep it so he can never be full, if you manage to get 100% stomach, he'll instantly convert 80% of his hunger into a permanent 7 HP boost to max HP. This drops you back down to 20% hunger. I don't forsee it needing a limit since it seems pretty difficult to achieve, you'd have to have a nice meaty stew factory to really abuse it. A reasonable limit would be 200 max HP, which would require filling his stomach 18 times. I figure, more power to you. Those extremely long runs tend to make you pretty OP anyway. I'll test it out. Also since I thought it was fun, at 60% and higher fullness, he gives off a slight glow. It seems *any* amount of light makes him immune to the night monster, but I didn't think that was such a big deal either. His light radius is miniscule, so it's not like you can do anything besides not die being out in the dark. Still have the problems with Naughtiness. The neither the forums nor code for Krampus/rabbits/etc tell me anything about naughtiness, other than it being a value stored on the server, not client-side. It's not something that breaks my mod, per-se, but it does add both an unwanted annoyance and an unbalance.Also unable to get the above animation to show for attacks, but I am getting the basic attack to be replaced with a blank character, so that's a start. Any help in those two areas would be awesome! EDIT 3: Max health capped at 200 from increasing it through getting a full stomach. Found a slightly janky workaround for the increased Krampus spawning by setting TUNING.KRAMPUS_NAUGHTINESS_DECAY_PERIOD = TUNING.KRAMPUS_NAUGHTINESS_DECAY_PERIOD * 0.25This means the spawning threshold is still the same, but decays 4 times faster, meaning instead of losing 8 naughtiness per day, you lose 32. Unfortunately, this means that this applies to all players on the server, meaning it's nigh-impossible for a non-Wog'Maw to summon the krampus by any means other than killing Glommer. But assuming there's an active Wog'Maw playing on the server, it should be possible to summon him accidentally by killing too many rabbits, and certainly possible if you do it on purpose. Also, I determined he needed increased sanity drain, since his ranged attacks reduce combat sanity drain significantly. I played using +50% night drain and +100% negative aura drain, but that wound up being just a little too much, going +20% night drain and +100% negative aura drain. Also gave eating raw meat give a +2 sanity increase, meaning there is some choice involved with cooking or not. Raw meat gives a little sanity, cooked meat gives a little health, but both give the same hunger. Edited August 17, 2015 by StarmanUltra Link to comment Share on other sites More sharing options...
UnionGaming Posted July 25, 2015 Share Posted July 25, 2015 In my eyes, look at it this way, 1000 health, 3x hunger gain. Wilson's hunger is 150 right? 150 * 3 = 450. 100 is almost 7 times Wilson's hunger, so maybe 6-7x drain and 3x drain at 100 hunger? Link to comment Share on other sites More sharing options...
StarmanUltra Posted July 25, 2015 Author Share Posted July 25, 2015 I guess I should have clarified a little. The 1000 hunger is a gimmick. Since high hunger values will drain much more quickly than low values, his hunger will always be on the low end, and getting full is impossible. All-in-all, his regular hunger needs will be double or triple of Wilson, and he won't be able to "stockpile" food since it'll disappear quickly. Link to comment Share on other sites More sharing options...
StarmanUltra Posted July 31, 2015 Author Share Posted July 31, 2015 I'm having a very hard time replacing his attack animation. So far, he goes blank upon attacking and until moving again, at which time his sprite shows back up. I created a custom animation (seen above) using the character template in Spriter and named the file player_attacks.scml. Beyond that, I'm not sure where to go. Obviously it's trying to replace the animation, but nothing is showing up in-game. I'm guessing a factor is the animation name itself "template - BUILD_PLAYER_ATTACKS" (for the entity - animation) doesn't work. I have most of the rest of the mod worked out, so this is really the thing holding me back from a 1.0 release. Link to comment Share on other sites More sharing options...
DarkXero Posted August 1, 2015 Share Posted August 1, 2015 @StarmanUltra, instead of attacking, try putting in console:ThePlayer.AnimState:PlayAnimation("template - BUILD_PLAYER_ATTACKS")and see if it appears. Link to comment Share on other sites More sharing options...
StarmanUltra Posted August 2, 2015 Author Share Posted August 2, 2015 (edited) Still showing up blank. I think the forum user Zupalex is going to upload their .scml files, but if you have the time, maybe you can just look at how I have things set up. My animation stuff is pretty messy right now because I've tried several different things (such as having a separate folder in exported for the attack animation, as well as renaming it to "rangedattack". I've also been unable to intercept the attack command by listening for it via inst:ListenForEvent("doattack", RangedAttack) Thank you in advance for any help you can and have provided, this animation stuff is *not* straight-forward in Don't Starve. EDIT: Sooo it took me nearly a full week to get animations to actually *show up in game*. Geez, the documentation is far from sufficient... Turns out, the entity in spriter and the assignments within the .lua scripts need to give the animation to "wilson" even though they're specifically for my character "wogmaw"... I guess since the mod character replaces Wilson's stuff, you give it to Wilson first. But holy crap I was wracking my brain for days trying to get this working. Now I need to tweak the animations for atk_pre vs atk, etc. But yeah, animations are in! I'm psyched! Getting pretty close to a 1.0 release. Edited August 4, 2015 by StarmanUltra Link to comment Share on other sites More sharing options...
StarmanUltra Posted August 6, 2015 Author Share Posted August 6, 2015 (edited) I'm running into an issue where my projectile prefab is causing a crash due to inventoryitem_replica calling the following function: function InventoryItem:GetImage() return self.classified ~= nil and self.classified.image:value() ~= 0 and self.classified.image:value() or (self.inst.prefab..".tex")endThe crash happens because it can't load in the .tex file (which I set up). I can use the console to spawn it in my inventory, even equip it in my hand, but when I try to create a projectile out of it, there's problems.The error is: "attempt to concatenate field 'prefab' (a nil value)" wogmaw.lua has a function called rangedattack that attempts to call the projectile: local function rangedattack(inst,data)local weapon = CreateEntity() weapon.entity:AddTransform() MakeInventoryPhysics(weapon) weapon:AddComponent("weapon") weapon.components.weapon:SetDamage(25) weapon.components.weapon:SetRange(inst.components.combat.attackrange, inst.components.combat.attackrange+4) weapon.components.weapon:SetProjectile("spit") weapon:AddComponent("inventoryitem") weapon.persists = false weapon.components.inventoryitem:SetOnDroppedFn(function() WeaponDropped(weapon) end) weapon:AddComponent("equippable") inst.weapon = weapon inst.components.inventory:Equip(inst.weapon) inst.components.inventory:Unequip(EQUIPSLOTS.HANDS)end Edited August 8, 2015 by StarmanUltra Link to comment Share on other sites More sharing options...
StarmanUltra Posted August 8, 2015 Author Share Posted August 8, 2015 (edited) Took a break from working on the ranged attack code for now, wanted to finalize his attack animation by adding in the tongue. Problem is, it doesn't want to show up in game, nor does the new headbase I had to use to get the layering to show up correctly. Look at the comparison gifs: Am I just not allowed to have a headbase-5.png or add in a beard-0.png? Or is there something else I have to declare in the game code? Edited August 8, 2015 by StarmanUltra Link to comment Share on other sites More sharing options...
StarmanUltra Posted August 11, 2015 Author Share Posted August 11, 2015 How can I make the eating animation play for this function? It also doesn't complete the unequip action (it leaves the icon in the equip slot) local function equipchange(inst,data) local equiphand = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) local food = nil if equiphand == nil then return end if equiphand.prefab == "hambat" then inst:PushEvent("unequip",inst) equiphand:Remove() inst:DoTaskInTime(0,function() food = SpawnPrefab("meat") inst.components.eater:Eat(food) end) --inst.AnimState:PlayAnimation("eat_pre") --inst.AnimState:PushAnimation("eat", false) endend Link to comment Share on other sites More sharing options...
DarkXero Posted August 11, 2015 Share Posted August 11, 2015 @StarmanUltra:local function equipchange(inst, data) local equiphand = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) if equiphand and equiphand.prefab == "hambat" then equiphand:Remove() local food = SpawnPrefab("meat") BufferedAction(inst, food, ACTIONS.EAT):Do() endend? Link to comment Share on other sites More sharing options...
StarmanUltra Posted August 11, 2015 Author Share Posted August 11, 2015 (edited) @StarmanUltra:local function equipchange(inst, data) local equiphand = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) if equiphand and equiphand.prefab == "hambat" then equiphand:Remove() local food = SpawnPrefab("meat") BufferedAction(inst, food, ACTIONS.EAT):Do() endend?That doesn't work any better, unfortunately (looks a lot prettier though ). And it does need the inst:PushEvent("unequip",inst) to update the inventory bar (otherwise it looks like the ham bat is still equipped. Even cutting out most of the function and just pushing an eat action doesn't play the animation for eating, it just changes hunger and does the sound effect. It seems like adding a talker component makes that a priority, even at the end of the function. What I really want in the end is an eating animation to show. This is pretty close to what I want, not quite perfect yet since the eating animation can be cut off by movement. local function equipchange(inst, data) local equiphand = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) if equiphand and equiphand.prefab == "hambat" then--inst.components.locomotor:Stop() local food = SpawnPrefab("meat")inst:DoTaskInTime(0,function() inst:PushEvent("unequip",inst)equiphand:Remove()end) inst:DoTaskInTime(0.75,function() inst.AnimState:PlayAnimation("eat_pre",false)inst.AnimState:PushAnimation("eat", false)BufferedAction(inst, food, ACTIONS.EAT):Do()end) inst:DoTaskInTime(3,function() inst.components.talker:Say("Meat on stick!")end) endend Edited August 11, 2015 by StarmanUltra Link to comment Share on other sites More sharing options...
DarkXero Posted August 11, 2015 Share Posted August 11, 2015 @StarmanUltra,local function equipchange(inst, data) local equiphand = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) if equiphand and equiphand.prefab == "hambat" then inst.components.inventory:DropItem(equiphand) equiphand:Remove() local food = SpawnPrefab("meat") local buffaction = BufferedAction(inst, food, ACTIONS.EAT) inst:PushBufferedAction(buffaction) endendLike this then. Link to comment Share on other sites More sharing options...
StarmanUltra Posted August 12, 2015 Author Share Posted August 12, 2015 Weird, I tried lots of different variations, and I could only ever get one or two of the actions to go. Either - it wouldn't properly unequip the ham bat,- the eat animation wouldn't occur- eat animation would play, but no hunger value gained But it turns out using DoTaskInTime allows the functions to not pile up, I guess? I found the perfect balance in this: local function equipchange(inst, data) local equiphand = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) if equiphand and equiphand.prefab == "hambat" theninst:DoTaskInTime(0,function() inst:PushEvent("unequip",inst) equiphand:Remove() end) inst:DoTaskInTime(0.75,function() local food = SpawnPrefab("meat") local buffaction = BufferedAction(inst, food, ACTIONS.EAT) inst:PushBufferedAction(buffaction) end) inst:DoTaskInTime(3,function() inst.components.talker:Say("Meat on stick!") end) endendThis allows the unequip animation and prefab removal to happen fluidly, but then the eat action forces the character to stop and eat. I'm really happy with the result Thanks!You thought you were going to equip the ham bat? Think again! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now