StateMachine - a new way to write dialogues (1 Viewer)

sdoibanfwae

Potential Patron
Joined
Jul 24, 2016
Look here on my github for installation instructions and the download =
Check the example for how to use it. The dialog uses a trigger to load the config JSON txt file. Use The JSON Validator to verify that your JSON is correctly formatted.

You load the JSON txt file with [SMLOADCONFIG_StateMachine1] where StateMachine1 is the filename (.txt is appended automatically).

Define your variables with cutoffs (and sometimes you'll want a min and max). Special variables are vigour, depth, speed, and hispleasure. These variables are pulled from other sources. You can modify the value of hispleasure, but you cannot modify the values for the other special variables. Any other variables (like herpleasure or streak) you will have to change the value of yourself by using effects in your states.

Once your variables are defined, you can use the cutoff names as requirements in your states. Only 1 state will be active at a time, if the requirements are met for multiple states then only the best match will be selected.

When a state is triggered, the state machine calls a line of dialog with the name of the state. So if you have a state like

Code:
        "rough": {
            "requirements": {
                "depth": ["verydeep", "hilt"],
                "speed": ["fast", "veryfast"],
                "herpleasure": ["none", "low", "high"]
            },
            "chances": 2,
            "actions": ["[ARMS_HIS_LEGS][SETVAR_da.breathPercentage_0]"],
            "effects": {
                "herpleasure": 6,
                "hispleasure": 5,
                "streak": 5
            }
        }

Then, let's say the state changes from moving to rough, state machine will call dialog lines for rough, now_rough, and moving_to_rough. It will also continue to call the rough dialog (but not now_rough or moving_to_rough) while the state is maintained, and the chances property controls how often it gets called repeatedly.

Actions is an array of strings, each string is a line of dialog to execute when the state gets triggered (and retriggered, depending on the chances). Only 1 action is played each time the state is triggered, but an action can have as much dialog text in it as you want.

Effects is a list of variables to add to. If you want to subtract, then use a negative number.

Variables get "pseudo-states", look at the example at like depth_hilt, depth_verydeep, speed_veryfast, and speed_fast. All variables get lines of dialog called for them, but putting them inside the states list allows you to add properties, actions, and effects for them. Still it's better to use real states instead of pseudo-states, because you can only be in one state at a time, but pseudo-states can overlap and be triggered very often.

States (and pseudo-states from variables) also output variables you can use in the dialog. sm_statename_duration is how long the state has been active (this does not get wiped until the state is activated again). sm_statename_times is how many times the state has been entered. sm_statename_totaltime is how many seconds the state has been active in total.

The interrupt property is still an experimental value, it kind of works but use it very sparingly. Interruptable doesn't work yet so currently everything is interruptable.
 
Last edited:

sdoibanfwae

Potential Patron
Joined
Jul 24, 2016
Okay, I'm gonna have to experiment with this. I assume it works with dialogueactions?

Yea, I think it might require dialogueactions, this is my Mods.txt file in $INIT$

Code:
;;;;sby_default/loadingscreenV1/loadingscreenV1.swf
sby_default/TemplateExtensionV5_sby/TemplateExtensionV5_sby.swf
;
Default/FinishesCounter.swf
Default/VigourCounter.swf
Default/PleasureCounter.swf
Default/BreathCounter.swf
Default/HeldBreathCounter.swf
Default/CumInMouthCounter.swf
Default/clearAllShortcut.swf
;
DialogueActions/SDTDialogueActionsv4.09dev10.swf
MoreTriggers v2.2/MoreTriggersv2.2.mod
;
sby_default/clearlastdataV1/clearlastdataV1.swf
sby_default/hairlayerpatchV1/hairlayerpatchV1.swf
sby_default/dialogpatchV4/dialogpatchV4.swf
sby_default/vanillaarmpatchV2/vanillaarmpatchV2.swf
sby_default/leglayermoveV1/leglayermoveV1.swf
;
sby_default/autocloseeyeV3/autocloseeyeV3.swf
sby_default/autoclosemouthV5/autoclosemouthV5.swf
sby_default/breastfirmnessV3/breastfirmnessV3.swf
sby_default/charcodefilesavingV1/charcodefilesavingV1.swf
;sby_default/cumRGBV2/cumRGBV2.swf
sby_default/moremoodsV3/moremoodsV3.swf
sby_default/throatcumbulgeV3/throatcumbulgeV3.swf
;sby_default/superbellyV7_1/superbellyV7_1.swf
sby_default/penisrangeV6/penisrangeV6.swf
sby_default/himnotletgoV1/himnotletgoV1.swf
sby_default/allalphaslidersV7/allalphaslidersV7.swf
sby_default/deepthroatactionsV5/deepthroatactionsV5.swf
sby_default/swallowguzzleV1/swallowguzzleV1.swf
sby_default/ignoreherclothingpenisV2/ignoreherclothingpenisV2.swf
sby_default/regulaterandomV4/regulaterandomV4.swf
;
sby_default/animtoolsV25/source/animtoolsV25.swf
sby_default/moreclothingV7/moreclothingV7.swf
;;;;sby_default/loadingscreenV1/loadingscreenV1.swf

HuniePopAudioTriggersV1_11/HuniePopAudioTriggersv1.11.mod
statemachine/statemachine.swf
 

edgelord 3000

Content Creator
Joined
Jan 16, 2018
I'm probably just dumb, but I can't even make the example dialogue work. It just playes the first couple of lines, and then no more lines. She does move her hands around and react, though.
 

sdoibanfwae

Potential Patron
Joined
Jul 24, 2016
is there a functional trigger that enforces her to suck?
do you mean like [AUTO_NORMAL], [AUTO_SOFT], [AUTO_HARD], [AUTO_SELF], and [AUTO_OFF] ?


 

sdoibanfwae

Potential Patron
Joined
Jul 24, 2016
I just released v2.0


Now in v2 you can also make condition variables. This is a variable whose value is based on the number of conditions that are met. For example

Code:
        "too_rough": {
            "conditions": {
                "speed": ["veryfast"],
                "vigour": ["veryhard"],
                "huge_penis": ["true"],
                "depth": ["toodeep", "monster"]
            },
            "cutoffs": {
                "almost": 3,
                "true": 4
            }
        }

When less than 3 of the conditions are met then the value is "none", when 3 of the conditions are met then the value is "almost", and when 4 (or more) of the conditions are met then the value is "true".

If you don't specify any cutoffs, then it is assumed that the value is "none" unless all of the conditions are met then the value is "true". See this "rough" condition variable as an example

Code:
        "rough": {
            "conditions": {
                "speed": ["fast", "veryfast"],
                "vigour": ["hard", "veryhard"],
                "big_penis": ["true"],
                "depth": ["verydeep", "toodeep", "monster"]
            }
        }

Condition variables are more reusable than states, so they can help you keep the states simpler. Also I no longer recommend using "hilt" as a value for depth, instead use the separate "hilted" variable. See StateMachineExample2 for more examples.

I also improved the error logging. If anyone knows how to make messages from the main.updateStatusCol function stay on screen longer, that'd be really helpful. Also note that the dialog edit window inside SDT has a Log button that can show you logs.
 

FortunePRN

Potential Patron
Joined
Apr 23, 2020
I just released v2.0


Now in v2 you can also make condition variables. This is a variable whose value is based on the number of conditions that are met. For example

Code:
        "too_rough": {
            "conditions": {
                "speed": ["veryfast"],
                "vigour": ["veryhard"],
                "huge_penis": ["true"],
                "depth": ["toodeep", "monster"]
            },
            "cutoffs": {
                "almost": 3,
                "true": 4
            }
        }

When less than 3 of the conditions are met then the value is "none", when 3 of the conditions are met then the value is "almost", and when 4 (or more) of the conditions are met then the value is "true".

If you don't specify any cutoffs, then it is assumed that the value is "none" unless all of the conditions are met then the value is "true". See this "rough" condition variable as an example

Code:
        "rough": {
            "conditions": {
                "speed": ["fast", "veryfast"],
                "vigour": ["hard", "veryhard"],
                "big_penis": ["true"],
                "depth": ["verydeep", "toodeep", "monster"]
            }
        }

Condition variables are more reusable than states, so they can help you keep the states simpler. Also I no longer recommend using "hilt" as a value for depth, instead use the separate "hilted" variable. See StateMachineExample2 for more examples.

I also improved the error logging. If anyone knows how to make messages from the main.updateStatusCol function stay on screen longer, that'd be really helpful. Also note that the dialog edit window inside SDT has a Log button that can show you logs.
Go to my first post. I could use your help. ;)
 

Users who are viewing this thread

Top


Are you 18 or older?

This website requires you to be 18 years of age or older. Please verify your age to view the content, or click Exit to leave.