Datapack scene creator. Advanced stuff - Alexofp/BDCC GitHub Wiki
This page will try to teach some of the advanced topics related to the scene creator. I (Rahi) tried to make the editor as intuitive as I can but it still has a fair share of tricky stuff.
Buttons that lead to random states
By default, the add button
block will always point you to the same selected State. But it's fairly easy to add randomness here:
As you can see, by default the State will be switched to 'pc_lost'. But there is also a 50% chance that the state will be switched to 'pc_won' instead and the player will also get 10 credits. If you want to expand it to 3 choices, you wanna do this:
In this setup, there is a 5% chance that the player will get some sex. If they don't, there is a 50% chance that they will still win. You get the idea I hope x3
Starting fights, running scenes
Your usual setup for a fight should look like this:
The player might win or lose every fight so you gotta prepare 2 states, one for winning and one for losing.
The Run scene
and Start sex
blocks only have one space for code. It gets executed when the other-scene/sex ends. You want to have a Set state
block in there too so you can progress with your scene.
Hope it makes sense
React and Run
The tutorial explains it a bit but I will try to go in-depth here
There are 2 contexts where your code could be executed in:
- React. When the player picks any option, the game starts to REACT to that. In this context, it is safe to end or run new scenes (and some other misc stuff). It is also the perfect time to change variables/flags and use game-related (or sex-related) blocks. But you shouldn't output any text there (except for the
add message
block, that one stores the messages until the next time the scene is displayed) or add buttons. - Run. When the game needs to display the scene to the player, it RUNS the scene code. This is the time to show all the scene output and present the player with buttons. Changing variables/flags here -could- leave to problems because there are situations which will lead to your scene code getting ran more than once! So if you are incrementing a variable by 1, this very much might happen more than once. Easiest way to trigger that problem is to save/load or use any debug action.
Let me try to visualize it. By default, everything is executed in RUN mode:
As soon as you add add button
blocks, you get this:
Button's code gets executed when the player presses it so it is executed in the REACT mode/context. The code of the run scene
(and start fight/sex
blocks) is REACT too (it's executed when the scene ends). Hope it makes sense.
Doing stuff like this is wrong:
So, keep all the blocks that affect the game's state inside the add button
calls (the run scene
/start fight
/start sex
ones are fine too).
SETTING a variable/flag to a specific value is mostly fine (because if it gets executed twice we will just set it to the same value again). INCREASING a flag/variable is bad because it might be triggered more than once, resulting in a wrong result.
If you -really- want to increase a flag/variable inside the RUN context, use the Run code once
block. It tries to make sure that the code inside only gets ran once (it will not run the code if you save/load/use a debug action). But, you know, might as well keep all the var editing inside the add button
calls.
Button checks
You might have noticed that Add button
block has a 'CHECKS' button. It allows you to easily add extra conditions to the button. For example, for sex that requires pc to have a vagina, you want to add a HasReachableVagina
check. The difference between HasReachableVagina
and HasVagina
is that HasReachableVagina
/HasReachablePenis
will not 'succeed' if the player their penis/vagina in chastity.. so you usually want a 'Reachable' variant.
If there are more than one Check, they ALL will be required to be fulfilled.
Typical sex progression
For a typical hand-written sex scene, you usually want to have this order of sex blocks:
Time processing is important because it would help to generate some cum in player's/npc's balls (if they are spent for example) Then the fuck block to stretch the hole Then the cum inside block.. to cum x3 The orgasm block is important to be last because it will actually drain the balls of the one who's orgasming. So you want it to always be -after- the cum inside blocks. Orgasm block is also the one that sets the Lust to 0 You can add the opposite orgasm block (npc orgasms from pc) but that's not really required. Only if you want to
Condoms in sex
For an optional condom support in your (hand-written) sex scene, you usually want 3 variables:
- CondomUsed (boolean)
- CondomBreakChance (number)
- CondomBroke (boolean)
Then you can present the player with an option to go raw or use a condom (make sure the condom button has a HasCondoms
check added to it)
Then, you can make each sex animation automatically show up with a condom if you make it read the variable like so:
Then, when it comes the time to cum, you can check if the condom broke like so:
Yeah, it's a bit clunky. That's the best I got x3. Sorry
Sex scenes with strapons
Adding strapon scenes is a bit clunky too, sorry x3
First, you want a special State where the player can choose one of their strapons
The Add strapon buttons
adds a button for each strapon that the player has. Selecting any strapon will make the Wearer (pc in this case) put it on (But it's always the player's strapons that are offered! It's just that you can make an npc wear one of the player's strapons if you want). Then the state will be set to the selected one (sex_begins in this case) and the code will be executed (nothing in this case). It's important to let the player cancel the scene in case they don't have any strapons (otherwise they will soft-lock)
Then, after the sex scene ends, you want to return the strapon back to the player's inventory like so:
You get the idea hopefully x3. The Cum inside
block has a strapon mode that allows to cum using the strapon's contents (if there are any)