PaladinPlayer Posted November 23, 2015 Share Posted November 23, 2015 (edited) Hi Community! A while ago I made an Ornithologist character for DST, while she was ok (and my first mod) now I wish to give her an overhaul with new abilities and art. So, I was wondering if anybody knew: 1. What would be a good MINOR resistance to the temperature. (Like small insulation, small cooling? Less damage taken from cold and heat/fire?) 2. If anybody knew how to code ^ perk so that it would activate while an item was in your inventory. 3. The same as No. 2 but with extra speed and damage respectively instead? 4. Suggestions, I want to re-make this character, so any suggestions will also be helpful! Thanks! Edit: I do have a small knowledge of coding, however adding the resistance, speed or damage is out of my league. Edited November 23, 2015 by PaladinPlayer Link to comment Share on other sites More sharing options...
PaladinPlayer Posted November 24, 2015 Author Share Posted November 24, 2015 So I did a bit more work on the mod around the melee aspect and ended up trying this:local MakePlayerCharacter = require "prefabs/player_common"local assets = { Asset( "ANIM", "anim/player_basic.zip" ), Asset( "ANIM", "anim/player_idles_shiver.zip" ), Asset( "ANIM", "anim/player_actions.zip" ), Asset( "ANIM", "anim/player_actions_axe.zip" ), Asset( "ANIM", "anim/player_actions_pickaxe.zip" ), Asset( "ANIM", "anim/player_actions_shovel.zip" ), Asset( "ANIM", "anim/player_actions_blowdart.zip" ), Asset( "ANIM", "anim/player_actions_eat.zip" ), Asset( "ANIM", "anim/player_actions_item.zip" ), Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ), Asset( "ANIM", "anim/player_actions_bugnet.zip" ), Asset( "ANIM", "anim/player_actions_fishing.zip" ), Asset( "ANIM", "anim/player_actions_boomerang.zip" ), Asset( "ANIM", "anim/player_bush_hat.zip" ), Asset( "ANIM", "anim/player_attacks.zip" ), Asset( "ANIM", "anim/player_idles.zip" ), Asset( "ANIM", "anim/player_rebirth.zip" ), Asset( "ANIM", "anim/player_jump.zip" ), Asset( "ANIM", "anim/player_amulet_resurrect.zip" ), Asset( "ANIM", "anim/player_teleport.zip" ), Asset( "ANIM", "anim/wilson_fx.zip" ), Asset( "ANIM", "anim/player_one_man_band.zip" ), Asset( "ANIM", "anim/shadow_hands.zip" ), Asset( "SOUND", "sound/sfx.fsb" ), Asset( "SOUND", "sound/wilson.fsb" ), Asset( "ANIM", "anim/beard.zip" ), -- Don't forget to include your character's custom assets! Asset( "ANIM", "anim/wilda.zip" ),}local prefabs = {}local function common_postinit(inst) -- choose which sounds this character will play inst.soundsname = "wendy"endlocal start_inv = { "feather_robin",}local function master_postinit(inst) inst:AddComponent("reader")inst.components.eater.foodprefs = { FOODTYPE.VEGGIE, FOODTYPE.INSECT, FOODTYPE.SEEDS, FOODTYPE.GENERIC, FOODTYPE.BIRDFOOD } -- a minimap icon must be specified inst.MiniMapEntity:SetIcon( "wilda.png" ) -- todo: Add an example special power here. inst.components.health:SetMaxHealth(125) inst.components.hunger:SetMax(125) inst.components.sanity:SetMax(150)local redbirds = {"robin"}local redfeathers = {"feather_robin"}local function damagemultiplierfn(inst) local hasredbird = false local hasredfeather = false for k,v in pairs(redbirds) do if inst.components.inventory:Has(v) then hasredbird = true end if inst.components.inventory:Has("feather_"..v) then hasredfeather = true end end return hasredbird and inst.components.combat.damagemultiplier = 1.5 or (hasredfeather and inst.components.combat.damagemultiplier = 5.1)endinst.components.combat.damagemultiplier = damagemultiplierfn(inst)endreturn MakePlayerCharacter("wilda", prefabs, assets, common_postinit, master_postinit, start_inv)(The stats are just temporary until I know it works) So I tried this in hope of achieving a system where when a red feather is in your inventory you get a melee boost but when you have a red bird that boost is overwritten and larger. (IK feather boost has 5.1 but wanting to test since she started with a feather) However when I did this I got this error screen when joining a private server with no other mods: Any help would be appreciated, also if anyone knew how to change the speed of a character uses a similar system that would be awesome! Link to comment Share on other sites More sharing options...
rezecib Posted November 25, 2015 Share Posted November 25, 2015 return hasredbird and inst.components.combat.damagemultiplier = 1.5 or (hasredfeather and inst.components.combat.damagemultiplier = 5.1) Don't set it in the return statement if you're going to set it with the result of the function. But you need this function to be running periodically, rather than just when the character joins the world (when its prefab is created). The most elegant thing to attach it to would probably be when an item is picked up / dropped, but I don't know off the top of my head how to do that. The crash error shown is a syntax error though. I'm guessing it's because you're trying to assign in the middle of the return statement. 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