fix: Remove duplicate variable declarations and fix EXTERNAL function calls

Fixed multiple Ink compilation errors:

1. Removed duplicate EXTERNAL and VAR declarations from hub files:
   - chen_hub.ink: Removed player_name(), current_mission_id(),
     total_missions_completed, and professional_reputation declarations
     (already declared in dr_chen_ongoing_conversations.ink)
   - netherton_hub.ink: Same removals for netherton context
   - haxolottle_hub.ink: Same removals for haxolottle context

2. Fixed EXTERNAL function call syntax in dr_chen_ongoing_conversations.ink:
   - Changed {player_name} to {player_name()} in phase hubs and conversation ends
   - Fixed 6 instances across phase_2_hub, phase_3_hub, phase_4_hub,
     conversation_end_phase2, and conversation_end_phase3

3. Fixed conditional syntax in chen_hub.ink:
   - Changed `current_mission_id == "ghost_in_machine"` to
     `current_mission_id() == "ghost_in_machine"` with proper brace structure

4. Fixed jump_to_personal_conversations in all hub files:
   - Removed non-existent `_with_return` tunnel calls
   - Changed to direct diverts to phase_hub knots
   - Removed unreachable "return" dialogue

All hub files now properly include the ongoing conversations file and only
declare EXTERNAL variables unique to the hub context.
This commit is contained in:
Z. Cliffe Schreuders
2025-11-19 13:44:29 +00:00
parent 9ed1e68b0a
commit 0aa7942192
4 changed files with 32 additions and 52 deletions

View File

@@ -17,21 +17,18 @@ INCLUDE dr_chen_ongoing_conversations.ink
// ===========================================
// EXTERNAL CONTEXT VARIABLES
// These are provided by the game engine
// Note: player_name() and current_mission_id() are already declared in dr_chen_ongoing_conversations.ink
// ===========================================
EXTERNAL player_name() // LOCAL - Player's agent name
EXTERNAL current_mission_id() // LOCAL - Current mission being discussed
EXTERNAL npc_location() // LOCAL - Where conversation happens ("lab", "equipment_room", "briefing_room", "field_support")
EXTERNAL mission_phase() // LOCAL - Phase of current mission ("pre_briefing", "active", "debriefing", "downtime")
EXTERNAL equipment_status() // LOCAL - Status of player's equipment ("nominal", "damaged", "needs_upgrade")
// ===========================================
// GLOBAL VARIABLES (shared across all NPCs)
// Note: total_missions_completed and professional_reputation are already declared in dr_chen_ongoing_conversations.ink
// ===========================================
VAR total_missions_completed = 0 // GLOBAL - Total missions done
VAR professional_reputation = 0 // GLOBAL - Agent standing
// ===========================================
// MAIN ENTRY POINT
// Called by game engine when player talks to Dr. Chen
@@ -189,22 +186,18 @@ VAR professional_reputation = 0 // GLOBAL - Agent standing
// ===========================================
=== jump_to_personal_conversations ===
// Jump to appropriate phase hub based on progression, then return here
// Jump to appropriate phase hub based on progression
{
- total_missions_completed <= 5:
-> dr_chen_ongoing_conversations.phase_1_hub_with_return ->
-> dr_chen_ongoing_conversations.phase_1_hub
- total_missions_completed <= 10:
-> dr_chen_ongoing_conversations.phase_2_hub_with_return ->
-> dr_chen_ongoing_conversations.phase_2_hub
- total_missions_completed <= 15:
-> dr_chen_ongoing_conversations.phase_3_hub_with_return ->
-> dr_chen_ongoing_conversations.phase_3_hub
- total_missions_completed > 15:
-> dr_chen_ongoing_conversations.phase_4_hub_with_return ->
-> dr_chen_ongoing_conversations.phase_4_hub
}
// Return from personal conversations
Dr. Chen: *switches back to tech mode* So, what else did you need?
-> chen_main_hub
// ===========================================
// EQUIPMENT AND TECHNICAL SUPPORT
// ===========================================
@@ -268,10 +261,11 @@ What interests you?
+ [Ask what they recommend]
Dr. Chen: *considers your mission profile*
{current_mission_id == "ghost_in_machine":
Dr. Chen: For Ghost Protocol? Definitely the network package. You'll be dealing with sophisticated digital security.
- else:
Dr. Chen: Based on your recent missions... I'd say surveillance countermeasures. You're running a lot of infiltration ops.
{
- current_mission_id() == "ghost_in_machine":
Dr. Chen: For Ghost Protocol? Definitely the network package. You'll be dealing with sophisticated digital security.
- else:
Dr. Chen: Based on your recent missions... I'd say surveillance countermeasures. You're running a lot of infiltration ops.
}
Dr. Chen: But it's your call. You know what you need in the field.
-> equipment_upgrade_menu

View File

@@ -477,11 +477,11 @@ Dr. Chen: I might have a focus problem. But all of it's important! How do you pr
{
- npc_chen_rapport >= 70:
Dr. Chen: {player_name}! Perfect timing. I just had a breakthrough on that encryption problem we discussed. Want to hear about it?
Dr. Chen: {player_name()}! Perfect timing. I just had a breakthrough on that encryption problem we discussed. Want to hear about it?
- npc_chen_rapport >= 60:
Dr. Chen: Hey! Got some time? I could use a field agent's perspective on something.
- else:
Dr. Chen: Agent {player_name}. What can I help with today?
Dr. Chen: Agent {player_name()}. What can I help with today?
}
+ {not npc_chen_discussed_experimental_tech} [Ask about experimental technology]
@@ -916,11 +916,11 @@ Dr. Chen: If you ever think I've built something that crosses ethical lines, tel
{
- npc_chen_rapport >= 85:
Dr. Chen: {player_name}! *genuine excitement* I've been waiting for you. Got something amazing to show you.
Dr. Chen: {player_name()}! *genuine excitement* I've been waiting for you. Got something amazing to show you.
- npc_chen_rapport >= 75:
Dr. Chen: Hey! Perfect timing. Want to brainstorm something together?
- else:
Dr. Chen: Agent {player_name}. What brings you by?
Dr. Chen: Agent {player_name()}. What brings you by?
}
+ {not npc_chen_discussed_dream_projects and npc_chen_rapport >= 80} [Ask about their dream projects]
@@ -1342,11 +1342,11 @@ Dr. Chen: Arrogance in security research gets people hurt. Stay humble. Stay tho
{
- npc_chen_rapport >= 95:
Dr. Chen: {player_name}! *lights up* I was just thinking about you. Want to see what we've accomplished together?
Dr. Chen: {player_name()}! *lights up* I was just thinking about you. Want to see what we've accomplished together?
- npc_chen_rapport >= 85:
Dr. Chen: Hey partner! Got time to collaborate on something?
- else:
Dr. Chen: {player_name}. What's up?
Dr. Chen: {player_name()}. What's up?
}
+ {not npc_chen_discussed_future_vision and npc_chen_rapport >= 90} [Ask about their vision for the future]
@@ -1773,7 +1773,7 @@ Dr. Chen: Peaceful. After years of fighting cyber threats. Just... peace.
{
- npc_chen_rapport >= 85:
Dr. Chen: Always energizing talking with you, {player_name}. Let's do this again soon!
Dr. Chen: Always energizing talking with you, {player_name()}. Let's do this again soon!
- npc_chen_rapport >= 75:
Dr. Chen: Great conversation. Stay safe out there, okay?
- else:
@@ -1816,7 +1816,7 @@ Dr. Chen: Peaceful. After years of fighting cyber threats. Just... peace.
{
- npc_chen_rapport >= 75:
Dr. Chen: Always a pleasure, {player_name}. Let's collaborate again soon!
Dr. Chen: Always a pleasure, {player_name()}. Let's collaborate again soon!
- npc_chen_rapport >= 60:
Dr. Chen: Thanks for the chat. Stay safe out there.
- else:

View File

@@ -18,21 +18,18 @@ INCLUDE haxolottle_ongoing_conversations.ink
// ===========================================
// EXTERNAL CONTEXT VARIABLES
// These are provided by the game engine
// Note: player_name() and current_mission_id() are already declared in haxolottle_ongoing_conversations.ink
// ===========================================
EXTERNAL player_name() // LOCAL - Player's agent codename (not real name!)
EXTERNAL current_mission_id() // LOCAL - Current mission being discussed
EXTERNAL npc_location() // LOCAL - Where conversation happens ("handler_station", "briefing_room", "comms_active", "safehouse")
EXTERNAL mission_phase() // LOCAL - Phase of current mission ("planning", "active", "debriefing", "downtime")
EXTERNAL operational_stress_level() // LOCAL - How stressed the current situation is ("low", "moderate", "high", "crisis")
// ===========================================
// GLOBAL VARIABLES (shared across all NPCs)
// Note: total_missions_completed and professional_reputation are already declared in haxolottle_ongoing_conversations.ink
// ===========================================
VAR total_missions_completed = 0 // GLOBAL - Total missions done
VAR professional_reputation = 0 // GLOBAL - Agent standing
// ===========================================
// MAIN ENTRY POINT
// Called by game engine when player talks to Haxolottle
@@ -188,18 +185,14 @@ VAR professional_reputation = 0 // GLOBAL - Agent standing
// ===========================================
=== jump_to_personal_conversations ===
// Jump to appropriate phase hub based on progression, then return here
// Jump to appropriate phase hub based on progression
{
- total_missions_completed <= 5:
-> haxolottle_ongoing_conversations.phase_1_hub_with_return ->
-> haxolottle_ongoing_conversations.phase_1_hub
- total_missions_completed <= 10:
-> haxolottle_ongoing_conversations.phase_2_hub_with_return ->
-> haxolottle_ongoing_conversations.phase_2_hub
}
// Return from personal conversations
Haxolottle: *shifts back to handler mode* So, anything else operational?
-> haxolottle_main_hub
// ===========================================
// CRISIS HANDLER SUPPORT
// ===========================================

View File

@@ -18,20 +18,17 @@ INCLUDE netherton_ongoing_conversations.ink
// ===========================================
// EXTERNAL CONTEXT VARIABLES
// These are provided by the game engine
// Note: player_name() and current_mission_id() are already declared in netherton_ongoing_conversations.ink
// ===========================================
EXTERNAL player_name() // LOCAL - Player's agent name
EXTERNAL current_mission_id() // LOCAL - Current mission being discussed
EXTERNAL npc_location() // LOCAL - Where conversation happens ("office", "safehouse", "field", "briefing_room")
EXTERNAL mission_phase() // LOCAL - Phase of current mission ("pre_briefing", "active", "debriefing", "downtime")
// ===========================================
// GLOBAL VARIABLES (shared across all NPCs)
// Note: total_missions_completed and professional_reputation are already declared in netherton_ongoing_conversations.ink
// ===========================================
VAR total_missions_completed = 0 // GLOBAL - Total missions done
VAR professional_reputation = 0 // GLOBAL - Agent standing
// ===========================================
// MAIN ENTRY POINT
// Called by game engine when player talks to Netherton
@@ -180,22 +177,18 @@ VAR professional_reputation = 0 // GLOBAL - Agent standing
// ===========================================
=== jump_to_personal_conversations ===
// Jump to appropriate phase hub based on progression, then return here
// Jump to appropriate phase hub based on progression
{
- total_missions_completed <= 5:
-> netherton_ongoing_conversations.phase_1_hub_with_return ->
-> netherton_ongoing_conversations.phase_1_hub
- total_missions_completed <= 10:
-> netherton_ongoing_conversations.phase_2_hub_with_return ->
-> netherton_ongoing_conversations.phase_2_hub
- total_missions_completed <= 15:
-> netherton_ongoing_conversations.phase_3_hub_with_return ->
-> netherton_ongoing_conversations.phase_3_hub
- total_missions_completed > 15:
-> netherton_ongoing_conversations.phase_4_hub_with_return ->
-> netherton_ongoing_conversations.phase_4_hub
}
// Return from personal conversations
Netherton: *returns to professional mode* Anything else you need to discuss?
-> netherton_main_hub
// ===========================================
// MISSION-SPECIFIC CONTENT STUBS
// These would be expanded in separate mission files