Mbfox Posted May 27, 2015 Share Posted May 27, 2015 Hey there!Is there any way to prevent a character from being damaged by charlie?If not, how can I make a character invincible at night time?Thanks Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/ Share on other sites More sharing options...
absimiliard Posted May 27, 2015 Share Posted May 27, 2015 Bring up your console (' if I remember correctly), if in DST instead of DS then go remote by hitting Ctl, then type in "c_godmode()" and Charlie (and hunger and heat/cold) will no longer be any threat at all. I don't think there's any way that doesn't involve cheating at the game, and if you're going to cheat the console is probably the easiest way to accomplish that. Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641230 Share on other sites More sharing options...
Mbfox Posted May 27, 2015 Author Share Posted May 27, 2015 Bring up your console (' if I remember correctly), if in DST instead of DS then go remote by hitting Ctl, then type in "c_godmode()" and Charlie (and hunger and heat/cold) will no longer be any threat at all. I don't think there's any way that doesn't involve cheating at the game, and if you're going to cheat the console is probably the easiest way to accomplish that.Thanks for the swift reply, but I was hoping for a way to add charlie-resistance to a character mod as a feature Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641234 Share on other sites More sharing options...
absimiliard Posted May 27, 2015 Share Posted May 27, 2015 Oooooh. I'm sorry, I'm useless for that question. My bad not noticing the forum this was posted in. (I have a horrible habit of reading these forums through the "View New Content" button only, which can leave me a bit unclear on which forum I'm in at the moment.) Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641239 Share on other sites More sharing options...
Mobbstar Posted May 27, 2015 Share Posted May 27, 2015 If you download my mod "Alchemical Brewage", you can find a potion effect called "grueimmune". You can't simply remove the component, it seems. So instead I set the warn- and hurt-times to really long ones whenever the player triggers Charlie. Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641244 Share on other sites More sharing options...
Blueberrys Posted May 27, 2015 Share Posted May 27, 2015 @Mbfox-- Stop updating, in case it's already darkinst.components.grue:Stop()-- Prevent future re-enablefunction inst.components.grue:Start() end-- If you want to remove the component too for whatever reason-- inst:RemoveComponent("grue") Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641254 Share on other sites More sharing options...
Mobbstar Posted May 27, 2015 Share Posted May 27, 2015 @Mbfox-- Stop updating, in case it's already darkinst.components.grue:Stop()-- Prevent future re-enablefunction inst.components.grue:Start() end-- If you want to remove the component too for whatever reason-- inst:RemoveComponent("grue") lol I didn't think of that The second one does not make sense to me though. Did you mean to replace the Start() function? Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641260 Share on other sites More sharing options...
Mbfox Posted May 27, 2015 Author Share Posted May 27, 2015 (edited) @Blueberrys Im pretty new to modding and coding in general, could you tell me how I'd implement that code? Edited May 27, 2015 by Mbfox Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641262 Share on other sites More sharing options...
Blueberrys Posted May 27, 2015 Share Posted May 27, 2015 (edited) Did you mean to replace the Start() function?Yep, it's replacing the Start function.Essentially the same as:inst.components.grue.Start = function(self) end- @Mbfox It would go anywhere that the inst variable refers to your player instance. Since this is character specific and not going to change (grue doesn't need to toggle), you can just put it inside your "fn" function in your character prefab code. Edited May 27, 2015 by Blueberrys Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641275 Share on other sites More sharing options...
Mbfox Posted May 27, 2015 Author Share Posted May 27, 2015 (edited) @Blueberrys Okay let me rephrase: I know absolutely nothing about modding and have just cut stuff so far... heeelp xP Edited May 27, 2015 by Mbfox Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641283 Share on other sites More sharing options...
Mobbstar Posted May 27, 2015 Share Posted May 27, 2015 Yep, it's replacing the Start function.Essentially the same as:inst.components.grue.Start = function(self) end Of course, I was confused by the "end" being in the same line. @Blueberrys Okay let me rephrase: I know absolutely nothing about modding and have just cut stuff so far... heeelp xP Somewhere you probably set your characters stats and the speak sound? There, just underneath or above. Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641288 Share on other sites More sharing options...
Blueberrys Posted May 27, 2015 Share Posted May 27, 2015 (edited) @Mbfox You have a file something like "..\YourModFolder\scripts\prefabs\your_character.lua", right? In there, look for the function named "fn".local function fn(inst) -- Lots of code here -- Put that bit hereend- Edit: Of course, I was confused by the "end" being in the same line. Oh, sorry, I just left it in one line to keep it short and easy for the comments. xD Edited May 27, 2015 by Blueberrys Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641289 Share on other sites More sharing options...
Mbfox Posted May 27, 2015 Author Share Posted May 27, 2015 @Blueberrys I tried both local function fn(inst) inst.components.grue:Stop() inst.components.grue.Start = function(self) end endandlocal function fn(inst) inst.components.grue:Stop()endbut neither prevent the grue attacking Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641309 Share on other sites More sharing options...
Blueberrys Posted May 27, 2015 Share Posted May 27, 2015 (edited) @Mbfox Please show your full code. Edit: Read the code here, and the portion about functions and references here. Note that your code may have this:local fn = function(inst) instead of this:local function fn(inst) Edited May 27, 2015 by Blueberrys Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641311 Share on other sites More sharing options...
Mbfox Posted May 27, 2015 Author Share Posted May 27, 2015 Please show your full code. I've essentially edited an existing mod for my own needs:local MakePlayerCharacter = require "prefabs/player_common"local function fn(inst) inst.components.grue:Stop() inst.components.grue.Start = function(self) end end local assets = { Asset("ANIM", "anim/worm.zip"), Asset("SOUND", "sound/worm.fsb"),}local prefabs = { "monstermeat", "wormlight",}local start_inv = {}local function RestoreNightvision(inst) inst:DoTaskInTime(3, function(inst) inst.Light:Enable(true) inst.Light:SetRadius(4) inst.Light:SetFalloff(.5) inst.Light:SetIntensity(.6) inst.Light:SetColour(245/255,40/255,0/255) end, inst)endlocal function updatestats(inst) if TheWorld.state.isnight then inst.components.grue:Stop() endendlocal function setChar(inst) inst.AnimState:SetBank("worm") inst.AnimState:SetBuild("worm") inst:SetStateGraph("SGwormplayer") inst.components.hunger:Pause() inst.components.sanity.ignore = trueendlocal function drop(inst) local hand = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS)local head = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HEAD)local body = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.BODY) if hand or body or head theninst:DoTaskInTime(0.1, function()local item = inst.components.inventory:Unequip(EQUIPSLOTS.HANDS)local item = inst.components.inventory:Unequip(EQUIPSLOTS.HEAD)local item = inst.components.inventory:Unequip(EQUIPSLOTS.BODY) inst.AnimState:OverrideSymbol("swap_object", "nil", "nil") end) end endlocal common_postinit = function(inst) inst.soundsname = "wilson" inst.MiniMapEntity:SetIcon( "wormplayer.tex" ) inst:DoTaskInTime(0, function() if ThePlayer then ThePlayer:EnableMovementPrediction(false) endend)endlocal master_postinit = function(inst) inst.components.health:SetMaxHealth(TUNING.WORM_HEALTH) inst:AddComponent("healthRegen") inst:AddComponent("lootdropper") inst:ListenForEvent("equip", drop) inst.components.combat:SetDefaultDamage(TUNING.WORM_DAMAGE) inst.components.combat:SetRange(TUNING.WORM_ATTACK_DIST) inst.components.combat:SetAttackPeriod(TUNING.WORM_ATTACK_PERIOD) inst.components.temperature.inherentinsulation = -TUNING.INSULATION_SMALL inst.AnimState:SetBuild("worm") inst.OnSetSkin = function(skin_name) inst.AnimState:SetBuild("worm") inst:SetStateGraph("SGwormplayer") end inst.AnimState:SetBank("worm") inst:SetStateGraph("SGwormplayer") inst.components.talker:IgnoreAll() inst.components.hunger:Pause() inst.components.sanity.ignore = true inst.components.temperature:SetTemp(20) inst:AddComponent("sanityaura") inst.components.sanityaura.aura = -TUNING.SANITYAURA_LARGE -- Stats varies day/night inst:ListenForEvent( "daytime", function() updatestats(inst) end , GetWorld()) inst:ListenForEvent( "dusktime", function() updatestats(inst) end , GetWorld()) inst:ListenForEvent( "nighttime", function() updatestats(inst) end , GetWorld()) updatestats(inst) inst.components.talker.colour = Vector3(127/255, 0/255, 0/255) inst:ListenForEvent("respawnfromghost", RestoreNightvision) inst:DoTaskInTime(0, setChar) inst:ListenForEvent("respawnfromghost", function() inst:DoTaskInTime(10, setChar) inst:DoTaskInTime(10, RestoreNightvision) end) MakeCharacterPhysics(inst, 1000, .5) inst:AddTag("monster") inst:AddTag("hostile") inst:AddTag("wet") inst.components.locomotor.walkspeed = 6 inst.components.locomotor:SetSlowMultiplier( 1 ) inst.components.locomotor:SetTriggersCreep(false) inst.components.locomotor.pathcaps = { ignorecreep = true } inst.components.lootdropper:SetLoot({"monstermeat", "monstermeat", "monstermeat", "monstermeat", "wormlight"}) inst:AddComponent("inspectable") return inst endreturn MakePlayerCharacter("wormplayer", prefabs, assets, common_postinit, master_postinit, start_inv) Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641322 Share on other sites More sharing options...
Blueberrys Posted May 27, 2015 Share Posted May 27, 2015 @Mbfox Is this for DST? o.o No wonder..The function you wrote at the top (fn) is completely useless cause it's not being called/referenced anywhere. Put the code in the master_postinit function at the bottom. Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641374 Share on other sites More sharing options...
Mbfox Posted May 28, 2015 Author Share Posted May 28, 2015 Sorry wrong section didnt notice that :S Anyway thanks for the help it's working perfectly Link to comment https://forums.kleientertainment.com/forums/topic/54478-stop-charlie/#findComment-641420 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