CREATE YOUR AI CUM SLUT ON CANDY.AI TRY FOR FREE
x
Apr 23, 2022
146
90
Could someone help me? I'm trying to set up a rule with a complicated condition... Put simply:

If (person) is in (leader role), then rule always applies.
If (leader role) is empty, then rule always applies.
If (leader role) is not empty, then rule never applies.

I cannot figure out how to detect whether the role is empty or not. The only entity the rule condition seems to look at is the slave currently under consideration, and nobody else.
If you're using plain text mode or a getter black, you can reference global variables. Leaders are stored in variables S.Madam, S.DJ, and so on, by slave IDs, and empty role is a null.

The condition you need is "!S.Madam || c.slave.assignment == Job.MADAM" (or whatever other leader role you need), though I think in block mode you can check the latter part with a special block instead.
 
  • Like
Reactions: scrumbles

Zorlond

Member
Jun 15, 2021
351
476
If you're using plain text mode or a getter black, you can reference global variables. Leaders are stored in variables S.Madam, S.DJ, and so on, by slave IDs, and empty role is a null.

The condition you need is "!S.Madam || c.slave.assignment == Job.MADAM" (or whatever other leader role you need), though I think in block mode you can check the latter part with a special block instead.
I tried to use this in multiple ways and modes and the game kept spitting out: Condition has errors: true is not a function. Ternaries conditions accepts only booleans or numbers. Condition group only accepts boolean and number conditions.

Didn't seem to matter how I tried to use it, it just would not take it.
 

Zorlond

Member
Jun 15, 2021
351
476
How did you write it? This apparently works:
Code:
context => ((slave) => (!S.Madam || slave.assignment === Job.MADAM))(context.slave)
Yeesh, my coding knowledge is so out-of-date it's not funny anymore. :( All I had was the "!S.Madam || slave.assignment === Job.MADAM' portion, I have no idea what any of the rest of that means.

But thanks to you, I now have a working rule that operates as intended. Much appreciated. :)
 
  • Like
Reactions: scrumbles
Apr 23, 2022
146
90
I have no idea what any of the rest of that means.
Plain text conditions have special format. "context =>" goes in the beginning, and slave object has to be referenced as "context.slave". You can use any name/string instead of "context" as long as it's consistent within that rule, I just use "c" in mine.

I actually don't understand how scrumbles' code works; it looks like an outdated format to me, or maybe it's just a more obscure way of doing the same.
Here's full code I'd use for the check you need:
c => !S.Madam || c.slave.assignment === Job.MADAM
 

Zorlond

Member
Jun 15, 2021
351
476
Could someone help me? I'm trying to set up a rule with a complicated condition... Put simply:

If (person) is in (leader role), then rule always applies.
If (leader role) is empty, then rule always applies.
If (leader role) is not empty, then rule never applies.

I cannot figure out how to detect whether the role is empty or not. The only entity the rule condition seems to look at is the slave currently under consideration, and nobody else.
Update...

For some reason, even though the code you guys suggested works perfectly fine for most leadership jobs, it's not working correctly for the Schoolteacher role. (despite working just fine for Nurse, Farmer, Milkmaid, and Attendant jobs)

Code:
context => ((slave) => (!S.Teacher || slave.assignment === Job.TEACHER))(context.slave)
This is the condition I'm using there, basically identical to the others save for the job name. But now that I have two candidates for the job, it's not preventing the alternate trying to be a teacher and failing because the job's already filled. I think it's the 'Job.TEACHER' portion that might be incorrect, but none of the synonyms I've tried worked either. Even looked at the variables in Debug mode, and the job is never referred to anything other than 'Teacher'. Any ideas?
 
Jan 18, 2021
329
564
Update...

For some reason, even though the code you guys suggested works perfectly fine for most leadership jobs, it's not working correctly for the Schoolteacher role. (despite working just fine for Nurse, Farmer, Milkmaid, and Attendant jobs)

Code:
context => ((slave) => (!S.Teacher || slave.assignment === Job.TEACHER))(context.slave)
This is the condition I'm using there, basically identical to the others save for the job name. But now that I have two candidates for the job, it's not preventing the alternate trying to be a teacher and failing because the job's already filled. I think it's the 'Job.TEACHER' portion that might be incorrect, but none of the synonyms I've tried worked either. Even looked at the variables in Debug mode, and the job is never referred to anything other than 'Teacher'. Any ideas?
I think that Job.TEACHER is correct, but you should use S.Schoolteacher instead of S.Teacher.
 

esoom

Well-Known Member
Sep 6, 2017
1,063
1,261
Does anyone know how to make a more complicated rule,

For example I made a rule to dress all non obedient slaves with a gag + porcelain mask to make the obedient faster, but now I need a rule to remove it when they are > 20 devotion, but I don't want them to remove it if they are not submissive or if they are not nympho.

I has this rule which does one of the 2 things fine.
c => (c.slave.devotion > 20) && (c.slave.fetish != "submissive") && (c.slave.mouthAccessory === "bit gag" && c.slave.faceAccessory === "porcelain mask")

This would be the rule for only removing if not nympho
c.slave.energy < 96

How would I combine this into one rule, obviously if I added the energy it would always trigger removing if they are submissive or not. Is there a way of adding if else statements to rules?
 
Jun 22, 2019
87
12
I have trouble installing the AI generator. Python, git and stablediffusion go through but after I doubleclick webui-user.bat it tries to d/l something 'torch' - and it fails every time without fail. I get red messages and an error code: 2 ?

Does anybody know what seems to be my boggle?
 

GammaXai

Active Member
Oct 5, 2018
680
350
I have trouble installing the AI generator. Python, git and stablediffusion go through but after I doubleclick webui-user.bat it tries to d/l something 'torch' - and it fails every time without fail. I get red messages and an error code: 2 ?

Does anybody know what seems to be my boggle?
Are you sure you got the extremely specific version of python you were told to get and it is the only / first version installed on your computer? torch is version dependent so it throws a fit when the script is trying to install a specific version of torch to a nonmatching version of python.
 
  • Like
Reactions: Saitama520
Jun 22, 2019
87
12
Are you sure you got the extremely specific version of python you were told to get and it is the only / first version installed on your computer? torch is version dependent so it throws a fit when the script is trying to install a specific version of torch to a nonmatching version of python.
The Python version is 3.10.6. I believe that is the one they asked for?
 

Saitama520

Newbie
Jun 16, 2018
77
77
The Python version is 3.10.6. I believe that is the one they asked for?
That is correct; how much memory does your system have? The seem to be running out of memory on installation thus it fails. Is there a "MemoryError" near the end of the console messages?
 
Jun 22, 2019
87
12
1723789787662.png
1723789787683.png
Here are two pictures of the error message I deem interesting. It appears I have a decryption problem with SSL? This is running in a sandbox. Maybe it needs some sort of special permission?
 

scrumbles

Well-Known Member
Jan 12, 2019
1,069
1,096
For example I made a rule to dress all non obedient slaves with a gag + porcelain mask to make the obedient faster, but now I need a rule to remove it when they are > 20 devotion, but I don't want them to remove it if they are not submissive or if they are not nympho.
If I have understood your question correctly, I'd make two rules.

1st rule: it lets slaves live without masks and gags.
Condition: Always
Both Appearance->Gag and Appearance->Mask set to None (or whatever you like)

2nd rule: it forces non-devoted, but also non-submissive and non-nympho slaves to wear a gag and a mask.
Condition: c => (c.slave.devotion < 21 || c.slave.fetish !== "submissive" || c.slave.energy < 96)
Appearance->Gag set to "Ball gag" (or "Dildo gag" or whatever), and Appearance->Mask set to "Porcelain mask"

The 2nd rule must be to the right of the 1st rule, so that it has higher priority. This way, only slaves who, at the same time, are obedient, submissive, AND nympho, are safe from the 2nd rule.
 

MagnaSonic3000

Well-Known Member
Jan 22, 2018
1,089
1,481
I tried to figure out the AI thing, but I got frustrated and quit when I couldn't even get my own already prepared images onto the game.
 

Saitama520

Newbie
Jun 16, 2018
77
77
I tried to figure out the AI thing, but I got frustrated and quit when I couldn't even get my own already prepared images onto the game.
The image generation integration is more about generating images on the fly for slaves and less about using prepared images you've already made. If you want to troubleshoot via DM or elsewhere let me know.
 

6ft3btw

Newbie
Jul 27, 2021
69
52
I tried to figure out the AI thing, but I got frustrated and quit when I couldn't even get my own already prepared images onto the game.
You should be able to place pre-made images into the game the same way as you would with any other image system. The only place you can't (as far as I know) is the personal assistant.
 

RustDust

Member
Jul 18, 2017
468
492
It's been a while, and I really don't want to go through the hassle of figuring out how to get the stable diffusion to work with the new pregmod build. I still have the old version with the ai art working, so Is there any shortcut I could do, or should I just start over everything from scratch?
 
4.40 star(s) 23 Votes