Jump to content

Recommended Posts

Ok this one sounds a bit weird from the title alone. I'm remaking an old character mod I made. And I had an idea for a perk of sorts that allows him to essentially sacrifice himself to summon the current seasons boss early. Or immediately respawn them. So, in Winter you can get several deerclops eyeballs if you and your team is good enough/well prepared for it. Bearger in the first autumn. Dragonfly farming in the summer. And extra moose/goose in spring, if you really wanted to, I guess?

I have a voodoo doll item made. And it works as a fuel source. What I want to do is make it so when it's used as fuel in a fire, it kills the custom character. (Preferably only the closest one/the one that threw it in, if multiple people are playing as said character) And then have the boss spawn close by. Or just set their spawn timer down to basically nothing.

How would I go about implementing this?

I'm thinking something along the lines of this would probably be used somewhere for it:

if data.season == SEASONS.WINTER then

But that's all I really got, I'm not familiar with coding at all. Just enough to piece stuff together properly. 

If it helps; I've attached the item lua if anyone wants to take a look at it to help. 

voodoo.lua

Well, you can use a ListenToEvent on the doll, checking when it is burned at the campfire. And then add a tag to your character and use a FindFirstEntityWithTag("tag") (maybe the function is not called that, but you can find it) and then kill it with some health component's function. To spawn the correct boss, you can check the season with TheWorld.state.something (I don't remember exactly how it is) and then use a boss = SpawnPrefab("boss") and teleport it somewhere, like the position of the campfire, with boss.Transform:SetPosition(doll_object:GetPosition():Get()), again, I don't the corrects names so you need to check other files and etc.

Edited by Leonidas IV

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