Jump to content

Hauntable Qualities, and their differences


Recommended Posts

This is more for others to reference, since I don't see anyone else having discussed it on the forums before.  I found that there are various kinds of 'hauntable' qualities.

MakeHauntableWork(inst)
MakeHauntableLaunch(inst)
MakeHauntableLaunchAndIgnite(inst)

These are just some of the ones I've found so far.  The differences are kind of subtle, like "MakeHauntableLaunch(inst)" and "MakeHauntableLaunchAndIgnite(inst)" appear to do exactly the same thing, but I hope this record might help someone someday.

Edited by FurryEskimo
Link to comment
Share on other sites

Just now, FurryEskimo said:

This is more for others to reference, since I don't see anyone else having discussed it on the forums before.  I found that there are various kinds of 'hauntable' qualities.


MakeHauntableWork(inst)
MakeHauntableLaunchAndIgnite(inst)
MakeHauntableLaunch(inst)

These are just some of the ones I've found so far.  The differences are kind of subtle, like "MakeHauntableLaunch(inst)" and "MakeHauntableLaunchAndIgnite(inst)" appear to do exactly the same thing, but I hope this record might help someone someday.

MakeHauntableWork and MakeHauntableLaunchAndIgnite dont really do anything. Way back when DST was being developed ghosts were a lot more destructive and could destroy structures and ignite items, but they removed that and MakeHauntableWork does nothing and MakeHauntableLaunchAndIgnite is pretty much identical to MakeHauntableLaunch now.

Link to comment
Share on other sites

@Hornete
Yeahhh, that's kind of the impression I got when I was testing it.  I was poking around in the code and finding all different versions of haunting, so even though they're either pointless or outdated, it's still in the code.  Maybe so someone can recode the hauntable features back in for a mod?

  • Like 1
Link to comment
Share on other sites

Just now, FurryEskimo said:

@Hornete
Yeahhh, that's kind of the impression I got when I was testing it.  I was poking around in the code and finding all different versions of haunting, so even though they're either pointless or outdated, it's still in the code.  Maybe so someone can recode the hauntable features back in for a mod?

Yeah it'd be very easy to do. The code is just commented out, someone could uncomment the lines out and the original features will be back :D

Link to comment
Share on other sites

10 hours ago, Hornete said:

MakeHauntableWork and MakeHauntableLaunchAndIgnite dont really do anything. Way back when DST was being developed ghosts were a lot more destructive and could destroy structures and ignite items, but they removed that and MakeHauntableWork does nothing and MakeHauntableLaunchAndIgnite is pretty much identical to MakeHauntableLaunch now.

um, you ignite pig torches and haunting pig heads makes them glow though? also you can knock down trees by haunting them. it seems a bit dubious that those are all controlled only by launch. do you know how that one line was used to do the function of all three?

Link to comment
Share on other sites

@gaymime
I’ve never been able to chop down any trees as a ghost, only convert pigs and flowers into evil versions, and scare away some creatures.  My guess is that the effects of haunting are coded into the individual prefabs or brains, but I haven’t really figured out all the haunt code yet.

Edited by FurryEskimo
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, FurryEskimo said:

@gaymime
I’ve never been able to chop down any trees as a ghost, only convert pigs and flowers into evil versions, and scare away some creatures.  My guess is that the effects of haunting are coded into the individual prefabs or brains, but I haven’t really figured out all the haunt code yet.

1 haunting = 1 chop

it takes a while x''D

Link to comment
Share on other sites

7 hours ago, gaymime said:

you ignite pig torches and haunting pig heads makes them glow though? also you can knock down trees by haunting them.

Those are programmed in their prefab files. As you can see here the code responsible for smashing/igniting in the MakeHauntable functionsnare commented out.

 

unknown-109.png

Link to comment
Share on other sites

Hauntable features:

Most of them, they're in their prefabs.



local function onhauntwork(inst, haunter)
    if inst.components.workable ~= nil and math.random() <= TUNING.HAUNT_CHANCE_OFTEN then
        inst.components.workable:WorkedBy(haunter, 1)
        inst.components.hauntable.hauntvalue = TUNING.HAUNT_SMALL
        return true
    end
    return false
end

local function onhauntevergreen(inst, haunter)
    if math.random() <= TUNING.HAUNT_CHANCE_SUPERRARE and
        find_leif_spawn_target(inst) and
        not (inst:HasTag("burnt") or inst:HasTag("stump")) then

        inst.leifscale = GetGrowthStages(inst)[inst.components.growable.stage].leifscale or 1
        spawn_leif(inst)

        inst.components.hauntable.hauntvalue = TUNING.HAUNT_HUGE
        inst.components.hauntable.cooldown_on_successful_haunt = false
        return true
    end
    return onhauntwork(inst, haunter)
end

        ---------------------

        inst:AddComponent("hauntable")
        inst.components.hauntable:SetOnHauntFn(build ~= "twiggy" and onhauntevergreen or onhauntwork)

(prefabs/evergreens.lua)

Because of SetOnHauntFn, tree that is not twiggy one will call 'onhauntevergreen' or 'onhauntwork', which will spawn very rarely a Treeguard, or chop for one time most of the time.

 

But some of the MakeHauntable~~ functions are still working, according to hound.lua:

if morphlist ~= nil then
	MakeHauntableChangePrefab(inst, morphlist)
	inst.components.hauntable.panicable = true
	inst:ListenForEvent("spawnedfromhaunt", OnSpawnedFromHaunt)
else
	MakeHauntablePanic(inst)
end

because of MakeHauntableChangePrefab, Hound can morph to special hounds(red or blue) or backwards(special to normal one).

But where is all of MakeHauntable functions listed? I'm trying to find them but they're hidden in somewhere?

  • Like 1
Link to comment
Share on other sites

13 minutes ago, gaymime said:

was nixed to make the game more stable?

Idk what you mean by more stable, code-wise it all worked perfectly. It's just something the devs didnt like and thought wasnt a good idea to have ghosts be so destructive so they removed the mechanic.

Link to comment
Share on other sites

4 hours ago, Hornete said:

Idk what you mean by more stable, code-wise it all worked perfectly. It's just something the devs didnt like and thought wasnt a good idea to have ghosts be so destructive so they removed the mechanic.

clearly they did not remove it as the action is still active, it is just not there in that spot anymore. unless you and i are not talking about the same thing at all it sounds like the code was moved to a different place and this is just remnants of when it was here instead

Edited by gaymime
Link to comment
Share on other sites

4 minutes ago, gaymime said:

clearly they did not remove it as the action is still active, it is just not there in that spot anymore. unless you and i are not talking about the same thing at all it sounds like the code was moved to a different place and this is just remnants of when it was here instead

The pig lights and evergreens specifically have it coded in their own files to have a chance to ignite/be worked. The MakeHauntableWork and MakeHauntableLaunchAndIgnite functions used to do these things too and were used on a much larger scale for 10s and 10s of different prefabs and entities, the code for igniting and working was removed in those functions so the functionality was removed for 10s and 10s of items too except the pig torch and evergreens.

 

Get it now?

Link to comment
Share on other sites

15 hours ago, Hornete said:

The pig lights and evergreens specifically have it coded in their own files to have a chance to ignite/be worked. The MakeHauntableWork and MakeHauntableLaunchAndIgnite functions used to do these things too and were used on a much larger scale for 10s and 10s of different prefabs and entities, the code for igniting and working was removed in those functions so the functionality was removed for 10s and 10s of items too except the pig torch and evergreens.

 

Get it now?

i got it before. my issue was your statements which needed clarification and not the actuality of the game. what you were saying did not line up correctly with what was in the game itself. this is the first time you've actually agreed that the functions do still work AND expressed where they are now which is what i wanted to know in my first post

 

or more succinctly; you kept saying all of the code was removed and showing where the code was removed instead of saying most of the code just got moved elsewhere and this was a redundant legacy code

Edited by gaymime
typo
Link to comment
Share on other sites

I skimmed your conversation, and I think he meant that it didn’t work, mechanically, as in it made gameplay worse, not that the code itself was broken.  The old code is apparently still in there, and if someone wanted to reactivate it, they could, right?

  • Thanks 1
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...