Recommended Posts

I had since removed the line of code but the first file I posted still has it.

inst.components.sanity.custom_rate_fn = sanityfn
local function sanityfn(inst)local delta = 0if TheWorld.state.isday thendelta = -0.25 elseif TheWorld.state.isdusk thendelta = 0.5 elseif TheWorld.state.isnight thendelta = 0.95 endreturn delta end

I grabbed it from the file I had posted before. this code caused a lot of problems in my mod. I am also currently trying to make the weapon for her, everything works perfectly except for one thing, I cannot see the inventory image nor the item swap image so I believe I have some major coding errors in that one.

Share this post


Link to post
Share on other sites
ZupaleX    179

It was not working because you define the function after using it.Invert the order of the 2 lines and it should work better.

Share this post


Link to post
Share on other sites
ZupaleX    179

I sure hope that what you copied/paste is not how it is formatted in your script?

Share this post


Link to post
Share on other sites

No I fixed it up, i.e making sure the then statements are actual statements and not literally connected to the deltas, I did miss one when I fixed it and handled that but the problem now is the equals sign that is expected near one of the deltas.

Share this post


Link to post
Share on other sites
local function sanityfn(inst)local delta = 0 if TheWorld.state.isday then delta = -0.25 elseif TheWorld.state.isdusk then delta = 0.5 elseif TheWorld.state.isnight then delta = 0.95 end return delta 

end
inst.components.sanity.custom_rate_fn = sanityfn

This is the code that is "fixed".

Share this post


Link to post
Share on other sites
ZupaleX    179
local function sanityfn(inst)
	local delta = 0

	if TheWorld.state.isday then 
		delta = -0.25 
	elseif TheWorld.state.isdusk then 
		delta = 0.5 
	elseif TheWorld.state.isnight then 
		delta = 0.95 
	end 

	return delta 
end

inst.components.sanity.custom_rate_fn = sanityfn

Try that one

  • Thanks 1

Share this post


Link to post
Share on other sites

Now there is one more thing, She is supposed to have a weapon called cruel moon I have it done artwork and everything but it doesn't show up which seems to be a common problem on the thread I was following . What I mean is the inventory image doesn't show up nor does the swap image but the ground image does, I followed the instructions completely but I got a feeling I am missing something pretty big which is causing this problem.  I have it separate from her right now and will attempt to transfer everything when it is ready.

CruelMoon.zip

Share this post


Link to post
Share on other sites

one question how do I resize a sprite in Spriter? I fixed the problem now the scythe is as big as a full grown tree and I cannot seem to be able to change it's size.

Share this post


Link to post
Share on other sites
ZupaleX    179

You have properties for the scale in spriter when you click on an entity. That should do the trick. Let me know if it doesn't

Share this post


Link to post
Share on other sites

I edited to size using the properties and it is not working :/ I did remove the atlas and recompile it before starting up the game.

Share this post


Link to post
Share on other sites
ZupaleX    179
Posted (edited)

I think then you actually need to increase the size of the png itself

Edited by ZupaleX

Share this post


Link to post
Share on other sites
ZupaleX    179

if you want to rescale everything by the same factor there is a workaround though. you can use AnimState:SetScale(some_value)

Share this post


Link to post
Share on other sites

I already scaled it, and replaced the original that was in the file. but where would I put that code in the "weaponname".lua?

Share this post


Link to post
Share on other sites

Okay, How do I make an animation loop? I have the loop enabled in spriter but that is to just loop the playback of said animation. Also I still want that ability to kill any character without the tag "keeper"

Share this post


Link to post
Share on other sites
Lumina    1,290


 

    inst.AnimState:PlayAnimation("idle",true)

I think the true is for make the anim loop.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Alright new question, Is there a way to have a custom Description of an item from each of the characters. For instance when you describe something like a flower as wilson he says something about but other character say something else? I'm not very good at explaining stuff.

Share this post


Link to post
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