Read mood files?

Banana Lord

Member
Can an ash script determine what is in a player's mood? That includes the currently active mood and any other moods saved in the correct folder.
 

Grotfang

Developer
Your best bet (if you want a script to handle your moods) is to have a default mood of call mood.ash (or something similar). Set it as an unconditional trigger and you can script it to your heart's content.
 

Banana Lord

Member
Hmm, I was more interested in letting users edit one of their own moods and have my script make decisions based on what they put in it (there'd be a user-configurable setting to tell the script which mood to look at).
 

Banana Lord

Member
Random mood question: If I add preternatural greed to my mood mafia will summon my demon before adventuring again, but what happens if I've already summoned a demon that day? Will mafia abort as it usually does when you try to summon a demon more than once a day, or will it just keep going as normal?
 

Banana Lord

Member
How inconvenient. Back to my second-best option I guess. Thanks for your help, it saved me wasting some time trying it myself.
 

Bale

Minion
Well, it is still possible to add it to a mood. You just need to be more clever. Remember that you can put ash in a mood, so write a tiny bit of code that checks the property and ensures you have the necessary items before summoning. Then put that in the mood.
 

Banana Lord

Member
Unfortunately my goal is to allow a user of my script to specify a preexisting mood (or one that they make themselves, especially for my script) with a script setting, rather than supply one myself (additional download, increased complexity for the user, another thing for me to keep up to date). Essentially I was hoping that (the new version of) the Neo-Cow Farming Script would be able let a user handle effect acquisition themselves, via their mood. I guess I'll just have to implement special handling for acquiring demon effects.
 

slyz

Developer
If the user can specify the name of a mood, you can simply do:
PHP:
cli_execute ( "mood " + user_mood );
 

Banana Lord

Member
I think we're talking about different things (if not then I'm lost). My vision of the future:
• User specifies the name of the mood they want to use during farming as part of script setup
• User puts whatever they want into their mood, in whatever way makes them happy
- This includes things like casting empathy x times, using nasal spray and, in my ideal world, they could add preternatural greed to their mood in the same way.

This would give the user a single, unified location for all of the effects they want to run during farming and I wouldn't have to worry about making sure that their demon gets summoned before they start farming. Perfectly doable, but it was a small piece of complexity that I was hoping to avoid.
 

slyz

Developer
Oh ok. Then it would be up to the user to add the demon summoning smartly. It's probably simpler to have the script automatically decide if the farming location makes summoning preternatural greed worth it.
 

Banana Lord

Member
That's basically everywhere since there isn't a better demon to summon, unless you happen to want one of the other effects for something else. I think I'll just revert to the script's original behaviour and have a user configurable option for demon summoning. If you have a better suggestion then I'm all ears.
 

slyz

Developer
Summoning drinks and selling them in the mall can be better than preternatural greed if you are adventuring in the zone where monsters drop no or very little meat.
 

Banana Lord

Member
That's true. But I don't think it's worth the effort to take all that into account. I'll add a ncf_summon_demon option and let the user configure which demon they summon.
 
Can an ash script determine what is in a player's mood? That includes the currently active mood and any other moods saved in the correct folder.

So, I'm digging around today and I find the answers to these questions.

Turns out, all your defined moods are saved in settings/myname_moods.txt.

Your currently active mood name is held in the property "currentMood".

This has me thinking about my mood questions...
 

Bale

Minion
I know that, but Mafia still has no way of reading that file with file_to_map(), so unless I'm missing something... Please let me in on your brainstorm.
 
Top