RetroMike Posted February 21, 2016 Share Posted February 21, 2016 (edited) This will be my first mod for DST. The basic idea is this. RetroMike is a "Game Hopper", a character able to enter and travel between game worlds in his sleep. He is able to summon items from different games through the use of his "Dream" powers. For the most part things have gone pretty smoothly. The extended mod character template was super helpful and I even managed to make custom sounds despite the available tutorials having some holes in them. Scripting however is a huge weak area for me, so I'll be asking for help as I hit walls. NOTE: This character is still being balanced. I want to end up with a fun and unique play-style that feels fresh but isn't overly easy or hard. I'm also going to match the art style to the best of my abilities. The name however will not be starting with a W, because he is a rogue element and doesn't belong to this game world. Dream Meter: This acts as the crafting source for all of Retro's special items and abilities. Summoning items from other games will drain his Dream power. Additionally some items must be sustained with dream energy or they will eventually break from use. Dream energy is replenished over time. RetroMike's Flatcap: Affectionately referred to as armor, he never goes out without it. Watt's Axe (Secret of Mana): One of the Mana weapons. A handy weapon, it also makes quick work of rocks and trees. The 1-Up (Super Mario Brothers): This works exactly as you would expect. If you have one in your possession when you die it will revive you with full stats. The Morning Star (Little Nemo: The Dream Master): The royal scepter of King Morpheus. Very effective against monsters and shadows but weak against all other mobs. It acts as a light source when held and has a tiny sanity aura. Gnat Swatter (Mario Paint: Gnat Attack): Highly effective vs insects (bees, mosquitos and dragonfly) dealing 100 dmg. All other mobs take 1 dmg. Summons Materia (Final Fantasy 7): Retro's strongest item. It summons fat chocobo to crush a target, dealing massive damage. It is destroyed after 1 use. Pokemon Trainer's Bag (Pokemon): W.I.P This will be made if I am able to make the backpack behave as intended. I want it to have a "berry pouch" that keeps food stuffs fresh.See this thread for details. Gold Coins (Super Mario Brothers): A crafted ingredient needed to make the 1-Up I've got more items from other games I would like to make for this character. I'm open to suggestions. Keep in mind I'm limiting items to 1 (maybe 2) per franchise to keep it diverse. Big thanks to everyone who has helped me out on this so far. Edited March 29, 2016 by RetroMike Link to comment Share on other sites More sharing options...
MF99K Posted February 24, 2016 Share Posted February 24, 2016 I might be able to grab you a template for the axe but I can't at the moment. For making objects glow, it's pretty simple. under the CreateEntity section you need a line that says inst.entity:AddLight() and a section underneath the animstates that says inst.Light:Enable(true) inst.Light:SetRadius(1) inst.Light:SetFalloff(0.66) inst.Light:SetIntensity(0.66) inst.Light:SetColour(255 / 255, 255 / 255, 255/ 255) you can change the numbers here to whatever you want to adjust the glow appearance. Radius is how wide the light is, falloff has to do with realism in the fade, intensity is how bright, and color is RGB, so for each fraction you put a number somewhere between 0 and 255 in the first part. First fraction is red, second is blue, third is green. the example I posted would have a white light. yellow is a combination between red and green, etc. and somewhere below for sanity: local function onblink(staff, pos, caster) if caster.components.sanity ~= nil then caster.components.sanity:DoDelta(TUNING.SANITY_SMALL) end staff.components.finiteuses:Use(1) end you can change the tuning value to whatever. This won't make holding the item give sanity, but will give sanity whenever it's used. I'd suggest looking at the hat codes for the tophat dapperness code for other sanity affects Link to comment Share on other sites More sharing options...
Neu7ral Posted February 24, 2016 Share Posted February 24, 2016 4 minutes ago, mf99k said: I might be able to grab you a template for the axe but I can't at the moment. For making objects glow, it's pretty simple. Not so like that, also needs the separated light prefab. If not, It will happen like the yellow amulet, Will bright, but only for you, but no another ones. Link to comment Share on other sites More sharing options...
MF99K Posted February 24, 2016 Share Posted February 24, 2016 Just now, Neutral_Steve said: Not so like that, also needs the separated light prefab. If not, It will happen like the yellow amulet, Will bright, but only for you, but no another ones. I think it might depend on what you're making with the code, with creatures it works. Link to comment Share on other sites More sharing options...
Neu7ral Posted February 24, 2016 Share Posted February 24, 2016 Ah, I didn't knew that, But on equiped items you should use what I said. Sadly I forget the code, But it's basically the nightstick.lua and "nightsticklight.lua?" I don't remember the Morning Star light prefab. Link to comment Share on other sites More sharing options...
RetroMike Posted February 25, 2016 Author Share Posted February 25, 2016 Awesome, I'll give that a shot. I'm still digging into other prefabs/scripts to see what, if anything, I can figure out. I've just never been able to get a grasp on even the simplest coding stuff so it's a struggle. Once I get a chance to work on this over the weekend I'll let you know if it worked out Thanks much! Link to comment Share on other sites More sharing options...
RetroMike Posted February 27, 2016 Author Share Posted February 27, 2016 Thanks to your suggestions I was able to get both an aura of light and a small sanity boost when equipped. So that knocks a few things of the to do list Very much appreciated! Now I just need to figure out how to turn this useless staff into a custom projectile slinging death machine and that will be another item completed. I was going to update my main post with things that have been completed but I don't seem to have that ability. Unless i'm just not looking in the right place. Link to comment Share on other sites More sharing options...
Neu7ral Posted February 27, 2016 Share Posted February 27, 2016 (edited) Also, I like his face, has some kind of disgusted and annoyed face. Btw, for craftings, you should put this on your modmain.lua local Ingredient = GLOBAL.Ingredient local Recipe = GLOBAL.Recipe local RECIPETABS = GLOBAL.RECIPETABS local TECH = GLOBAL.TECH Also. This is the craft of my monster hide! local monster_vest_recipe = AddRecipe("monster_vest",{ Ingredient("armorwood", 1), Ingredient("monstermeat", 14), Ingredient("silk", 8)}, RECIPETABS.WAR, TECH.SCIENCE_TWO, nil, nil, nil, 1, "warren_builder", "images/inventoryimages/monster_vest.xml" , "monster_vest.tex") That warren_builder is for make you character being the only to craft that item. So, he needs that tag, on the common_postinit of your character.lua then. this is an example craft local youritemnamerecipe_recipe = AddRecipe("youritemname",{ Ingredient("armorwood", 1), Ingredient("monstermeat", 14), Ingredient("silk", 8)}, RECIPETABS.SURVIVAL, TECH.SCIENCE_TWO, nil, nil, nil, 1, "yourcharacter_builder", "images/inventoryimages/youritem.xml" , "youritem.tex") Note, TECH.MAGIC_ONE doesn't exist, TECH.MAGIC_TWO is the prehatistator an TECH.MAGIC_THREE is the manipulator. Edited February 27, 2016 by Neutral_Steve edited somethin Link to comment Share on other sites More sharing options...
RetroMike Posted February 27, 2016 Author Share Posted February 27, 2016 (edited) 12 hours ago, Neutral_Steve said: Also, I like his face, has some kind of disgusted and annoyed face. Btw, for craftings, you should put this on your modmain.lua local Ingredient = GLOBAL.Ingredient local Recipe = GLOBAL.Recipe local RECIPETABS = GLOBAL.RECIPETABS local TECH = GLOBAL.TECH Also. This is the craft of my monster hide! local monster_vest_recipe = AddRecipe("monster_vest",{ Ingredient("armorwood", 1), Ingredient("monstermeat", 14), Ingredient("silk", 8)}, RECIPETABS.WAR, TECH.SCIENCE_TWO, nil, nil, nil, 1, "warren_builder", "images/inventoryimages/monster_vest.xml" , "monster_vest.tex") That warren_builder is for make you character being the only to craft that item. So, he needs that tag, on the common_postinit of your character.lua then. this is an example craft local youritemnamerecipe_recipe = AddRecipe("youritemname",{ Ingredient("armorwood", 1), Ingredient("monstermeat", 14), Ingredient("silk", 8)}, RECIPETABS.SURVIVAL, TECH.SCIENCE_TWO, nil, nil, nil, 1, "yourcharacter_builder", "images/inventoryimages/youritem.xml" , "youritem.tex") Note, TECH.MAGIC_ONE doesn't exist, TECH.MAGIC_TWO is the prehatistator an TECH.MAGIC_THREE is the manipulator. Brilliant! I had been trying to dissect some mods I had pulled down but I was missing some key knowledge on how to implement the code I was trying to mine. Thanks to you I now have working recipes for all 3 of the items. Once again thank you very much for the help! Looks like I'm down to my last 3 hurdles. -Making the mushroom function as listed in the OP if possible -Making the Morning star function as listed in the OP if possible -Learning how to add those sweet swinging animations to the axe. Mf99K mentioned above that they might know of a template for this so I've got my fingers crossed Edited February 27, 2016 by RetroMike Link to comment Share on other sites More sharing options...
Aquaterion Posted February 27, 2016 Share Posted February 27, 2016 (edited) 34 minutes ago, RetroMike said: Brilliant! I had been trying to dissect some mods I had pulled down but I was missing some key knowledge on how to implement the code I was trying to mine. Thanks to you I now have working recipes for all 3 of the items. Once again thank you very much for the help! Looks like I'm down to my last 3 hurdles. -Making the mushroom function as listed in the OP if possible -Making the Morning star function as listed in the OP if possible -Learning how to add those sweet swinging animations to the axe. Mf99K mentioned above that they might know of a template for this so I've got my fingers crossed For the mushroom, I don't think you can make it prevent death unless you edit the event, what you could do is make it do similar to red amulet in singleplayer, you die then revives you instantly. I tried the revive instantly and it did work inst.components.inventoryitem.keepondeath = true --To keep the mushroom on death inst:DoPeriodicTask(1, function() if owner:HasTag("playerghost") then owner:PushEvent("respawnfromghost") end end) -- Every 1 second checks if the player is dead, if he is revives him, You'd have to do onpickup and ondrop to make sure this task doesn't keep happening even after losing the mushroom.. I ain't sure if there's a better way than this. Edited February 27, 2016 by Aquaterion Link to comment Share on other sites More sharing options...
RetroMike Posted February 27, 2016 Author Share Posted February 27, 2016 I'm guessing - inst.components.inventoryitem.keepondeath - only applies to equipped items yes? I was kind of hopping I could have it auto use from your inventory but It's starting to look like I will have to make this an equitable item. That or make it res on Haunt like the DST Red amulet variant. Either way valuable info. I'll give this a shot later when I have some more time to tinker. Thanks Link to comment Share on other sites More sharing options...
Aquaterion Posted February 27, 2016 Share Posted February 27, 2016 (edited) 2 hours ago, RetroMike said: I'm guessing - inst.components.inventoryitem.keepondeath - only applies to equipped items yes? I was kind of hopping I could have it auto use from your inventory but It's starting to look like I will have to make this an equitable item. That or make it res on Haunt like the DST Red amulet variant. Either way valuable info. I'll give this a shot later when I have some more time to tinker. Thanks So I decided to try and make this work how I mentioned and I did manage it!; In the main function (usually called fn) put these: and add these outside before it: Spoiler inst.components.inventoryitem:SetOnDroppedFn(ondropped) inst.components.inventoryitem:SetOnPickupFn(onpickup) inst.lastowner = nil inst:DoPeriodicTask(1, function() if inst.components.inventoryitem.owner ~= nil then inst.lastowner = inst.components.inventoryitem.owner end end) Functions: Spoiler local function ondropped(inst) local mushtimelimit = 0 if mushtimelimit <= 10 then inst.mushtask = inst:DoPeriodicTask(1, function() if inst.lastowner ~= nil then local lastholder = inst.lastowner mushtimelimit = mushtimelimit + 1 if lastholder:HasTag("playerghost") then --inst.SoundEmitter:PlaySound("1UP-SOUND-FILE-LOCATION") lastholder:PushEvent("respawnfromghost", {cause = "oneup"}) -- Could not get cause to work properly.. lastholder.components.health.currenthealth = lastholder.components.health.maxhealth lastholder.components.sanity.current = lastholder.components.sanity.max lastholder.components.hunger.current = lastholder.components.hunger.max lastholder.components.talker:Say("It's OK, I had an extra life!") inst.mushtask:Cancel() inst:Remove() end end end) end end local function onpickup(inst) if inst.mushtask ~= nil then inst.mushtask:Cancel() end end It kinda looks weird in forum so I'm going to attach it too. (Make sure to read all the comments ) I made it so when the mushroom is dropped, whether on death or not, it checks if the last owner of the mushroom dies in the next 10 seconds, if he/she does, it revives him/her and gets consumed. ^I also added a commented version that checks if the player is a "retromike", so not every player could do it 1upmushroom.lua Edited February 27, 2016 by Aquaterion Link to comment Share on other sites More sharing options...
RetroMike Posted February 27, 2016 Author Share Posted February 27, 2016 (edited) Freakin perfect, your comments were super easy to follow and I love the addition of the line spoken on resurrection. I plugged everything in and it worked perfectly. I geeked out pretty hard when testing. Looks like all I need to tackle now is the Morningstar weapon functionality (I can provide a .zip of the mod if anyone wants to tinker with it) and the optional animation for Watt's Axe. Everyone has been super helpful, I gotta find a way to return the favor sometime. Edited February 27, 2016 by RetroMike Link to comment Share on other sites More sharing options...
Neu7ral Posted February 28, 2016 Share Posted February 28, 2016 9 minutes ago, RetroMike said: Looks like all I need to tackle now is the Morningstar weapon functionality (I can provide a .zip of the mod if anyone wants to tinker with it) and the optional animation for Watt's Axe. I think I can do the morning star. If you're interesed. pm me. Link to comment Share on other sites More sharing options...
Aquaterion Posted February 28, 2016 Share Posted February 28, 2016 I think I have the morning star done, unless Steve already made it, If you want you can give me the texture so I can put them in, or I can just give you it like this, you choose. Link to comment Share on other sites More sharing options...
Neu7ral Posted February 28, 2016 Share Posted February 28, 2016 I had only 1 issue, and it's the projectile doesn't do the loop animation, or the animation works bad. Well, It's done. I changed some things from the morningstar.lua Morningstar Thingies.rar Link to comment Share on other sites More sharing options...
Aquaterion Posted February 28, 2016 Share Posted February 28, 2016 (edited) 53 minutes ago, Neutral_Steve said: I had only 1 issue, and it's the projectile doesn't do the loop animation, or the animation works bad. Well, It's done. I changed some things from the morningstar.lua Morningstar Thingies.rar I checked it out to see how you did it, pretty much the same but I think you forgot the damage multiplier on shadow/monster targets retro all you gotta do is add this below inst.components.weapon:SetProjectile; inst.components.weapon:SetOnAttack(function(inst, attacker, target) --attacker.SoundEmitter:PlaySound("dontstarve/wilson/fireball_explo") Sound on Firing if any if target:HasTag("monster") or target:HasTag("shadow") then target.components.combat:GetAttacked(inst, 20, nil) --20 is the value of extra damage end end) Edited February 28, 2016 by Aquaterion Link to comment Share on other sites More sharing options...
Neu7ral Posted February 28, 2016 Share Posted February 28, 2016 36 minutes ago, Aquaterion said: I checked it out to see how you did it, pretty much the same but I think you forgot the damage multiplier on shadow/monster targets retro all you gotta do is add this below inst.components.weapon:SetProjectile; inst.components.weapon:SetOnAttack(function(inst, attacker, target) --attacker.SoundEmitter:PlaySound("dontstarve/wilson/fireball_explo") Sound on Firing if any if target:HasTag("monster") or target:HasTag("shadow") then target.components.combat:GetAttacked(inst, 20, nil) --20 is the value of extra damage end end) Ah, I forget that. Link to comment Share on other sites More sharing options...
RetroMike Posted February 29, 2016 Author Share Posted February 29, 2016 (edited) Yo! Sorry for the delayed reply, I've been working on a project for TF2 and it just devoured my day. I haven't yet had a chance to check this out but I will as soon as I am able, might not get to it until tomorrow though. Seriously, can't thank you all enough for the help! It's been really cool to see this unfold and learn more about the process. UPDATE: Alright I got this suckers installed and the issue with the animation was all my own fault. I must have done something wonky when I built the spriter file, so I redid the whole thing with a new animation name and updated the prefab accordingly, it worked like a charm! I also plugged in the damage multiplier and it worked perfectly as well. Aside from some optional crap like axe animation and maybe some sound effects my to-do list has been completed. I owe you all one! I also managed to get minimap icons working and made the Morningstars attack rate less spammy. More like a blow dart in execution. Edited March 1, 2016 by RetroMike Link to comment Share on other sites More sharing options...
RetroMike Posted March 3, 2016 Author Share Posted March 3, 2016 Hit another wall with my recipes. I attempted to put a life ingredient requirement on one of my recipes but it crashes the game. I pulled Ingredient(CHARACTER_INGREDIENT.HEALTH, 40) from the Reviver recipe so I figured it should work fine, I was wrong. I'd also like ot know if other character stats (sanity and hunger) can be used as ingredients. The crash doesn't post an on screen log, it tells me to check my log file, however there is no log.txt generated. Maybe because I don't have DS, just DST? Link to comment Share on other sites More sharing options...
Neu7ral Posted March 3, 2016 Share Posted March 3, 2016 (edited) 40 minutes ago, RetroMike said: Hit another wall with my recipes. I attempted to put a life ingredient requirement on one of my recipes but it crashes the game. I pulled Ingredient(CHARACTER_INGREDIENT.HEALTH, 40) from the Reviver recipe so I figured it should work fine, I was wrong. I'd also like ot know if other character stats (sanity and hunger) can be used as ingredients. The crash doesn't post an on screen log, it tells me to check my log file, however there is no log.txt generated. Maybe because I don't have DS, just DST? Gladly I have the solution for that, Ingredient(GLOBAL.CHARACTER_INGREDIENT.HEALTH, 40) Also, for remove sanity and hunger just change the HEALTH to SANITY or HUNGER respectively. Edited March 3, 2016 by Neutral_Steve Changed "amount" to "40" Link to comment Share on other sites More sharing options...
Muche Posted March 4, 2016 Share Posted March 4, 2016 2 hours ago, RetroMike said: The crash doesn't post an on screen log, it tells me to check my log file, however there is no log.txt generated. Maybe because I don't have DS, just DST? The new name for the log file is client_log.txt. Link to comment Share on other sites More sharing options...
Aquaterion Posted March 4, 2016 Share Posted March 4, 2016 (edited) 22 hours ago, Neutral_Steve said: Gladly I have the solution for that, Ingredient(GLOBAL.CHARACTER_INGREDIENT.HEALTH, 40) Also, for remove sanity and hunger just change the HEALTH to SANITY or HUNGER respectively. Does this work on custom stats? because it crashes me when I try it ;-; I'm guessing its cause of a missing texture, but I've got no clue where the texture would go Edited March 4, 2016 by Aquaterion Link to comment Share on other sites More sharing options...
Neu7ral Posted March 4, 2016 Share Posted March 4, 2016 1 hour ago, Aquaterion said: Does this work on custom stats? because it crashes me when I try it ;-; I'm guessing its cause of a missing texture, but I've got no clue where the texture would go Nope, Wissphar's mod have only 105 of sanity and he can craft his items without problems, I put all the recipes on the Modmain, so, if your character has the recipes on his character.lua remove the global. Link to comment Share on other sites More sharing options...
Aquaterion Posted March 4, 2016 Share Posted March 4, 2016 1 hour ago, Neutral_Steve said: Nope, Wissphar's mod have only 105 of sanity and he can craft his items without problems, I put all the recipes on the Modmain, so, if your character has the recipes on his character.lua remove the global. Huh Sorry I didn't understand that correctly.. My mod adds a stat to EVERY character, let's say its called "energy" doing GLOBAL.CHARACTER_INGREDIENT.ENERGY crashed me 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