How to get a line to play once he reaches a certain pleasure percentage?

Verynoobthx

Potential Patron
Joined
Sep 20, 2016
So I know it has something to do with da.pleasurePercentage, but I can't get the line to trigger.


Here's an example:


Code:
general:"Wow, this feels really good.[custom2]"{"style":"Him","check":{"da.pleasurePercentage":">20"}}
So the idea is that it only plays the line when hes at greater than 20% pleasure. Any help would be greatly appreciated :smile:
 

DigitalSmutExports

Content Creator
Joined
Sep 12, 2018
The code is correct I'm pretty sure.

The issue I believe you're running into is that the general linetype doesn't trigger too often. The code you've written will only fire if the condition is met, but won't necessarily trigger because the condition is met.

It's basically an idle linetype that fires every once in a while when nothing else is going on. Worst case him saying "this feels really good" as a general line could come off as "I'm glad you stopped sucking you little cheese grater you" ;-)

I can't get the line to trigger.
If you've been patient, might the issue be you don't have Dialogue Actions installed?

As for the question in the thread title, the best I can do is to recommend you use the vigorous linetype instead, but then 20% is so low that it will almost automatically be on since you reach 20% so quickly at vigorous. Others here might have a better answer, but I BELIEVE that you'd have to do some real programming if you want a line to fire automatically and reliably as soon as pleasure hits 20.

Good luck w/ your project. I've recently started to learn code myself and I'll impart a piece of hard earned wisdom before I leave.

[SETVAR_da.pleasurePercentage_90] is an enormous timesaver when playtesting anything pleasure/finishes related.
 
Last edited:

Rudgar

Content Creator
Joined
Nov 18, 2016
Location
Germany
Beside what DigitalSmutExports DigitalSmutExports has said: I don't like "check" attributes for performance reasons, so I'd prefer to solve the situation like this:
Code:
intro:"[general_*da.pleasurePercentage > 20*]" {"style":"Him"}
general:"[general_*da.pleasurePercentage > 20*]" {"style":"Him"}
general_0:"[custom1]Oh, not bad ..." {"style":"Him"}
general_1:"[custom2]Wow, this feels really good." {"style":"Him"}
You are free to omit line "general_0"

HTH

Respectfully, Rudgar
 

Verynoobthx

Potential Patron
Joined
Sep 20, 2016
Beside what DigitalSmutExports DigitalSmutExports has said: I don't like "check" attributes for performance reasons, so I'd prefer to solve the situation like this:
Code:
intro:"[general_*da.pleasurePercentage > 20*]" {"style":"Him"}
general:"[general_*da.pleasurePercentage > 20*]" {"style":"Him"}
general_0:"[custom1]Oh, not bad ..." {"style":"Him"}
general_1:"[custom2]Wow, this feels really good." {"style":"Him"}
You are free to omit line "general_0"

HTH

Respectfully, Rudgar
So the variable inside the asterisks can be either 0=false or 1=true and it then triggers either general_0 or general_1 depending? Am I understanding that correctly? (i have no coding knowledge so i gotta ask)
 

DigitalSmutExports

Content Creator
Joined
Sep 12, 2018
Rudgar Rudgar I was going to PM you, but now that somebody else asked I'll second that question. I didn't know you could do it like that with variable intervals. Could you also go
general:"[general*customvariable* >=1]"

general1"bla bla" goes here if *customvariable* is 1 or more
general0"bla bla" goes here if *customvariable* isn't 1 or more

??
 

Rudgar

Content Creator
Joined
Nov 18, 2016
Location
Germany
So the variable inside the asterisks can be either 0=false or 1=true and it then triggers either general_0 or general_1 depending? Am I understanding that correctly? (i have no coding knowledge so i gotta ask)
Exactly - you got it correctly.

[...] I didn't know you could do it like that with variable intervals. Could you also go
general:"[general*customvariable* >=1]"??
No. But it will work the way edgelord 3000 edgelord 3000 wrote above:

general:"[general*customvariable >= 1*]
note:
  1. the asterisks have to enclose the entire(!) logical expression
  2. operands and operators have to be separated by spaces
Respectfully, Rudgar
 
Last edited:

SkyHeart

Avid Affiliate
Joined
Apr 17, 2017
DigitalSmutExports DigitalSmutExports and V Verynoobthx
Another note I'd like to add:
You should be aware that no math rules apply
So, [SETVAR_varName_*1 + 1 / 2*] is not 1.5, but 1 ( 1+1 = 2 | 2/2 = 1 )
And [SETVAR_varName_*2 > 1 + 0 < 1*] is not 2 but 0 ( 2 > 1 = 1 | 1 + 0 = 1 | 1 < 1 = 0 )

So if you find yourself needing to do such operations be careful to either reorder them in a way so math rules apply
eg: [SETVAR_varName_*1 + 1 / 2*] becomes [SETVAR_varName_*1 / 2 + 1*]
Or put paranthesess around your expresion
eg: [SETVAR_varName_*2 > 1 + 0 < 1*] becomes [SETVAR_varName_*( 2 > 1 ) + ( 0 < 1 )*] (leave spaces between operands and paranthesess as well)
 
Last edited:
Top Bottom