mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-20 13:50:46 +00:00
refactor: Move ink source files to scenarios/ink and add compilation script
Consolidated all ink source files into scenarios/ink directory for better organization. All ink source files and documentation are now in the same location as their compiled JSON output. Changes: 1. Moved all .ink source files from story_design/ink/ to scenarios/ink/ - chen_hub.ink and supporting files - netherton_hub.ink and supporting files - haxolottle_hub.ink and supporting files - All other ink source files 2. Moved documentation files to scenarios/ink/ - INK_BEST_PRACTICES.md - NPC_HUB_ARCHITECTURE.md - ONGOING_CONVERSATIONS_README.md - README.md 3. Added scripts/compile-ink.sh - Automatically compiles all .ink files in scenarios/ink/ - Outputs JSON to the same directory - Shows colored output with success/failure status - Provides compilation summary Usage: ./scripts/compile-ink.sh This consolidates the ink development workflow into a single directory and provides an easy way to recompile all ink files after making changes.
This commit is contained in:
1
scenarios/ink/alice-chat.json
Normal file
1
scenarios/ink/alice-chat.json
Normal file
@@ -0,0 +1 @@
|
||||
{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"start":["ev",0,"/ev",{"VAR=":"trust_level","re":true},"^Alice: Hey! I'm Alice, the security consultant here. What can I help you with?","\n",{"->":"hub"},null],"hub":[["ev","str","^Ask about security protocols","/str",{"VAR?":"topic_discussed_security"},"!","/ev",{"*":".^.c-0","flg":5},"ev","str","^Ask about the building layout","/str",{"VAR?":"topic_discussed_building"},"!","/ev",{"*":".^.c-1","flg":5},"ev","str","^Make small talk","/str",{"VAR?":"topic_discussed_personal"},"!","/ev",{"*":".^.c-2","flg":5},"ev","str","^Ask if there are any security concerns","/str",{"VAR?":"trust_level"},2,">=",{"VAR?":"knows_about_breach"},"!","&&","/ev",{"*":".^.c-3","flg":5},"ev","str","^Ask for access to the server room","/str",{"VAR?":"knows_about_breach"},{"VAR?":"has_keycard"},"!","&&","/ev",{"*":".^.c-4","flg":5},"ev","str","^Thank her and say goodbye","/str",{"VAR?":"has_keycard"},"/ev",{"*":".^.c-5","flg":5},"ev","str","^Say goodbye","/str","/ev",{"*":".^.c-6","flg":4},{"c-0":["^ ","\n",{"->":"topic_security"},null],"c-1":["\n",{"->":"topic_building"},null],"c-2":["\n",{"->":"topic_personal"},null],"c-3":["\n",{"->":"reveal_breach"},null],"c-4":["\n",{"->":"request_keycard"},null],"c-5":["\n",{"->":"ending_success"},null],"c-6":["\n",{"->":"ending_neutral"},null]}],null],"topic_security":["ev",true,"/ev",{"VAR=":"topic_discussed_security","re":true},"ev",{"VAR?":"trust_level"},1,"+",{"VAR=":"trust_level","re":true},"/ev","^Alice: Our security system uses biometric authentication and keycard access. Pretty standard corporate stuff.","\n","ev",{"VAR?":"trust_level"},2,">=","/ev",[{"->":".^.b","c":true},{"b":["^ Alice: Between you and me, some of the legacy systems worry me a bit...",{"->":".^.^.^.18"},null]}],"nop","\n",{"->":"hub"},null],"topic_building":["ev",true,"/ev",{"VAR=":"topic_discussed_building","re":true},"ev",{"VAR?":"trust_level"},1,"+",{"VAR=":"trust_level","re":true},"/ev","^Alice: The building has three main floors. Server room is on the second floor, but you need clearance for that.","\n","ev",{"VAR?":"trust_level"},3,">=","/ev",[{"->":".^.b","c":true},{"b":["^ Alice: The back stairwell has a blind spot in the camera coverage, just FYI.",{"->":".^.^.^.18"},null]}],"nop","\n",{"->":"hub"},null],"topic_personal":["ev",true,"/ev",{"VAR=":"topic_discussed_personal","re":true},"ev",{"VAR?":"trust_level"},2,"+",{"VAR=":"trust_level","re":true},"/ev","^Alice: Oh, making small talk? *smiles* I appreciate that. Most people here just see me as \"the security lady.\"","\n","^Alice: I actually studied cybersecurity at MIT. Love puzzles and breaking systems... professionally, of course!","\n",{"->":"hub"},null],"reveal_breach":["ev",true,"/ev",{"VAR=":"knows_about_breach","re":true},"ev",{"VAR?":"trust_level"},1,"+",{"VAR=":"trust_level","re":true},"/ev","^Alice: *looks around nervously*","\n","^Alice: Actually... I've been noticing some weird network activity. Someone's been accessing systems they shouldn't.","\n","^Alice: I can't prove it yet, but I think we might have an insider threat situation.","\n",{"->":"hub"},null],"request_keycard":["ev",{"VAR?":"trust_level"},4,">=","/ev",[{"->":".^.b","c":true},{"b":["\n","ev",true,"/ev",{"VAR=":"has_keycard","re":true},"^Alice: You know what? I trust you. Here's a temporary access card for the server room.","\n","^Alice: Just... be careful, okay? And if you find anything suspicious, let me know immediately.","\n",{"->":"hub"},{"->":".^.^.^.7"},null]}],[{"->":".^.b"},{"b":["\n","^Alice: I'd love to help, but I don't know you well enough to give you that kind of access yet.","\n","^Alice: Maybe if we talk more, I'll feel more comfortable...","\n",{"->":"hub"},{"->":".^.^.^.7"},null]}],"nop","\n",null],"ending_success":["^Alice: Good luck in there. And hey... thanks for taking this seriously.","\n","^Alice: Not everyone would help investigate something like this.","\n","end",null],"ending_neutral":["^Alice: Alright, see you around! Let me know if you need anything security-related.","\n","end","end",null],"global decl":["ev",0,{"VAR=":"trust_level"},false,{"VAR=":"knows_about_breach"},false,{"VAR=":"has_keycard"},false,{"VAR=":"topic_discussed_security"},false,{"VAR=":"topic_discussed_building"},false,{"VAR=":"topic_discussed_personal"},"/ev","end",null]}],"listDefs":{}}
|
||||
@@ -1 +1 @@
|
||||
{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"start":["^OMG hiiii! You're new here, right? I know EVERYONE in this office!","\n","^Want to hear the latest tea? ☕","\n",{"->":"hub"},null],"hub":[["ev","str","^Ask about the IT department","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Ask about the CEO","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Ask about security concerns","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^That's enough gossip for now","/str","/ev",{"*":".^.c-3","flg":4},{"c-0":["^ What have you heard about the IT department?","\n",{"->":"topic_it"},{"#f":5}],"c-1":["^ What's the dish of Mr CEO?","\n",{"->":"topic_ceo"},{"#f":5}],"c-2":["^ Sooo what's the sitch on security round here?","\n",{"->":"topic_security"},{"#f":5}],"c-3":["^ ","\n",{"->":"ending"},{"->":"hub"},null]}],null],"topic_it":[["^Oh the IT team? They're actually pretty cool!","\n","^Neye Eve is super smart but a bit gullible, you know? Always trying to be helpful.","\n","^Their manager is Alex Chen - really nice but SUPER busy. Barely see them around these days.","\n","^Fun fact: Neye is SO worried about impressing Alex that they practically jump when Alex's name comes up! 😂","\n","ev","str","^Tell me more about the team dynamics","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Interesting! What else?","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["\n",{"->":"it_details"},{"#f":5}],"c-1":["\n",{"->":"hub"},{"#f":5}]}],null],"it_details":["^Well, Neye handles a lot of the day-to-day stuff - passwords, access codes, that kind of thing.","\n","^Alex trusts them completely. Maybe TOO much if you ask me... 👀","\n","^Like, Neye would probably do ANYTHING if they thought Alex was asking for it!","\n",{"->":"hub"},null],"topic_ceo":["^The CEO? *lowers voice* Girl, I have THEORIES...","\n","^Like, why are they here so late at night? And those \"business trips\" that nobody knows about?","\n","^I saw them coming out of the server room at 3 AM once. Like... what?!","\n","^Something shady is definitely going on. Mark my words! 🕵️","\n",{"->":"hub"},null],"topic_security":["^Security? Oh honey, let me tell you about the \"security\" around here...","\n","^Half the people write their passwords on sticky notes! Including the CEO!","\n","^And that reception safe? Pretty sure the code hasn't been changed in forever.","\n","^Actually wait - Neye mentioned they just updated it last week. Something about \"security protocols.\"","\n","^They were SO proud of themselves for remembering to update it! 😊","\n",{"->":"hub"},null],"ending":["^Okay okay, I'll let you go! But if you hear anything juicy, come find me!","\n","^And remember - you didn't hear any of this from me! 😉🤫","\n","#","^exit_conversation","/#",{"->":"hub"},null]}],"listDefs":{}}
|
||||
{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"start":["^OMG hiiii! You're new here, right? I know EVERYONE in this office!","\n","^Want to hear the latest tea? ☕","\n",{"->":"hub"},null],"hub":[["ev","str","^What have you heard about the IT department?","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^What do you know about the CEO?","/str","/ev",{"*":".^.c-1","flg":20},"ev","str","^Any security concerns?","/str","/ev",{"*":".^.c-2","flg":20},"ev","str","^Thanks. That's enough gossip for now.","/str","/ev",{"*":".^.c-3","flg":4},{"c-0":["\n",{"->":"topic_it"},{"#f":5}],"c-1":["\n",{"->":"topic_ceo"},{"#f":5}],"c-2":["\n",{"->":"topic_security"},{"#f":5}],"c-3":["^ ","\n",{"->":"ending"},{"->":"hub"},null]}],null],"topic_it":[["^Oh the IT team? They're actually pretty cool!","\n","^Neye Eve is super smart but a bit gullible, you know? Always trying to be helpful.","\n","^Their manager is Alex Chen - really nice but SUPER busy. Barely see them around these days.","\n","^Fun fact: Neye is SO worried about impressing Alex that they practically jump when Alex's name comes up! 😂","\n","ev","str","^Tell me more about the team dynamics","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Interesting! What else?","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["\n",{"->":"it_details"},{"#f":5}],"c-1":["\n",{"->":"hub"},{"#f":5}]}],null],"it_details":["^Well, Neye handles a lot of the day-to-day stuff - passwords, access codes, that kind of thing.","\n","^Alex trusts them completely. Maybe TOO much if you ask me... 👀","\n","^Like, Neye would probably do ANYTHING if they thought Alex was asking for it!","\n",{"->":"hub"},null],"topic_ceo":["^The CEO? *lowers voice* Girl, I have THEORIES...","\n","^Like, why are they here so late at night? And those \"business trips\" that nobody knows about?","\n","^I saw them coming out of the server room at 3 AM once. Like... what?!","\n","^Something shady is definitely going on. Mark my words! 🕵️","\n",{"->":"hub"},null],"topic_security":["^Security? Oh honey, let me tell you about the \"security\" around here...","\n","^Half the people write their passwords on sticky notes! Including the CEO!","\n","^And that reception safe? Pretty sure the code hasn't been changed in forever.","\n","^Actually wait - Neye mentioned they just updated it last week. Something about \"security protocols.\"","\n","^They were SO proud of themselves for remembering to update it! 😊","\n",{"->":"hub"},null],"ending":["^Okay okay, I'll let you go! But if you hear anything juicy, come find me!","\n","#","^exit_conversation","/#",{"->":"hub"},null]}],"listDefs":{}}
|
||||
File diff suppressed because one or more lines are too long
1
scenarios/ink/mixed-message-example.json
Normal file
1
scenarios/ink/mixed-message-example.json
Normal file
@@ -0,0 +1 @@
|
||||
{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"start":[["^Hello! This is a test of mixed message types.","\n","ev","str","^Tell me more","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["\n",{"->":"voice_example"},null]}],null],"voice_example":[["^voice: This is a voice message. I'm calling to let you know that the security code has been changed to 4829. Please acknowledge receipt.","\n","ev","str","^Got it, thanks!","/str","/ev",{"*":".^.c-0","flg":4},"ev","str","^What was the code again?","/str","/ev",{"*":".^.c-1","flg":4},{"c-0":["\n","^Great! I'll see you soon.","\n","end",null],"c-1":["\n","^voice: The code is 4-8-2-9. I repeat: four, eight, two, nine.","\n","end",null]}],null]}],"listDefs":{}}
|
||||
1
scenarios/ink/simple-message.json
Normal file
1
scenarios/ink/simple-message.json
Normal file
@@ -0,0 +1 @@
|
||||
{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"start":["^Security alert: Unauthorized access detected in the biometrics lab. All personnel must verify identity at security checkpoints. Server room PIN changed to 5923. Security lockdown initiated.","\n","end",null]}],"listDefs":{}}
|
||||
1
scenarios/ink/test-hostile.json
Normal file
1
scenarios/ink/test-hostile.json
Normal file
@@ -0,0 +1 @@
|
||||
{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"start":["#","^speaker:test_npc","/#","^Welcome to hostile tag test.","\n",{"->":"hub"},null],"hub":[["ev","str","^Test hostile tag","/str","/ev",{"*":".^.c-0","flg":4},"ev","str","^Test exit conversation","/str","/ev",{"*":".^.c-1","flg":4},"ev","str","^Back to start","/str","/ev",{"*":".^.c-2","flg":4},{"c-0":["\n",{"->":"test_hostile"},null],"c-1":["\n",{"->":"test_exit"},null],"c-2":["\n",{"->":"start"},null]}],null],"test_hostile":["#","^speaker:test_npc","/#","^Triggering hostile state for security guard!","\n","#","^hostile:security_guard","/#","#","^exit_conversation","/#",{"->":"hub"},null],"test_exit":["#","^speaker:test_npc","/#","^Exiting cleanly.","\n","#","^exit_conversation","/#",{"->":"hub"},null]}],"listDefs":{}}
|
||||
1
scenarios/ink/test.json
Normal file
1
scenarios/ink/test.json
Normal file
@@ -0,0 +1 @@
|
||||
{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"hub":[["#","^speaker:npc:test_npc_back","/#","^Welcome! This is a group conversation test. Let me introduce you to my colleague.","\n","ev","str","^Listen in on the introduction","/str","/ev",{"*":".^.c-0","flg":4},{"c-0":["^ ",{"->":"group_meeting"},"\n",null]}],null],"group_meeting":["#","^speaker:npc:test_npc_back","/#","^Agent, meet my colleague from the back office. BACK","\n",{"->":"colleague_introduction"},null],"colleague_introduction":["#","^speaker:npc:test_npc_front","/#","^Nice to meet you! I'm the lead technician here. FRONT.","\n",{"->":"player_question"},null],"player_question":["#","^speaker:player","/#","^What kind of work do you both do here?","\n",{"->":"front_npc_explains"},null],"front_npc_explains":["#","^speaker:npc:test_npc_back","/#","^Well, I handle the front desk operations and guest interactions. But my colleague here...","\n",{"->":"colleague_responds"},null],"colleague_responds":["#","^speaker:npc:test_npc_front","/#","^I manage all the backend systems and security infrastructure. Together, we keep everything running smoothly.","\n",{"->":"player_follow_up"},null],"player_follow_up":["#","^speaker:player","/#","^That sounds like a well-coordinated operation!","\n",{"->":"front_npc_agrees"},null],"front_npc_agrees":["#","^speaker:npc:test_npc_back","/#","^It really is! We've been working together for several years now. Communication is key.","\n",{"->":"colleague_adds"},null],"colleague_adds":["#","^speaker:npc:test_npc_front","/#","^Exactly. And we're always looking for talented people like you to join our team.","\n",{"->":"player_closing"},null],"player_closing":["#","^speaker:player","/#","^I appreciate the opportunity. I'll definitely consider it.","\n",{"->":"conversation_end"},null],"conversation_end":["#","^speaker:npc:test_npc_back","/#","^Great! Feel free to explore and let us know if you have any questions.","\n","end",null],"global decl":["ev",false,{"VAR=":"conversation_started"},"/ev","end",null]}],"listDefs":{}}
|
||||
1
scenarios/ink/voice-message-example.json
Normal file
1
scenarios/ink/voice-message-example.json
Normal file
@@ -0,0 +1 @@
|
||||
{"inkVersion":21,"root":[[["done",{"#n":"g-0"}],null],"done",{"start":["^voice: Hi, this is the IT Team. Security breach detected in server room. Changed access code to 4829.","\n","end",null]}],"listDefs":{}}
|
||||
71
scripts/compile-ink.sh
Executable file
71
scripts/compile-ink.sh
Executable file
@@ -0,0 +1,71 @@
|
||||
#!/bin/bash
|
||||
# Compile all .ink files in scenarios/ink to JSON
|
||||
# Usage: ./scripts/compile-ink.sh
|
||||
|
||||
# Get the directory where the script is located
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
||||
|
||||
# Paths
|
||||
INK_DIR="$PROJECT_ROOT/scenarios/ink"
|
||||
INKLECATE="$PROJECT_ROOT/bin/inklecate"
|
||||
|
||||
# Colors for output
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Check if inklecate exists
|
||||
if [ ! -f "$INKLECATE" ]; then
|
||||
echo -e "${RED}Error: inklecate not found at $INKLECATE${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if ink directory exists
|
||||
if [ ! -d "$INK_DIR" ]; then
|
||||
echo -e "${RED}Error: Ink directory not found at $INK_DIR${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}Compiling ink files in $INK_DIR${NC}"
|
||||
echo "----------------------------------------"
|
||||
|
||||
# Counter for compiled files
|
||||
compiled=0
|
||||
failed=0
|
||||
|
||||
# Iterate through all .ink files
|
||||
for ink_file in "$INK_DIR"/*.ink; do
|
||||
# Check if any .ink files exist
|
||||
[ -e "$ink_file" ] || continue
|
||||
|
||||
# Get the filename without path
|
||||
filename=$(basename "$ink_file")
|
||||
|
||||
# Get output JSON filename
|
||||
json_file="${ink_file%.ink}.json"
|
||||
|
||||
echo -e "${YELLOW}Compiling: $filename${NC}"
|
||||
|
||||
# Compile the ink file
|
||||
if "$INKLECATE" -o "$json_file" "$ink_file"; then
|
||||
echo -e "${GREEN}✓ Success: $filename -> $(basename "$json_file")${NC}"
|
||||
((compiled++))
|
||||
else
|
||||
echo -e "${RED}✗ Failed: $filename${NC}"
|
||||
((failed++))
|
||||
fi
|
||||
|
||||
echo ""
|
||||
done
|
||||
|
||||
# Summary
|
||||
echo "----------------------------------------"
|
||||
echo -e "${GREEN}Compilation complete!${NC}"
|
||||
echo " Compiled: $compiled files"
|
||||
if [ $failed -gt 0 ]; then
|
||||
echo -e " ${RED}Failed: $failed files${NC}"
|
||||
else
|
||||
echo " Failed: 0 files"
|
||||
fi
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user