Replies: 14 (Who?), Viewed: 692 times.
Lab Assistant
Original Poster
#1 Old 18th Dec 2020 at 6:26 PM
Default Ghost Overhaul - Brainstorming and Discussion
So, here am I again, after adding the duel to death interaction on my swordfighting mod, in the way to make a mod that alters the death aspect of this game we know and love so much. Ironic, isn't it?
Well, basically... The purpose of my new project is to make ghosts a real problem to those unfortunate sims who have a tombstone in their lots. To accomplish this, I've thought of a few improvements to be done to the life state:

- Make the haunted moodlet from supernatural's haunting curse to appear automatically when a ghost is in the same room as a sim... Except if the sim is brave... Or evil. If evil, he would gain a positive moodlet instead.

- Don't know if this can be done, but perhaps making a ghost invisible, only truly manifesting it's spectral form after certain conditions are met.

- Add interactions for ghost sims to break appliances, from sinks to televisions.

I am open to suggestions... And help, of course, because I still want to understand how exactly to do those items.
Advertisement
Lab Assistant
#2 Old 19th Dec 2020 at 12:14 AM
Oh, I love this idea!

For breaking appliances, I think drowned and electrocuted ghosts can already do that for plumbing and electronics respectively, right? Or maybe it’s just that the haunt interaction always has a chance to break the object it’s used on? If either of those is actually correct, maybe you could edit that interaction to be more consistently destructive, or unlock it for ghosts that wouldn’t normally have it by editing the procedural test.

This sounds fun, if you ever need another pair of eyes on some code I’d be happy to check it out!
Lab Assistant
Original Poster
#3 Old 20th Dec 2020 at 12:44 AM
Quote:
Originally Posted by lizcandor
Oh, I love this idea!

For breaking appliances, I think drowned and electrocuted ghosts can already do that for plumbing and electronics respectively, right? Or maybe it’s just that the haunt interaction always has a chance to break the object it’s used on? If either of those is actually correct, maybe you could edit that interaction to be more consistently destructive, or unlock it for ghosts that wouldn’t normally have it by editing the procedural test.

This sounds fun, if you ever need another pair of eyes on some code I’d be happy to check it out!


@lizcandor ,

Good! I'm trying to first make the ghosts disseminate the haunted moodlet. How exactly could I accomplish this? And, do you have any idea on how could I make the invisible ghost thingies?
Lab Assistant
#4 Old 20th Dec 2020 at 2:56 AM Last edited by lizcandor : 20th Dec 2020 at 5:54 AM.
I'm not sure, but that might be possible with a reaction broadcaster? I've never used one but have seen them in passing while looking for other stuff. And there's a method I've seen while tracing calls to the attraction status between sims that checks a sim's environment, sees who else is nearby, and applies buffs (like Attractive Company) as needed; that's probably too deep to be reachable for this mod but could give you some ideas. I'd give you the method name but I'm not on the computer I run ILSpy on at the moment. Or, maybe you could look at the university mascot? I know there's a moodlet about school spirit or something that gets applied to everyone near that sim.

For making ghosts invisible, though, I have no idea Closest I can think of to a suggestion is that The Sims Wiki says (with a "confirmation needed" tag attached) that fire ghosts become invisible when they get into pools, so maybe investigating that would lead to something useful?
Lab Assistant
Original Poster
#5 Old 20th Dec 2020 at 4:28 PM
Quote:
Originally Posted by lizcandor
I'm not sure, but that might be possible with a reaction broadcaster? I've never used one but have seen them in passing while looking for other stuff. And there's a method I've seen while tracing calls to the attraction status between sims that checks a sim's environment, sees who else is nearby, and applies buffs (like Attractive Company) as needed; that's probably too deep to be reachable for this mod but could give you some ideas. I'd give you the method name but I'm not on the computer I run ILSpy on at the moment. Or, maybe you could look at the university mascot? I know there's a moodlet about school spirit or something that gets applied to everyone near that sim.

For making ghosts invisible, though, I have no idea Closest I can think of to a suggestion is that The Sims Wiki says (with a "confirmation needed" tag attached) that fire ghosts become invisible when they get into pools, so maybe investigating that would lead to something useful?


@lizcandor ,

Is there some way of making the "hiding" of certain spawners apply to actual sims? I've thought of trying to make it like the spirits that you can reveal with that ghost hunter thing.
Lab Assistant
#6 Old 20th Dec 2020 at 5:08 PM Last edited by lizcandor : 20th Dec 2020 at 7:21 PM.
I don't know but that's a good idea!

Edit: I checked in the Stairs class since that's what I'd been looking at lately, and there's mention of hiding and un-hiding the stairs; so it's possible hiding is something that could be done to any object, maybe including a Sim object.

Another approach to what you're trying to do could be to create a custom motive that's extremely heavily advertised by the haunt interaction; add that motive to all ghosts so all they ever want to do is haunt objects, over just wandering a lot in visible form; and then remove the motive once your conditions are met so the ghosts are freed from the haunting compulsion. Just an idea in case hiding them is too much of a challenge.
Lab Assistant
#7 Old 20th Dec 2020 at 9:11 PM Last edited by FloTheory : 22nd Dec 2020 at 4:57 PM.
Quote:
Originally Posted by CyrusBanefort
So, here am I again, after adding the duel to death interaction on my swordfighting mod, in the way to make a mod that alters the death aspect of this game we know and love so much. Ironic, isn't it?
Well, basically... The purpose of my new project is to make ghosts a real problem to those unfortunate sims who have a tombstone in their lots. To accomplish this, I've thought of a few improvements to be done to the life state:

- Make the haunted moodlet from supernatural's haunting curse to appear automatically when a ghost is in the same room as a sim... Except if the sim is brave... Or evil. If evil, he would gain a positive moodlet instead.

- Don't know if this can be done, but perhaps making a ghost invisible, only truly manifesting it's spectral form after certain conditions are met.

- Add interactions for ghost sims to break appliances, from sinks to televisions.

I am open to suggestions... And help, of course, because I still want to understand how exactly to do those items.


That's a great project, I also think ghost should have more repercussions on sims. For instance sims who see them could have a chance to acquire the "insane" trait, or something like that.
Lab Assistant
Original Poster
#8 Old 20th Dec 2020 at 9:38 PM
So, I've checked the code for the Haunt interactions, and it seems there are two of them - One exclusive to the ghost hunting situations, which is called Angry Haunt, and the base game one, who does... Nothing, apart from making the object float. The angry one actually causes some damage in the property, charring things, breaking things, etc. My goal is to unlock this interaction and allow it to be usable by all ghosts. How could I do that? And, which do you prefer, for it to be always happening or only if the ghost is angry? (In this case, I will need to figure out how to actually measure how the ghost is angry)
Lab Assistant
#9 Old 20th Dec 2020 at 11:36 PM
Cool! Looking at AngryHaunt, I think the easiest way to make it always available (seems like it might only be available during ghost hunter jobs, normally?) might be to just copy most or all of that code into a class of your own, as a totally new interaction that you add to every ghost (GhostHunterJob.CreateAngryGhost and GhostHunterJob.OnLoadFixup do this with AddSoloInteraction, although you might have already seen that), and then edit the part where it checks the ghost's death type before deciding whether to break the haunted object so the object just always breaks/burns/etc no matter what kind of ghost is responsible.
Lab Assistant
Original Poster
#10 Old 21st Dec 2020 at 11:08 PM
So, where exactly could I find the code for the reaction broadcasters?
Virtual gardener
staff: administrator
#11 Old 21st Dec 2020 at 11:18 PM
Just a small heads up! I've noticed that the Haunt interaction seems either for the "ghosts" objects and others as a social interaction  So check if it's linked to a gameobject before you do anything! I might have screwed that one up before :p

If I can add stuff to the list  here are a few ideas:

- I personally loved it when coward sims would faint when they'd see a sim! (Although I do remember back in 2010 or something, EVERY sim would faint if they saw a ghost :p) I personally would even add a 30% chance that a coward sim could faint. I wonder if they still do this? I haven't seem it at least
- They can *randomly* haunt any house, would be great if they're invisible
- Have like a "DIY Ghost hunting" tool that can eventually change the ghost from invisible to visible
- Drowned sim leave puddles (As they did in TS2) And ghosts that died of starvation will want to eat a lot? So basically that as it was in ts2
- Regards to invisible again. Maybe some sims have "The gift" which would mean that they're the only ones seeing that sim? (Check the imaginary friend code for that one )

Overall all the things you've suggested here:

Quote:
- Make the haunted moodlet from supernatural's haunting curse to appear automatically when a ghost is in the same room as a sim... Except if the sim is brave... Or evil. If evil, he would gain a positive moodlet instead.

- Don't know if this can be done, but perhaps making a ghost invisible, only truly manifesting it's spectral form after certain conditions are met.

- Add interactions for ghost sims to break appliances, from sinks to televisions.


Are pretty doable! I think what might help too is looking at the tragic clown buff, since other sims will get the "It's so Tragic" buff when they're near them  Then it's just a matter of adding a few if statements for the brave sims and voila!

Making sims invisble is easy! Just do:
Code:
 base.Actor.SetOpacity(0f, 0f);
And if you ever need to change it to a solid sim again:

Code:
 base.Actor.SetOpacity(1f, 0f);
(The first 1f being from a scale of 0 to 1f, how translucent the sim/object needs to be) and 0f is the transition time. Which can be anything really. 0f in this case that there isn't any transition time.

Just wondering if Nraas will hate it though, since they have this whole "Fix invisible sim" stuff :p But EA has been doing this on bonehilda and mummies and what not. So I think it's 

For the adding interactions however... This really depends on your approach. Is it *when* they use the sink or just around it? Else you'll have to override the 'use sink' interaction (Which is easy! But might conflict with Zoe's Functioning Well)

Just let me know if you need some help indeed! I got some snippets ready for you to make it a bit easier  
Lab Assistant
Original Poster
#12 Old 22nd Dec 2020 at 10:51 PM
Quote:
Originally Posted by Lyralei
Just a small heads up! I've noticed that the Haunt interaction seems either for the "ghosts" objects and others as a social interaction  So check if it's linked to a gameobject before you do anything! I might have screwed that one up before :p

If I can add stuff to the list  here are a few ideas:

- I personally loved it when coward sims would faint when they'd see a sim! (Although I do remember back in 2010 or something, EVERY sim would faint if they saw a ghost :p) I personally would even add a 30% chance that a coward sim could faint. I wonder if they still do this? I haven't seem it at least
- They can *randomly* haunt any house, would be great if they're invisible
- Have like a "DIY Ghost hunting" tool that can eventually change the ghost from invisible to visible
- Drowned sim leave puddles (As they did in TS2) And ghosts that died of starvation will want to eat a lot? So basically that as it was in ts2
- Regards to invisible again. Maybe some sims have "The gift" which would mean that they're the only ones seeing that sim? (Check the imaginary friend code for that one )

Overall all the things you've suggested here:



Are pretty doable! I think what might help too is looking at the tragic clown buff, since other sims will get the "It's so Tragic" buff when they're near them  Then it's just a matter of adding a few if statements for the brave sims and voila!

Making sims invisble is easy! Just do:
Code:
 base.Actor.SetOpacity(0f, 0f);
And if you ever need to change it to a solid sim again:

Code:
 base.Actor.SetOpacity(1f, 0f);
(The first 1f being from a scale of 0 to 1f, how translucent the sim/object needs to be) and 0f is the transition time. Which can be anything really. 0f in this case that there isn't any transition time.

Just wondering if Nraas will hate it though, since they have this whole "Fix invisible sim" stuff :p But EA has been doing this on bonehilda and mummies and what not. So I think it's 

For the adding interactions however... This really depends on your approach. Is it *when* they use the sink or just around it? Else you'll have to override the 'use sink' interaction (Which is easy! But might conflict with Zoe's Functioning Well)

Just let me know if you need some help indeed! I got some snippets ready for you to make it a bit easier  


Very good ideas! I will look into the imaginary friend code. About the DIY Ghost Hunting, I thought about adding some spells for witches to banish unwanted spirits to the netherworld.
Lab Assistant
Original Poster
#13 Old 23rd Dec 2020 at 10:49 PM
Ok, I'm thinking about using that custom motive idea. Where exactly could I find a tutorial on creating custom motives? Or perharps I could simply make it so that on world load all ghosts are set to invisible, and only appear when using the ghost hunting tools?
Lab Assistant
#14 Old 24th Dec 2020 at 4:21 PM
Quote:
Originally Posted by CyrusBanefort
Where exactly could I find a tutorial on creating custom motives?

I don't think there is a tutorial, actually - I used SimsMX's hypochondriac trait and Arsil's Japanese culture trait as examples, though, since they both use custom motives (CommodityKinds), on Arsil's recommendation in their custom traits tutorial.

But! I actually think Lyralei's idea is better, because motives/CommodityKinds are kind of hard to debug (or at least they have been for me) and I'm still not even sure if the ones I've made actually are working or if it just seems like they are. Setting every ghost to be invisible on world load and then making them visible again later seems much more debug-able.
Lab Assistant
Original Poster
#15 Old 9th Jan 2021 at 3:26 AM
Somebody could explain to me how exactly I could create a Reaction Broadcaster to... Well, broadcast the haunted buff to the sims? Sorry for the long time without updates, going through some personal problems.
Back to top