Jump to content

Recommended Posts

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.

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

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.)

@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 :p

 

The second one does not make sense to me though. Did you mean to replace the Start() function?

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 by Blueberrys

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. :wilson_dorky:

 

@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.

@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 by Blueberrys
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)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...