Dziva Posted February 11, 2015 Share Posted February 11, 2015 Hi there. I'm doing my very first mod and I'm doing a character mod. I've been using the extended sample character template and it has been super helpful but it doesn't cover everything so I thought I would ask my questions here and see if I could get some help. I have looked around the forums and the internet but haven't found exactly what I'm looking for (if I have I haven't recognized it because I have limited understanding of lua code). Firstly I would like the character to look different and have equip limitations when insane and I'm not too sure how to do this. I'm daunted by having to draw the character in pieces to begin with to be totally honest but i don't want to give up on this aspect of the mod but I have no idea how to even start doing it in the coding aspect. I also want to give the character a custom item. It is a mask with a hood that will be changing the head since you won't see the face or the hair anymore and it will let you see in the dark at the cost of a slight health or hunger drain (since sanity is so low on the character already). The closest thing I have seen in game to what I am thinking is the bee hat but it is a bit too bulky. Is what I'm thinking even possible to do? Lastly is this and it is the least important: the extended sample character template mod is a humanoid animal character and mine will be simply human. I'm simply wondering if anyone knows where I could get similar files for a human character. If not then I'll use the files given obviously but having human files to start with would save time since the art is going to take me a bit anyway (why in pieces?). I know there is the character template put out by Klei but I tried previously to use that and was honestly confused by it. This is my second attempt to make this mod (I'm trying it in DST this time as I play that more now) and I am only getting anywhere thanks to the ESCT. Any help would be appreciated! Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/ Share on other sites More sharing options...
mikeek Posted February 11, 2015 Share Posted February 11, 2015 The art is in pieces so that it can be animated, I believe. Now I'm no artist and my knowledge of the process is limited, so I could be wrong. However, you absolutely can have a transforming character! The one caveat is that you'll have to supply art assets for each form.Take a look at Wolfgang's files, since he's a canonical transforming character. Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-612127 Share on other sites More sharing options...
Dziva Posted February 11, 2015 Author Share Posted February 11, 2015 The art is in pieces so that it can be animated, I believe. Now I'm no artist and my knowledge of the process is limited, so I could be wrong. However, you absolutely can have a transforming character! The one caveat is that you'll have to supply art assets for each form.Take a look at Wolfgang's files, since he's a canonical transforming character. From my limited understanding yes that is what I need so thanks However could you maybe explain some of it to me or point me to somewhere that can? I can basically tell that it is the coding to cue the transform and how it changes him but not fully how it does it or how I can change it. I'm...mediocre at reading code right now. I'm sure I won't need all of it but can't fully tell what is what. What I want is this: Different stats Different image/sprite Perhaps some different dialogue/random dialogue if possible In Wolfgang's I can make out that it references other settings, possibly other .luas and I think the scale part is because he actually shrinks? I'm trying but coding is just hard for me to read. Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-612140 Share on other sites More sharing options...
mikeek Posted February 11, 2015 Share Posted February 11, 2015 Yes, Wolfgang actually does scale. Slightly more specifically, find the wolfgang.lua file and look for the becomewimpy, becomemighty, and becomenormal functions. They all handle what happens when he transforms into the wimpy/mighty/normal 'forms'. It gets a bit confusing when you look at when they're called because the values at which he changes form depend on whether he's getting mightier or weaker. Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-612143 Share on other sites More sharing options...
rezecib Posted February 12, 2015 Share Posted February 12, 2015 (edited) Different stats Different image/sprite Perhaps some different dialogue/random dialogue if possible The coding part for this is quite easy. Dialogue is a little trickier, but can be done-- there's another thread about it here. For the different stats/image, you'll want something like this:local function changeStat(inst, stat, value) local percent = inst.components[stat]:GetPercent() inst.components[stat]:SetMax(value) inst.components[stat]:SetPercent(percent)endlocal function transform(inst, state) inst.transformed = state inst.AnimState:SetBuild(state and "transformed_build" or "normal_build") changeStat(inst, "hunger", state and 100 or 200) --100 hunger when transformed, 200 normally changeStat(inst, "health", state and 200 or 300) --200 health when transformed, 300 normally changeStat(inst, "sanity", state and 300 or 400) --300 sanity when transformed, 400 normallyendlocal function checkTransform(inst, data) local threshold = inst.transformed and 0.55 or 0.45 -- transformes at 45%, transforms back at 55% local shouldtransform = data.newpercent < threshold if shouldtransform ~= inst.transformed then transform(inst, shouldtransform) endendlocal function master_postinit(inst) inst.transformed = false inst:ListenForEvent("sanitydelta", checkTransform) -- you might need something to fix the build on becoming a ghostendreturn MakePlayerCharacter("mycharacter", nil, assets, nil, master_postinit) Edit: But yes, mikeek is correct about why characters are in parts. Each piece is kind of like a sprite, and the animations change their position, rotation, scale, and frame. You can think of them like animated puppets, where each piece is a part that has to move independently. It's set up this way for a few reasons-- it allows for smoother animations with fewer manually drawn frames, and it allows for better modularity-- you can swap in and out various parts, for example when your character puts on a backpack vs a log suit. As for human vs non human in the template, it really doesn't matter. You can use the non-human template. Things like ears, tails, etc, will just be left empty. The bee hat being too bulky shouldn't be a problem. Just make yours the size you want, and if necessary you may have to make it hide the head/hair on equip. Edited February 12, 2015 by rezecib Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-612218 Share on other sites More sharing options...
Dziva Posted February 12, 2015 Author Share Posted February 12, 2015 The coding part for this is quite easy. Dialogue is a little trickier, but can be done-- there's another thread about it here. For the different stats/image, you'll want something like this:local function changeStat(inst, stat, value) local percent = inst.components[stat]:GetPercent() inst.components[stat]:SetMax(value) inst.components[stat]:SetPercent(percent)endlocal function transform(inst, state) inst.transformed = state inst.AnimState:SetBuild(state and "transformed_build" or "normal_build") changeStat(inst, "hunger", state and 100 or 200) --100 hunger when transformed, 200 normally changeStat(inst, "health", state and 200 or 300) --200 health when transformed, 300 normally changeStat(inst, "sanity", state and 300 or 400) --300 sanity when transformed, 400 normallyendlocal function checkTransform(inst, data) local threshold = inst.transformed and 0.55 or 0.45 -- transformes at 45%, transforms back at 55% local shouldtransform = data.newpercent < threshold if shouldtransform ~= inst.transformed then transform(inst, shouldtransform) endendlocal function master_postinit(inst) inst.transformed = false inst:ListenForEvent("sanitydelta", checkTransform) -- you might need something to fix the build on becoming a ghostendreturn MakePlayerCharacter("mycharacter", nil, assets, nil, master_postinit) Edit: But yes, mikeek is correct about why characters are in parts. Each piece is kind of like a sprite, and the animations change their position, rotation, scale, and frame. You can think of them like animated puppets, where each piece is a part that has to move independently. It's set up this way for a few reasons-- it allows for smoother animations with fewer manually drawn frames, and it allows for better modularity-- you can swap in and out various parts, for example when your character puts on a backpack vs a log suit. As for human vs non human in the template, it really doesn't matter. You can use the non-human template. Things like ears, tails, etc, will just be left empty. The bee hat being too bulky shouldn't be a problem. Just make yours the size you want, and if necessary you may have to make it hide the head/hair on equip. Oh wow! You sir/madam are pure awesome. I never expected this Thank you so much!! Does it matter where I put this in my character's .lua? Also I just want to make sure I understand everything there so pleas bear with me. local function changeStat(inst, stat, value) local percent = inst.components[stat]:GetPercent() inst.components[stat]:SetMax(value) inst.components[stat]:SetPercent(percent)end instructions? local function transform(inst, state) inst.transformed = state inst.AnimState:SetBuild(state and "transformed_build" or "normal_build") this part tells the game that the character can transform and what files to access when they do. Would this be the image/sprite? Would I need to change the build names to what I have the different sprite art files name? Would I actually have two art files one called "character_normal" and one called "character_insane" or something? local function checkTransform(inst, data) local threshold = inst.transformed and 0.55 or 0.45 -- transformes at 45%, transforms back at 55% local shouldtransform = data.newpercent < threshold if shouldtransform ~= inst.transformed then transform(inst, shouldtransform) I understand the threshold as the level of sanity at which the change occurs but do I need to understand the rest? Please say no. local function master_postinit(inst) inst.transformed = false inst:ListenForEvent("sanitydelta", checkTransform) -- you might need something to fix the build on becoming a ghost I'm sorry...fix what? I know the ghost drains sanity so is that what you mean? Because I honestly didn't even think about that. x.x Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-612248 Share on other sites More sharing options...
Dziva Posted February 12, 2015 Author Share Posted February 12, 2015 Yes, Wolfgang actually does scale.Slightly more specifically, find the wolfgang.lua file and look for the becomewimpy, becomemighty, and becomenormal functions. They all handle what happens when he transforms into the wimpy/mighty/normal 'forms'. It gets a bit confusing when you look at when they're called because the values at which he changes form depend on whether he's getting mightier or weaker. Thanks will do! With the code the other poster gave me it should help me understand what is going on and, hopefully, my ability to code. Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-612249 Share on other sites More sharing options...
rezecib Posted February 12, 2015 Share Posted February 12, 2015 I'm sorry...fix what? I know the ghost drains sanity so is that what you mean? Because I honestly didn't even think about that. x.x Characters that change their builds in certain conditions often run into problems with their ghost becoming invisible, because the ghost has a separate build and animations, and then it's trying to use ghost animations with the transformation build. You can look at Wolfgang, but his system for avoiding that is a little tricky to understand (basically it stops the mightiness adjustments while he's a ghost). But first try it without a fix and see what happens. The master_postinit and MakePlayerCharacter call are there to give you context-- those two things should already exist in your character's prefab file. You'll need the contents of the master_postinit in your master_postinit, as well as the other functions above added above your master_postinit. Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-612263 Share on other sites More sharing options...
Dziva Posted February 12, 2015 Author Share Posted February 12, 2015 (edited) Characters that change their builds in certain conditions often run into problems with their ghost becoming invisible, because the ghost has a separate build and animations, and then it's trying to use ghost animations with the transformation build. You can look at Wolfgang, but his system for avoiding that is a little tricky to understand (basically it stops the mightiness adjustments while he's a ghost). But first try it without a fix and see what happens. The master_postinit and MakePlayerCharacter call are there to give you context-- those two things should already exist in your character's prefab file. You'll need the contents of the master_postinit in your master_postinit, as well as the other functions above added above your master_postinit. Okay so I think I have it done correctly but I'm not sure so I'm hoping you could look over my code and see if it is right? 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" ), Asset( "ANIM", "anim/corvo.zip" ), Asset( "ANIM", "anim/ghost_corvo_build.zip" ),}local prefabs = {}local start_inv = { -- Custom starting items}-- This initializes for both clients and the hostlocal common_postinit = function(inst) -- Minimap icon inst.MiniMapEntity:SetIcon( "corvo.tex" )end-- This initializes for the host onlylocal master_postinit = function(inst) -- choose which sounds this character will play inst.soundsname = "maxwell" -- Stats inst.components.health:SetMaxHealth(300) inst.components.hunger:SetMax(200) inst.components.sanity:SetMax(125)endlocal function changeStat(inst, stat, value) local percent = inst.components[stat]:GetPercent() inst.components[stat]:SetMax(value) inst.components[stat]:SetPercent(percent)end local function transform(inst, state) inst.transformed = state inst.AnimState:SetBuild(state and "transformed_build" or "normal_build") changeStat(inst, "hunger", state and 200 or 300) --100 hunger when transformed, 200 normally changeStat(inst, "health", state and 200 or 200) --200 health when transformed, 300 normally changeStat(inst, "sanity", state and 125 or 125) --300 sanity when transformed, 400 normallyend local function checkTransform(inst, data) local threshold = inst.transformed and 0.25 or 0.10 -- transformes at 45%, transforms back at 55% local shouldtransform = data.newpercent < threshold if shouldtransform ~= inst.transformed then transform(inst, shouldtransform) endend local function master_postinit(inst) inst.transformed = false inst:ListenForEvent("sanitydelta", checkTransform) -- you might need something to fix the build on becoming a ghostendreturn MakePlayerCharacter("corvo", prefabs, assets, common_postinit, master_postinit, start_inv) Since the characters done by Klei have different file setups than mod characters do (from what I can find, I can't find exported files for them for instance and that is where my character's art is) how do I link up the second set of artwork to the character? I'm sorry for asking so much, you have helped me a ton. Edited February 12, 2015 by Dziva Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-612268 Share on other sites More sharing options...
rezecib Posted February 12, 2015 Share Posted February 12, 2015 @Dziva, Looks mostly right, but you have two copies of master_postinit. Move inst.soundsname to the lower one, get rid of the upper one, and then change the values in transform() to match what you want for the untransformed/transformed stats (looks like you already did that, though). Also, since you're not changing his health or sanity on transformation, you can remove those changeStat lines (or comment them out in case you want to do it later). You should also change build names in transform(). "normal_build" should be "corvo", I'm guessing. "transformed_build" should be changed to whatever you call the new build you make for his transformed art. Er, and since I had you move all the stat information into transform(), you should probably add a call to it in the master_postinit-- just add this line:transform(inst, false)This will technically make it so it'll de-transform at certain sanity levels if they rejoin, which we could fix with onsave/onload, but let's leave that for later. Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-612283 Share on other sites More sharing options...
Dziva Posted February 12, 2015 Author Share Posted February 12, 2015 @Dziva, Looks mostly right, but you have two copies of master_postinit. Move inst.soundsname to the lower one, get rid of the upper one, and then change the values in transform() to match what you want for the untransformed/transformed stats (looks like you already did that, though). Also, since you're not changing his health or sanity on transformation, you can remove those changeStat lines (or comment them out in case you want to do it later). You should also change build names in transform(). "normal_build" should be "corvo", I'm guessing. "transformed_build" should be changed to whatever you call the new build you make for his transformed art. Er, and since I had you move all the stat information into transform(), you should probably add a call to it in the master_postinit-- just add this line:transform(inst, false)This will technically make it so it'll de-transform at certain sanity levels if they rejoin, which we could fix with onsave/onload, but let's leave that for later. Thank you so much! I was wondering about the double health stats but wasn't sure if I could get rid of that section. So if I just have the two art files in the mod then it will switch between them because I change the name? Excellent. This lua stuff is starting to get less confusing. I don't think I could just sit down and write this stuff but I think I'm starting to get it Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-612369 Share on other sites More sharing options...
Dziva Posted February 15, 2015 Author Share Posted February 15, 2015 Yes I am replying to my own topic in hopes of aid. I'm doing two similar characters so I was hoping to do the coding at the same time. I finally got the time to work more on them and went to test one in the game today and whenever I activate it the game freezes. I have other mods installed but not activated. I'm going to assume it is something in my code since if something was wrong with the art I do have done I think the sprite would just look funny yes? I did fiddle with the positioning of some of the art in the spriter but I'm not sure if that would be the problem. If I screwed up there how would I fix it? Yes I compiled it. So here is the coding and hopefully someone can help me find my problem. 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" ), Asset( "ANIM", "anim/rao.zip" ), Asset( "ANIM", "anim/ghost_rao_build.zip" ),}local prefabs = {}local start_inv = { -- Custom starting items}-- This initializes for both clients and the hostlocal common_postinit = function(inst) -- Minimap icon inst.MiniMapEntity:SetIcon( "rao.tex" )end-- This initializes for the host onlylocal function changeStat(inst, stat, value) local percent = inst.components[stat]:GetPercent() inst.components[stat]:SetMax(value) inst.components[stat]:SetPercent(percent)end local function transform(inst, state) inst.transformed = state inst.AnimState:SetBuild(state and "evil_rao" or "rao") changeStat(inst, "hunger", state and 100 or 200) --100 hunger when transformed, 200 normally changeStat(inst, "health", state and 300 or 200) --300 health when transformed, 200 normally changeStat(inst, "sanity", state and 500 or 350) --500 sanity when transformed, 350 normally inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.5) inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.5) inst.components.combat.damagemultiplier = 3.2 inst.components.sanity.dapperness = TUNING.DAPPERNESS_MED*-2end local function checkTransform(inst, data) local threshold = inst.transformed and 0.55 or 0.45 -- transformes at 45%, transforms back at 55% local shouldtransform = data.newpercent < threshold if shouldtransform ~= inst.transformed then transform(inst, shouldtransform) endend local function master_postinit(inst) inst.transformed = false inst.soundsname = "willow" inst.components.combat.damagemultiplier = 2.5 inst:ListenForEvent("sanitydelta", checkTransform) transform(inst, false) -- you might need something to fix the build on becoming a ghostendreturn MakePlayerCharacter("rao", prefabs, assets, common_postinit, master_postinit, start_inv) and just incase my modmain and modinfo modmain PrefabFiles = { "rao",}Assets = { Asset( "IMAGE", "images/saveslot_portraits/rao.tex" ), Asset( "ATLAS", "images/saveslot_portraits/rao.xml" ), Asset( "IMAGE", "images/selectscreen_portraits/rao.tex" ), Asset( "ATLAS", "images/selectscreen_portraits/rao.xml" ), Asset( "IMAGE", "images/selectscreen_portraits/rao_silho.tex" ), Asset( "ATLAS", "images/selectscreen_portraits/rao_silho.xml" ), Asset( "IMAGE", "bigportraits/rao.tex" ), Asset( "ATLAS", "bigportraits/rao.xml" ), Asset( "IMAGE", "images/map_icons/rao.tex" ), Asset( "ATLAS", "images/map_icons/rao.xml" ), Asset( "IMAGE", "images/avatars/avatar_rao.tex" ), Asset( "ATLAS", "images/avatars/avatar_rao.xml" ), Asset( "IMAGE", "images/avatars/avatar_ghost_rao.tex" ), Asset( "ATLAS", "images/avatars/avatar_ghost_rao.xml" ),}local require = GLOBAL.requirelocal STRINGS = GLOBAL.STRINGS-- The character select screen linesSTRINGS.CHARACTER_TITLES.rao = "The Priestess with Nine Tails"STRINGS.CHARACTER_NAMES.rao = "Rao"STRINGS.CHARACTER_DESCRIPTIONS.rao = "*Good Rao when sane\n*Evil Rao when insane\n*Changes stats when changes forms"STRINGS.CHARACTER_QUOTES.rao = "\"I will honor my duty with my life!\""-- Custom speech stringsSTRINGS.CHARACTERS.RAO = require "speech_rao"-- The character's name as appears in-game STRINGS.NAMES.RAO = "Rao"-- The default responses of examining the characterSTRINGS.CHARACTERS.GENERIC.DESCRIBE.RAO = { GENERIC = "It's Rao!", ATTACKER = "That Rao looks shifty...", MURDERER = "Murderer!", REVIVER = "Rao, friend of ghosts.", GHOST = "Rao could use a heart.",}AddMinimapAtlas("images/map_icons/rao.xml")-- Add mod character to mod character list. Also specify a gender. Possible genders are MALE, FEMALE, ROBOT, NEUTRAL, and PLURAL.AddModCharacter("rao", "FEMALE") modinfo-- This information tells other players more about the modname = "Rao"description = "The Priestess with Nine Tails"author = "Dziva"version = "1" -- This is the version of the template. Change it to your own number.-- This is the URL name of the mod's thread on the forum; the part after the ? and before the first & in the urlforumthread = "/files/file/950-extended-sample-character/"-- This lets other players know if your mod is out of date, update it to match the current version in the gameapi_version = 10dst_compatible = truedont_starve_compatible = falsereign_of_giants_compatible = falseall_clients_require_mod = true -- Character mods need this set to trueicon_atlas = "modicon.xml"icon = "modicon.tex"-- The mod's tags displayed on the server listserver_filter_tags = {"character", "rao" , "okami"}--configuration_options = {} Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-613358 Share on other sites More sharing options...
rezecib Posted February 16, 2015 Share Posted February 16, 2015 @Dziva, I'm not seeing anything wrong... But usually crashes without messages are due to something wrong with assets (like calling an asset that you haven't loaded). Looking in the Documents/Klei/DoNotStarveTogether/log.txt there's usually still a crash message there, though. Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-613483 Share on other sites More sharing options...
Dziva Posted February 16, 2015 Author Share Posted February 16, 2015 @rezecib Okay I went and got the log message how you said too. I'm kind of glad it is not the coding since I added stuff but at the same time I wish it were as that would be easier to fix. The log mentions an error screen but none was shown to me. I simply get her activated, the loading screen and then the main menu frozen. The music doesn't play, the buttons won't highlight or work and the characters that appear in the bottom corner do not move. I have to force the game closed. I'd put a screenshot but it would just look like a screenshot of the game's menu so no help there. I am making a couple of mods at once (my brain flits around so I tend to work in multiples) before I make my larger character mod which these are kind of practice for. Rao has special coding whereas the other one doesn't and the other mod works (I checked) before custom artwork. So if it is the artwork then I will have to scrap her I suppose but I hope not to. I'm hoping I just screwed up somewhere fixable. Thank you so much for your continued help! I really appreciate it :3 [00:00:58]: Loading Mod Info Prefabs [00:00:58]: Unloading Mod Info Prefabs [00:00:58]: ../mods/workshop-373480109/Coordinate.tex is 120x104 but compressed textures must have power of 2 dimensions.[00:01:59]: Unloading Mod Info Prefabs [00:01:59]: Collecting garbage...[00:01:59]: lua_gc took 0.01 seconds[00:01:59]: ~NetworkLuaProxy()[00:01:59]: ~SimLuaProxy()[00:01:59]: lua_close took 0.01 seconds[00:01:59]: ReleaseAll[00:01:59]: ReleaseAll Finished[00:01:59]: cGame::StartPlaying[00:01:59]: LOADING LUA[00:01:59]: DoLuaFile scripts/main.lua[00:01:59]: DoLuaFile loading buffer scripts/main.lua[00:01:59]: scripts/main.lua(167,1) running main.lua [00:01:59]: loaded modindex [00:01:59]: ModIndex: Beginning normal load sequence. [00:01:59]: ModIndex:GetModsToLoad inserting moddir, Rao DST [00:01:59]: Could not load mod_config_data/modconfiguration_Rao DST [00:01:59]: Loading mod: Rao DST (Rao) Version:1 [00:01:59]: Mod: Rao DST (Rao) Loading modworldgenmain.lua [00:01:59]: Mod: Rao DST (Rao) Mod had no modworldgenmain.lua. Skipping. [00:01:59]: Mod: Rao DST (Rao) Loading modmain.lua [00:02:00]: LOADING LUA SUCCESS[00:02:00]: PlayerDeaths loaded morgue 4195 [00:02:00]: loaded profile [00:02:00]: bloom_enabled false [00:02:00]: loaded saveindex [00:02:00]: OnFilesLoaded() [00:02:00]: OnUpdatePurchaseStateComplete [00:02:00]: Unload BE [00:02:00]: Unload BE done [00:02:01]: Mod: Rao DST (Rao) Registering prefabs [00:02:01]: Mod: Rao DST (Rao) Registering prefab file: prefabs/rao [00:02:01]: error calling LoadPrefabFile in mod Rao DST (Rao): [string "scripts/util.lua"]:292: Could not find an asset matching anim/ghost_rao_build.zip in any of the search paths.LUA ERROR stack traceback: =[C] in function 'assert' scripts/util.lua(292,1) in function 'resolvefilepath' scripts/mainfunctions.lua(72,1) in function 'RegisterPrefabs' scripts/mainfunctions.lua(99,1) =(tail call) ? =[C] in function 'xpcall' scripts/mods.lua(165,1) scripts/mods.lua(460,1) in function 'RegisterPrefabs' scripts/gamelogic.lua(158,1) in function 'LoadAssets' scripts/gamelogic.lua(964,1) in function 'DoResetAction' scripts/gamelogic.lua(982,1) in function 'complete_callback'... =[C] in function 'GetPersistentString' scripts/saveindex.lua(90,1) in function 'Load' scripts/gamelogic.lua(1003,1) in function 'callback' scripts/playerprofile.lua(671,1) in function 'Set' scripts/playerprofile.lua(553,1) =[C] in function 'GetPersistentString' scripts/playerprofile.lua(551,1) in function 'Load' scripts/gamelogic.lua(1002,1) in main chunk =[C] in function 'require' scripts/mainfunctions.lua(685,1) [00:02:01]: Disabling Rao DST (Rao) because it had an error. [00:02:01]: [string "scripts/util.lua"]:292: Could not find an asset matching anim/ghost_rao_build.zip in any of the search paths.LUA ERROR stack traceback: =[C] in function 'assert' scripts/util.lua(292,1) in function 'resolvefilepath' scripts/mainfunctions.lua(72,1) in function 'RegisterPrefabs' scripts/mainfunctions.lua(99,1) =(tail call) ? =[C] in function 'xpcall' scripts/mods.lua(165,1) scripts/mods.lua(460,1) in function 'RegisterPrefabs' scripts/gamelogic.lua(158,1) in function 'LoadAssets' scripts/gamelogic.lua(964,1) in function 'DoResetAction' scripts/gamelogic.lua(982,1) in function 'complete_callback'... =[C] in function 'GetPersistentString' scripts/saveindex.lua(90,1) in function 'Load' scripts/gamelogic.lua(1003,1) in function 'callback' scripts/playerprofile.lua(671,1) in function 'Set' scripts/playerprofile.lua(553,1) =[C] in function 'GetPersistentString' scripts/playerprofile.lua(551,1) in function 'Load' scripts/gamelogic.lua(1002,1) in main chunk =[C] in function 'require' scripts/mainfunctions.lua(685,1)[00:02:01]: SCRIPT ERROR! Showing error screen [00:02:01]: Mod: Rao DST (Rao) Registering default mod prefab [00:02:01]: Load FE [00:02:01]: Load FE: done [00:02:01]: platform_motd table: 0BE89B80 [00:02:01]: SimLuaProxy::QueryServer()[00:02:01]: SimLuaProxy::QueryServer()[00:02:01]: ModIndex: Load sequence finished successfully. [00:02:01]: Reset() returning[00:02:01]: QueryServerComplete no callback[00:02:02]: QueryServerComplete no callback[00:02:02]: platform_motd table: 1A9F0F80 Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-613524 Share on other sites More sharing options...
rezecib Posted February 16, 2015 Share Posted February 16, 2015 [string "scripts/util.lua"]:292: Could not find an asset matching anim/ghost_rao_build.zip in any of the search paths. Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-613532 Share on other sites More sharing options...
Dziva Posted February 16, 2015 Author Share Posted February 16, 2015 oh my goodness o-o I'll compile her manually and make sure it gets put in there then. Thank you so much! I feel so silly now. Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-613544 Share on other sites More sharing options...
Dziva Posted February 18, 2015 Author Share Posted February 18, 2015 me again....so I fixed the missing ghost anim stuff and could pick her as a character and then I got an error screen. At least I got one! Looks like it can't find her values or something? I'm not quite sure. Some more help maybe >.<? Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-614181 Share on other sites More sharing options...
rezecib Posted February 18, 2015 Share Posted February 18, 2015 @Dziva, Oh, it looks like they used inconsistent function naming with the health component (as compared to sanity and hunger). So change this line: inst.components[stat]:SetMax(value)to this:if stat ~= "health" then inst.components[stat]:SetMax(value)else inst.components[stat]:SetMaxHealth(value)end Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-614211 Share on other sites More sharing options...
Dziva Posted February 18, 2015 Author Share Posted February 18, 2015 @rezecib Thank you so much! That worked perfectly. Unfortunately that has led me to another question if you don't mind helping me some more. This group of coding was supposed to happen only when transformed but is happening when she is normal. Do I need to have it formatted differently? I have it in the section of coding you gave me for the transformation and the values for health, hunger and sanity (should be able to see it above). inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.5) inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.5) inst.components.combat.damagemultiplier = 3.2 inst.components.sanity.dapperness = TUNING.DAPPERNESS_MED*-2end Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-614328 Share on other sites More sharing options...
rezecib Posted February 18, 2015 Share Posted February 18, 2015 @Dziva, You can use the same structure that I used in the changeStat call:changeStat(inst, "hunger", state and 100 or 200)So, if you want normal speed when not transformed, do: inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED * (state and 1.5 or 1)and so on for the others. Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-614420 Share on other sites More sharing options...
Dziva Posted February 19, 2015 Author Share Posted February 19, 2015 (edited) @rezecib Thank you so much! I was thinking I would have to put it into that kind of format but not sure how I would be doing it. So would my line look like this: changeStat inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED * (state and 1.5 or 1) or would it look like this: changeStat(inst.conponents.locomotor.runspeed = TUNING.WILSON_RUN_SPEED *, stat and 1.5 or 1) Edited February 19, 2015 by Dziva Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-614523 Share on other sites More sharing options...
rezecib Posted February 19, 2015 Share Posted February 19, 2015 @Dziva, Nonono, no changeStat. That's a function I wrote for changing sanity/health/hunger and rescaling it based on the percent it was at (otherwise the percent changes when you change the maximum value). Just anywhere you have a value that you're assigning, change that value to (state and value_when_transformed or value_when_normal). Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-614560 Share on other sites More sharing options...
Dziva Posted February 19, 2015 Author Share Posted February 19, 2015 @Dziva, Nonono, no changeStat. That's a function I wrote for changing sanity/health/hunger and rescaling it based on the percent it was at (otherwise the percent changes when you change the maximum value). Just anywhere you have a value that you're assigning, change that value to (state and value_when_transformed or value_when_normal). ooohhh okay. That makes sense now. This is why I asked XD Thank you so much for all the help you have been giving! I hope I have to bother you less in the future. Link to comment https://forums.kleientertainment.com/forums/topic/50848-help-with-character-mod-please/#findComment-614619 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