Jump to content

Please help with the editing of the character


Recommended Posts

11 hours ago, Tezumoto said:

And so again I'm =)
I need to get close to Prestihatitator and Shadow Manipulator sanity go down.

Use this code, it'll do the science machine & other stuff too, put it in your modmain.lua

Spoiler

if GLOBAL.TheNet:GetIsServer() then

	AddPrefabPostInit("researchlab", function(inst)
		inst:AddComponent("sanityaura")
		inst.components.sanityaura.aura = 0
	end)
	
	AddPrefabPostInit("researchlab2", function(inst)
		inst:AddComponent("sanityaura")
		inst.components.sanityaura.aura = 0
	end)
	
	AddPrefabPostInit("researchlab4", function(inst) -- Prestihatitator
		inst:AddComponent("sanityaura")
		inst.components.sanityaura.aura = 0
	end)
	
	AddPrefabPostInit("researchlab3", function(inst) -- Shadow Manipulator
		inst:AddComponent("sanityaura")
		inst.components.sanityaura.aura = 0
	end)
	
	AddComponentPostInit("sanityaura", function(self)
		local old = self.GetAura 
		function self:GetAura(observer) 
			if observer.prefab == "YOURCHARACTERNAMEHERE" and self.inst.prefab == "researchlab" or self.inst.prefab == "researchlab2" and not self.inst.prefab == "researchlab3" and not self.inst.prefab == "researchlab4" then 
				return 5
			elseif observer.prefab == "YOURCHARACTERNAMEHERE" and not self.inst.prefab == "researchlab" and not self.inst.prefab == "researchlab2" and self.inst.prefab == "researchlab3" or self.inst.prefab == "researchlab4" then 
			    return -5
			end
			return old(self,observer) 
		end
	end)			

end

 

 

Link to comment
Share on other sites

		if observer.prefab == "NAME" and self.inst.prefab == "researchlab" or self.inst.prefab == "researchlab2" then 
			return 0.08
		elseif observer.prefab == "NAME" and self.inst.prefab == "researchlab4" or self.inst.prefab == "researchlab3" then
			return -0.08
		end

I simplified the code, and he so works =)

Link to comment
Share on other sites

On 25.12.2016 at 8:56 PM, SuperDavid said:

Use this code, it'll do the science machine & other stuff too, put it in your modmain.lua

  Reveal hidden contents


if GLOBAL.TheNet:GetIsServer() then

	AddPrefabPostInit("researchlab", function(inst)
		inst:AddComponent("sanityaura")
		inst.components.sanityaura.aura = 0
	end)
	
	AddPrefabPostInit("researchlab2", function(inst)
		inst:AddComponent("sanityaura")
		inst.components.sanityaura.aura = 0
	end)
	
	AddPrefabPostInit("researchlab4", function(inst) -- Prestihatitator
		inst:AddComponent("sanityaura")
		inst.components.sanityaura.aura = 0
	end)
	
	AddPrefabPostInit("researchlab3", function(inst) -- Shadow Manipulator
		inst:AddComponent("sanityaura")
		inst.components.sanityaura.aura = 0
	end)
	
	AddComponentPostInit("sanityaura", function(self)
		local old = self.GetAura 
		function self:GetAura(observer) 
			if observer.prefab == "YOURCHARACTERNAMEHERE" and self.inst.prefab == "researchlab" or self.inst.prefab == "researchlab2" and not self.inst.prefab == "researchlab3" and not self.inst.prefab == "researchlab4" then 
				return 5
			elseif observer.prefab == "YOURCHARACTERNAMEHERE" and not self.inst.prefab == "researchlab" and not self.inst.prefab == "researchlab2" and self.inst.prefab == "researchlab3" or self.inst.prefab == "researchlab4" then 
			    return -5
			end
			return old(self,observer) 
		end
	end)			

end

 

 

I had to share code.
Because I wanted to do different switches for science and magic in mod settings =)
But I managed, and everything works fine.

Thank you for help, you helped me a lot!

Edited by Tezumoto
Link to comment
Share on other sites

On 25.12.2016 at 8:56 PM, SuperDavid said:

Use this code, it'll do the science machine & other stuff too, put it in your modmain.lua

  Reveal hidden contents


if GLOBAL.TheNet:GetIsServer() then

	AddPrefabPostInit("researchlab", function(inst)
		inst:AddComponent("sanityaura")
		inst.components.sanityaura.aura = 0
	end)
	
	AddPrefabPostInit("researchlab2", function(inst)
		inst:AddComponent("sanityaura")
		inst.components.sanityaura.aura = 0
	end)
	
	AddPrefabPostInit("researchlab4", function(inst) -- Prestihatitator
		inst:AddComponent("sanityaura")
		inst.components.sanityaura.aura = 0
	end)
	
	AddPrefabPostInit("researchlab3", function(inst) -- Shadow Manipulator
		inst:AddComponent("sanityaura")
		inst.components.sanityaura.aura = 0
	end)
	
	AddComponentPostInit("sanityaura", function(self)
		local old = self.GetAura 
		function self:GetAura(observer) 
			if observer.prefab == "YOURCHARACTERNAMEHERE" and self.inst.prefab == "researchlab" or self.inst.prefab == "researchlab2" and not self.inst.prefab == "researchlab3" and not self.inst.prefab == "researchlab4" then 
				return 5
			elseif observer.prefab == "YOURCHARACTERNAMEHERE" and not self.inst.prefab == "researchlab" and not self.inst.prefab == "researchlab2" and self.inst.prefab == "researchlab3" or self.inst.prefab == "researchlab4" then 
			    return -5
			end
			return old(self,observer) 
		end
	end)			

end

 

 

Hello!
Is it possible to create mod, that only the owner of the walls be able to destroy walls with a hammer?
And other players can only beat your walls with an ax or spear (other weapons).

Edited by Tezumoto
Link to comment
Share on other sites

1 hour ago, Tezumoto said:

Hello!
Is it possible to create mod, that only the owner of the walls be able to destroy walls with a hammer?
And other players can only beat your walls with an ax or spear (other weapons).

That would be too complicated for me since I don't think walls have any actual connection to the player that places them so it require a lot of code I wouldn't know how to do, sorry :(!

Link to comment
Share on other sites

17 minutes ago, SuperDavid said:

That would be too complicated for me since I don't think walls have any actual connection to the player that places them so it require a lot of code I wouldn't know how to do, sorry :(!

It's a pity.
I created a mod to increase the health of the walls.
Then came another player and destroyed my wall with a hammer for 3 hits.
And I understood, my mod useless.

Edited by Tezumoto
Link to comment
Share on other sites

Maybe you can help me with this?

How to edit the effect for objects on the sanity of the character?
I want to change the effects of items from the tab "magic":
1) Negative effect on sanity increased twice.

(Fire Staff, Ice Staff, Telelocator Staff, One-man Band, Night Light, Night Armour, Dark Sword, Bat Bat).
2) The positive effect on sanity down twice.
(Life Giving Amulet, Chilled Amulet, Nightmare Amulet, Belt of Hunger).

Link to comment
Share on other sites

1 hour ago, Tezumoto said:

Maybe you can help me with this?

How to edit the effect for objects on the sanity of the character?
I want to change the effects of items from the tab "magic":
1) Negative effect on sanity increased twice.

(Fire Staff, Ice Staff, Telelocator Staff, One-man Band, Night Light, Night Armour, Dark Sword, Bat Bat).
2) The positive effect on sanity down twice.
(Life Giving Amulet, Chilled Amulet, Nightmare Amulet, Belt of Hunger).

I'm sorry but I also don't know how I would do something like that.. I'm very sorry :(!

Link to comment
Share on other sites

On 29/12/2016 at 7:21 PM, Tezumoto said:

It's a pity.
I created a mod to increase the health of the walls.
Then came another player and destroyed my wall with a hammer for 3 hits.
And I understood, my mod useless.

As far as i know, health of wall is for attack like hound or other monster. If you want to slow the hammering process, you need to slow the "work" process.

Link to comment
Share on other sites

7 hours ago, Lumina said:

As far as i know, health of wall is for attack like hound or other monster. If you want to slow the hammering process, you need to slow the "work" process.

I've finished with walls =)
Now mod not only improves walls HP, but also increases the resistance to hammer blows.

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