AI Porn is here, Create and Fap TRY FREE
x

Mod Unity [Secret Flasher Manaka] Custom Missions 1.1.9 & Version 2 Beta

5.00 star(s) 1 Vote

Larpus

Newbie
Dec 30, 2019
21
12
127
Been working on a mod with the v2 mod engine involving timed handcuffs that adds a whole new minigame. I have a few questions / feature requests (if they're not available yet).

1) Is it possible to get the remaining time left on the timed handcuffs?
Currently I'm running a separate timer that should in theory be in sync with the handcuffs, but in actuality goes out of sync (I think this happens particularly if you change zone). I'd like to either sync to the handcuff timer directly, or at least occasionally update my separate timer if it drifts out of sync.

2) Is it possible to make a player stand up if they're crouched?
This is so I can overcome a weird state where the player is crouching when the handcuffs get locked and end up with the handcuffs applied while they're in crouch state.

3) Could I get a little more documentation on _state.Handcuffs.State / .Type ? i.e. what values these could be? I'd like to know so I can avoid the player doing silly stuff like applying the wrong type of handcuffs behind their back / to an object while my mod is active.

4) Is there a way to detect if a drone mission has been activated or is active? I'd like to react to that, since it'll definitely interfere with the functionality of my mod.

Many Thanks!
 
  • Like
Reactions: twoer

SekiYuri

Newbie
Apr 14, 2023
17
50
123
v4 (and possibly the last update, other than bug fixes) of my custom missions pack! Implemented a couple more missions and some fixes for bugs that mistersodacan mentioned.

Updated list of missions:

If anyone has ideas for missions but doesn't want to do the code themselves, let me know! But I'm sticking to the .json version of the main mod. The .code version looks like a nightmare to work with.
v4.1 of my custom missions pack!
Fixed a typo ("While naked, climx on a crosswalk" instead of climax)
Added 1 new mission (Park, "While naked, handcuff yourself to a message board")

Check the original v4 post for the rest of the missions~
 

Em1lyLow

Formerly 'Em1lyExhi'
Jul 27, 2024
5
5
13
Does anybody have a guide or tutorial on how to make a custom mission? I’m really interested in making one, but I have no idea where to start.
 
Jun 24, 2018
111
191
170
Ok I think i have the script crash fairly repeatable now it seems like if you use alt-f9 to reload the script things break until you restart the whole game. I can probably remove a lot of this code but im just happy to be able to predict when it will happen.

You don't have permission to view the spoiler content. Log in or register now.

The first time you run this by openning the phone and starting the park stroll mission the npc will successfully walk towards the info board while you have your front flashing. once the npc has started moving or even after they have reached the board if you press alt-f9 then try and run it again youll have nothing but IL2CPP errors in the console.



Does anybody have a guide or tutorial on how to make a custom mission? I’m really interested in making one, but I have no idea where to start.
I dont know any specific tutorials but the way i learned was by loading up other peoples missions and copying their code. start with the simple ones like the test missions. theres also a readme in BepInEx\plugins\SFM_custom_mission_v2\Documentation.html for v2 and a readme for v1 that shows what the different options all are. i could do a tutorial if theres demand but i get told my english is very exhausting to read but i do also want to see many more people all making missions for this great game.

the main tips are you can press f9 to see in the console all the stats about manaka like her position and cosplay, ctrl+f9 gives you all the mission and cosplay and adult toys names and alt-f9 lets you reload all the missions so you dont have to quit and reload the game whenever you make a change to the mission your working on.
 
Jun 24, 2018
111
191
170
https://f95zone.to/threads/secret-f...ons-1-1-9-version-2-beta.263276/post-19045153

Really, I’m very interested in making missions, and a tutorial would be useful. I think it would be easy to understand and would help many people.
Since you asked so nicely and also because ai makes writing things much easier than they used to be. My only condition is that once you start making your own missions you have to let me know so I can try them.


Part 1: Getting Started - Your First Mission!
Welcome! This tutorial will guide you through creating your first custom mission. We’ll start with something simple – just printing a message to the console – and gradually build up to a more complex mission.

A Quick Note on Versions: We're focusing on version 2 (v2) of the scripting system, which offers significantly more power than v1. While some concepts from v1 might be familiar, we’ll dive straight into v2 to unlock its full potential.

Step 0: Setting Things Up
Before we begin, you'll need to install the mod itself. There are several guides available in this thread; I'll link to a good one here once someone shares it! (Placeholder for Link).

1. Understanding Threads and Labels – The Building Blocks
Think of missions as being run by "threads." A thread is essentially a sequence of instructions that the game executes, step-by-step. You can have multiple threads running within a mission, but we'll start with just one to keep things manageable.

Labels are like named checkpoints in your script. They mark specific locations where the execution flow can jump to. This allows you to organize your code into logical blocks and control which parts of your mission run when.

2. Creating Your First Thread
Here's the core command that brings it all together:

Code:
mission = CreateThread("testmission")
This line creates a new thread named "testmission." It tells the game, “Hey, I want this to run the code within the label called ‘testmission.’”

3. Defining Your Label – Where the Action Happens
Now, let's define that label:

Code:
testmission:
Important: Notice the colon ( : ) at the end of "testmission." This is essential! It’s how you tell the game that this line marks a label. Any code indented below the label will be executed when the thread runs.

Indentation and Code Structure
Consistent indentation is absolutely crucial for your script to work correctly. The game uses indentation – typically a single Tab character – to determine which lines of code belong to which labels or control structures (like if statements). Make sure you use a consistent number of spaces or tabs for each level of indentation; mixing them up can lead to unexpected errors!

4. Your First Command: Logging a Message
Let’s add our first command within the testmission: block:

Code:
Log("I'm alive")
The Log() function displays messages in the game's secondary console window (usually black). This is your best friend when developing missions! Errors and any output from your Log() commands will appear here. It’s highly recommended to run the game in a windowed mode so you can easily see this console, or use a second monitor if possible.

5. Running Your Mission – Let's See It Work!
  1. Create a Folder: In your <game folder>/CustomMissions2/ directory, create a new folder named super_awesome_mission (or any name you prefer).
  2. Create the Code File: Inside that folder, create a file named main.code. The filename must end in .code. You might need to adjust your Windows settings to show file extensions and prevent it from accidentally being saved as main.code.txt.
  3. Paste Your Code: Open main.code in a text editor and paste the following code:

    Code:
    mission = CreateThread("testmission")
    
    testmission:
        Log("I'm alive")
  4. Save & Launch: Save the file. Start up the game, load a save, and head to your apartment. You should see "I'm alive" appear in the console window!
1767096471365.png
Congratulations! You’ve just written your first mission! It might not be flashy, but you built it yourself – that's what makes it awesome.

If it doesn't work, look at the console window for any red lines. I'll go over these a little bit in the next post, but there's so many possible causes I'll wait and see what acutally comes up for everyone :)
 
Last edited:
  • Like
Reactions: twoer
Jun 24, 2018
111
191
170
Part 2: Reacting to the World - Conditions & Listeners
I. Introduction: Why Conditions and Listeners?
Simply running code isn't enough for a truly interactive mission! Often, we need our missions to react to what’s happening in the game world – whether it's the player's state, the environment around them, or something else entirely. The core idea is this: "We want our mission to only progress when a certain condition is true."

II. Understanding Conditions:
What are Conditions? Think of conditions as questions we ask the game. They’re like boolean expressions – they evaluate to either true (yes, the condition is met) or false (no, it's not). Essentially, they return a Boolean value.

Condition Types & Syntax:

The full list of possible conditions can be overwhelming, but there's an easy way to explore them! Press F9 in-game and check the BepInEx console window – you’ll find a ton of information about Manaka’s current state. For example, if Manaka is only wearing her coat but it's closed, it might say "Front_Closed" We can use this to trigger events!
1767095578616.png
Let's imagine we want our mission to react when Manaka opens her coat and give her an orgasm. In our mission, she’s really into exhibiting! We can define conditions using this: CreateCondition("Exposed_Front") will only be true if Manaka's front is fully exposed.
1767095800876.png
  • Curvy Brackets ( ): These are used for "OR" – like CreateCondition("(Exposed_Front, Exposed_Hip)").
  • Square Brackets [ ]: These are used for "AND" – like CreateCondition("[Exposed_Front, Exposed_Hip]").
  • Exclamation Mark (!): This means “not.” So, CreateCondition("!Exposed_Hip") would be true when Manaka isn't flashing her butt.
You can combine all of these to create really complex conditions! For a full list and more details, remember to check the BepInEx console (Citation 2). You can also compare numbers using operators like >, >=, <, <=, ==, and !=. (Citation 1)

Creating Conditions: We use the CreateCondition() function. For example:

Code:
condition = CreateCondition("Exposed_Front")
This creates a condition that returns true if Manaka has her front exposed.

Performance Tip: It's important to create conditions before you start using them in listeners – we’ll see why shortly!

III. Introducing Listeners:
What are Listeners? Listeners constantly check a given condition. When that condition becomes true, they trigger an action—in our case, running part of your mission. Think of them as vigilant guards watching for a specific event to happen.

Important Note: Listeners run once every frame. This means if you put a lot of code inside a listener, it will execute very frequently!

CreateListener() vs. CreateListenerLocal(): There's a subtle difference between these two functions, but for now, just use CreateListenerLocal(). It works well in most simple cases and avoids some potential headaches. Someone more experienced can dive into the details later.

Basic Listener Structure: Here’s a simple example:

Code:
basic_listener:
    if condition.Check()
        Log("Condition Met")
        thread.Goto(next_stage)
The Check() Method: The listener uses the .Check() method to evaluate the condition.

Goto() and Stages: Remember how we talked about threads? We use Goto() to tell the thread where to run next – essentially jumping to a different part of your script labeled with its name.

Variables:
When you write something like condition = CreateCondition(), you're telling the computer to remember the value on the right side of the equals sign in a variable we create on the left. We can then access that value again by using the variable’s name. If this seems confusing, try playing around with something simple:

Code:
name = "Manaka"
Log("Hello " + name)
IV. Combining Conditions & Listeners: A Simple Example
Let's look at a complete example of how to combine conditions and listeners:

Code:
mission = CreateThread("testmission")

testmission:
    thread = _this

    thread.Goto("start")

    start:
        condition = CreateCondition("Exposed_Front")

        listener = CreateListenerLocal("basic_listener", condition=condition, next_stage="part_1")

    part_1:
        SetEcstasy(1.1) # Sets the player's ecstasy level to 1 (it's between 0 and 1; half would be 0.5)
        # We use 1.1 to make sure Manaka orgasms!
        Log("Nice")

basic_listener:
    if condition.Check()
        Log("Condition Met")
        thread.Goto(next_stage)
A Few Notes:
  • thread = _this: This is a shortcut to get the current thread, allowing you to control its execution.
  • Scope: This can be tricky (and you don't need to understand it right now!), but it allows code in basic_listener to access variables defined in start, even though they’re not technically in the same part of the file. Again, don't worry about this for now – just know that it exists!
  • SetEcstasy(): This tells the game to perform an action. The documentation is full of all the things you can call.
V. Best Practices & Troubleshooting:

When things don’t go as planned (and they sometimes will!), the first place you’ll want to look for clues is in the console window. It's your mission control center for debugging!

1767095825683.png

In this example (which, purely by coincidence, I created to illustrate troubleshooting – totally didn't make any mistakes myself!), the top line tells us exactly what’s wrong: "Inconsistent code indentation in line 6." If we jumped to line 6 in our script and checked, we’d find that I had used spaces instead of tabs—and the game wasn't happy about it! Fixing that simple mistake made the mission work perfectly.

Actually, looking closer, it turns out line 6 was using tabs! The problem was the line above it was using spaces. Sometimes you need to examine the lines around the one the console flags – often, the error is a little more subtle than it initially appears. But generally, the console's pinpointing is pretty accurate.

Pro Tip: You don’t have to quit and restart the entire game every time you make a change! Use ALT + F9 to reload all your missions—it’s a huge time-saver.

Key Points to Emphasize Throughout Part 2:

  • Complexity: Conditions and Listeners are complex topics, but we'll break them down into manageable steps.
  • Experimentation: Don’t be afraid to experiment with different conditions and listener configurations – that’s how you learn!
  • BepInEx Console: Remember the importance of using Ctrl+F9 and checking the BepInEx console for condition lists and debugging information (Citation 2).
 
Last edited:
  • Like
Reactions: twoer
Jun 24, 2018
111
191
170
Part 2.5: Lists & _state
Lists are fundamental data structures that allow you to group multiple values together under a single name. They're incredibly useful for passing collections of information to functions or storing related data within a mission. Think of them as containers – you can put all sorts of things inside!

The primary function for working with lists is CreateList(). Here’s how it works:

Basic List Creation:

Code:
my_list = CreateList(1, 2, "hello", true)
DumpVariable(my_list, 4) # This will output the list to the console.
This creates a list containing four elements: a number (1), another number (2), a string ("hello"), and a boolean value (true). Pretty straightforward, right?

Oh, and since I haven't mentioned it yet, you can use # in code to add comments – the computer will ignore them but it will make reading your code much easier!

Named Parameters in Lists: As you might have seen hinted at in Citation 3, you can also create lists with named parameters. This makes things way more readable – especially when dealing with complex data.

Code:
fn_parameters = CreateList(a = 2, b = 3)
DumpVariables(fn_parameters, 2) # Output: {a=2,b=3}
See? Much easier to understand what's going on! It’s like giving your variables nicknames – it just makes everything clearer.

Accessing List Elements: You access elements within a list using their index (starting from 0). It's the standard way of getting at specific items in any ordered collection.

Code:
first_element = my_list[0] # first_element will be 1.
second_element = my_list[1] # second_element will be 2.
Modifying Lists: You can change the values within a list by assigning new values to specific indices. Don't be afraid to mess around with this – it’s how you learn!

Code:
my_list[0] = 10  # Now, my_list[0] is 10.
The _state Global Variable

The _state variable (as mentioned in Citation 1) is a massive list that holds information about the game's current condition and environment. It’s essentially a central repository for all sorts of data, including player states, positions, mission progress, items, and cosplay details. It's like the game's brain – everything important is stored somewhere inside it.

What it Contains: Think of _state as a giant dictionary where each key represents a specific aspect of the game (e.g., "position," "missions," "items"). The value associated with each key is often another list or data structure containing more detailed information. It’s nested lists all the way down!

Accessing Data within _state: You access elements within _state using bracket notation or just with dots, just like you would with a regular list:

Code:
playerPositionX = _state.position.x # Accesses the X coordinate of the player's position.
nearNPC = _state.NearNPC #Accesses whether the player is currently near an NPC
Important Note: Citation 1 strongly advises against directly modifying values within _state. Seriously, don’t do it. It's like trying to rewire a computer while it's running – things are likely to go horribly wrong. Instead, use the available functions provided by the game to change these values. Directly manipulating _state can lead to unpredictable behavior and crashes (and nobody wants that!).
 
Last edited:
  • Like
Reactions: twoer
Jun 24, 2018
111
191
170
PART3
Okay, let's modify the mission to wait for the coat to close before restarting. This way Manaka can cum everytime she opens her coat, but not everytime her coat is open (otherwise she’ll never be able to close it, and while she’ll have a great time all we’ll be able to do is watch).

Here we'll need to create another stage that listens for when Manaka closes her coat again, and then resets back to the start. It's like setting up a little loop – open, orgasm, close, repeat!

Here’s the modified code, followed by a detailed explanation of the changes and why they were made:
Code:
mission = CreateThread("testmission")

testmission:
    Log("I'm alive")

    thread = _this

    thread.Goto("start")

    start:
        condition = CreateCondition("Exposed_Front") # Coat is open

        listener = CreateListenerLocal("basic_listener", condition=condition, next_stage="part_1")

    part_1:
        SetEcstasy(1.1)
        Log("Nice")
        thread.Goto("wait_for_close")

    wait_for_close:
        # Create a listener that waits for the coat to be closed (Exposed_Front is false).
        condition=CreateCondition("!Exposed_Front")
        listener = CreateListenerLocal("basic_listener", condition=condition, next_stage="start")


basic_listener:
    if condition.Check()
        Log("Condition Met")
        thread.Goto(next_stage)
Explanation of Changes & Key Concepts:

  1. wait_for_close Label: We’ve added a new label, wait_for_close. This is where the mission will pause after Manaka orgasms – essentially creating a waiting room until the coat closes again. Think of it as a checkpoint in your script!
  2. Second Listener (basic_listener): The crucial addition is another listener, basic_listener, created within the wait_for_close section. As Citation 2 explains, listeners are constantly checking conditions and triggering actions when those conditions become true. This second listener has a very specific job:
    • Condition: Its condition is CreateCondition(“!Exposed_Front”). This means it's waiting for the opposite of the initial condition – for the coat to be closed. Remember, as Citation 1 explains, the exclamation mark (!) negates a condition. So, !Exposed_Front is true only when Manaka’s front isn’t exposed (i.e., her coat is closed).
    • next_stage="start": When this listener's condition becomes true (coat is closed), it uses thread.Goto("start") to return the mission to its beginning, ready to wait for the coat to open again. This completes the loop!
Key Takeaways:

  • Condition Negation: Using ! allows you to create conditions that are based on not having a certain state. It's a powerful tool for creating more complex and nuanced triggers.
  • Listeners as Loops: By strategically placing listeners, you can create loops within your mission – allowing it to repeat actions or wait for specific events to occur before proceeding. This is essential for dynamic and interactive missions!
  • CreateListenerLocal(): As mentioned in Citation 2, using CreateListenerLocal() keeps things tidy by creating the listener within the scope of where you called it.

Okay, that should be enough to get started! From here, you can try modifying the conditions so that it only orgasms when Manaka flashes both her front and back. As Citation 3 explains, you can combine multiple conditions using square brackets for a logical AND – meaning all conditions inside must be true. For example, [Exposed_Front, CoatBackOpen ] would require both the "Exposed_Front" and " CoatBackOpen " conditions to be met.

You can also look at some other missions and see how they do things; there's a lot more I didn’t cover like areas and zones (which Citation 2 mentions for image galleries), the phone chat, options and meta.json, sounds, and a bunch more! But from here, you should be able to load up the default test mission and tell me what line creates the condition for the "Flash your front and back" mission. It'll likely involve using those square brackets we talked about – remember, Citation 3 details how to combine conditions with logical ANDs.

If I missed something, then anyone else is welcome to extend this tutorial! But if it’s stupidly obvious, I’ll add it to the tutorial myself too.
 
Last edited:
  • Like
Reactions: twoer
Jun 24, 2018
111
191
170
man reading that again theres a bunch of stuff about citations. ignore those thats how i made the ai not brain dribbly stupid but i cant edit them out cleanly. if people are curious the citations are just parts of the documentation that the ai thought were relevant when writing stuff
 
5.00 star(s) 1 Vote