Jump to content

Help with Character Perks? I Goofed.


Recommended Posts

 Hello!! Due to my own stupidity, I regret to say I still need help with Winnie.

I've been trying to root through the main data files to see if there was something I could use to create the extra character perks for Winnie, and I've found bits and pieces I feel MIGHT be relevant, but I can't make heads nor tails of how to splice them for my own use. 

I've got the flowers perk (+15 sanity for picking flowers) but I'm still trying to figure out how to

  • Eliminate sanity drain from magic use 
  • Attract Crows (SPECIFICALLY Crows) 
  • Cause a greater loss of sanity from being near shadows (as a balance for her sanity perks.) 

I'm really sorry about all the questions for this one mod. I'm still learning .lua and Winnie's mod was a heck of an experiment. Dive right in, I guess 8') 

Link to comment
Share on other sites

I know nothing absolutely almost nothing  about programming, but one of Wolfgang's downsides is being afraid to the dark and the monsters.

I found his coding and I think it should also work with Winnie considering it's just a night and monster multiplier of sanity

inst.components.sanity.night_drain_mult = x
    inst.components.sanity.neg_aura_mult = x

The first one is of the night and the second is the aura from monsters, I hope this helps!

You can replace x with 1.00 (default multiplier) or 1.25 (25% more drain), even 1.5 (50% more drain), you get the point.

Link to comment
Share on other sites

14 hours ago, AlbertDelRiver said:

I know nothing absolutely almost nothing  about programming, but one of Wolfgang's downsides is being afraid to the dark and the monsters.

I found his coding and I think it should also work with Winnie considering it's just a night and monster multiplier of sanity

inst.components.sanity.night_drain_mult = x
    inst.components.sanity.neg_aura_mult = x

The first one is of the night and the second is the aura from monsters, I hope this helps!

You can replace x with 1.00 (default multiplier) or 1.25 (25% more drain), even 1.5 (50% more drain), you get the point.

Thanks for the code from Wolfgang! I've added it to my modmain with a 1.5 mult but I'm still a little lost so I'm going to bump this (I think) and add the changes I've made to my modmain to give folks a better idea of what I'm dealing with. 

I won't include the flowers perk since I know that one works. 


local function master_init(inst)

if isnt.prefab == "shadowcreature" then inst.components.sanity.neg_aura_mult = 1.5

inst:AddComponent("crowfriend")
--following five lines are optional and used for tweaking, values asigned here are standard values        
inst.components.crowfriend:SetMaxPeaceBirds(25) -- 25 crows will follow you when you're not fighting        
inst.components.crowfriend:SetMaxWarBirds(12) -- 12 crows will plummet on your oponent to damage it        
inst.components.crowfriend:SetCrowDamage(3) -- each crow will do 3 damage per plummet        
inst.components.crowfriend:SetSpawnTimes(0) -- when a crow vanishes (dies/flies away) a new one will come in after 0 seconds (1 frame)       
inst.components.crowfriend:SetPeaceDistance(25) -- when your enemy is 25 units away crows will stop attacking it        
inst:ListenForEvent("attacked", OnAttacked)        
inst:ListenForEvent("newcombattarget", OnAttack)        
inst:ListenForEvent("giveuptarget", OnGiveUp)        
inst:ListenForEvent("killed", OnGiveUp)

if caster ~= nil and caster.components.sanity ~= nil then caster.components.sanity:DoDelta(0, false)
	
end

The second line is the Wolfgang perk with the condition of shadow creatures, since I don't want her to be afraid of EVERY monster - just the shadow creatures. I'm unsure, though, if my syntax is correct. 

Below that is Winnie's crows perk, which isn't really meant to DO anything but create more crows, but what I found apparently lets the crows help you in combat like Birds of the World, I think. That's not necessary, but neat I think. 

"if caster" is the line meant to eliminate the sanity drain when she uses magic items but I'm fairly certian that's wrong, I just pulled it from the staff.lua main file and changed the dodelta to 0 so

And to top it all off!! I have no idea how to close this. I keep trying to boot the came to see if any of these work but it keeps telling me that there's an unexpected symbol wherever I try to close it. 

For reference, I've attached my modmain.lua 

modmain.lua

Link to comment
Share on other sites

For the losing more sanity from nightmare creatures I think this would work in your modmain.lua

Spoiler

if GLOBAL.TheNet:GetIsServer() then		
	AddComponentPostInit("sanityaura", function(self)
		local old = self.GetAura 
		function self:GetAura(observer) 
			if observer.prefab == "winifred" and self.inst:HasTag("nightmarecreature") then
				return -10 -- Change value to what you want
			end
			return old(self,observer) 
		end
	end)	
end

 

the others I don't really know, sorry :D!

 

EDIT:  @Faerendipitous

"Do you think this would work similarly to negate sanity drain from magic, with some tweaks?"

I don't think so, the only way I can think maybe negate sanity is to copy paste the lua files of all magic things and make them not drain sanity if it's your character, I think :) .

Edited by SuperDavid
Link to comment
Share on other sites

On 1/20/2017 at 0:28 PM, SuperDavid said:

For the losing more sanity from nightmare creatures I think this would work in your modmain.lua

  Reveal hidden contents


if GLOBAL.TheNet:GetIsServer() then		
	AddComponentPostInit("sanityaura", function(self)
		local old = self.GetAura 
		function self:GetAura(observer) 
			if observer.prefab == "winifred" and self.inst:HasTag("nightmarecreature") then
				return -10 -- Change value to what you want
			end
			return old(self,observer) 
		end
	end)	
end

 

the others I don't really know, sorry :D!

This worked for nightmare creatures! Winnie's sanity PLUMMETS when she's near them. She's had a very unfortunate 24 hours with my testing.

Do you think this would work similarly to negate sanity drain from magic, with some tweaks?

Link to comment
Share on other sites

On 1/20/2017 at 0:28 PM, SuperDavid said:

For the losing more sanity from nightmare creatures I think this would work in your modmain.lua

  Reveal hidden contents


if GLOBAL.TheNet:GetIsServer() then		
	AddComponentPostInit("sanityaura", function(self)
		local old = self.GetAura 
		function self:GetAura(observer) 
			if observer.prefab == "winifred" and self.inst:HasTag("nightmarecreature") then
				return -10 -- Change value to what you want
			end
			return old(self,observer) 
		end
	end)	
end

 

the others I don't really know, sorry :D!

 

EDIT:  @Faerendipitous

"Do you think this would work similarly to negate sanity drain from magic, with some tweaks?"

I don't think so, the only way I can think maybe negate sanity is to copy paste the lua files of all magic things and make them not drain sanity if it's your character, I think :) .

@SuperDavid

Through a lot of trial and error, file digging, and general crying, I managed to negate the sanity drain from certain magic items and plan to add in the rest soon!! Also, I just learned you can @ people in the klei forums!! It has been a day of learning UuU 

Thank you so much for your help with the shadow creatures! Now all that's left is THE CROWS!! 

 

Link to comment
Share on other sites

5 minutes ago, SuperDavid said:

No problem! So, I don't really no how to do the crow thingy that's probably very advanced you will have to change the birdattractor.lua or something...I really dunno, so I wish you luck :D!

Thanks!! 

I've found something that LOOKS like it'll work but I'm missing the component file for it, and the site it was hosted on doesn't seem to have it anymore. Might reach out to the OP to see if they have the crowfriend component to make it run right!! 

 

Link to comment
Share on other sites

@Faerendipitous I'm trying to make a mod and the character would suffer no sanity drain in caves but still lose sanity at night and dusk when outside of caves I can't seem to find code for caves specifically. I've also made this post:

and since your mod seems to be going well any help would be appreciated, also interesting perks winnie has!

 

Link to comment
Share on other sites

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
 Share

×
  • Create New...