Author Topic: Patch [committed]: mod-wide disable of the warp camera  (Read 2444 times)

0 Members and 1 Guest are viewing this topic.

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Patch [committed]: mod-wide disable of the warp camera
The warp camera being the external camera which shows your ship warp out. This is an extremely simple patch adding an optional ai_profiles flag to disable it.

Making it an ai_profiles flag might sound odd, but the reasons for this are:
  • It's really simple. Adding a SEXP is more complicated.
  • I have no idea how to add such an option to FRED.
  • It seems very unlikely that one would want to mix both behaviours in the same mod anyway.
  • I didn't dare to simply remove the external camera from the hyperspace warp type.

It's a useful option to have, because overriding the warp camera while retaining the HUD on-screen is either impossible or really messy even using scripting.

Code: [Select]
Index: ai/ai_profiles.cpp
===================================================================
--- ai/ai_profiles.cpp (revision 7892)
+++ ai/ai_profiles.cpp (working copy)
@@ -462,6 +462,8 @@
  Default_ship_select_effect = 0;
  }
 
+ set_flag(profile, "$no warp camera:", AIPF2_NO_WARP_CAMERA, AIP_FLAG2);
+
  // if we've been through once already and are at the same place, force a move
  if ( saved_Mp && (saved_Mp == Mp) )
  {
Index: ai/ai_profiles.h
===================================================================
--- ai/ai_profiles.h (revision 7892)
+++ ai/ai_profiles.h (working copy)
@@ -61,6 +61,7 @@
 #define AIPF2_ALLOW_PRIMARY_LINK_DELAY (1 << 7)
 #define AIPF2_BEAMS_DAMAGE_WEAPONS (1 << 8)
 #define AIPF2_PLAYER_WEAPON_SCALE_FIX (1 << 9)
+#define AIPF2_NO_WARP_CAMERA (1 << 10)
 
 // AI Path types
 #define AI_PATH_MODE_NORMAL 0
Index: freespace2/freespace.cpp
===================================================================
--- freespace2/freespace.cpp (revision 7892)
+++ freespace2/freespace.cpp (working copy)
@@ -5394,10 +5394,12 @@
  mprintf(( "Hit target speed.  Starting warp effect and moving to stage 2!\n" ));
  shipfx_warpout_start( Player_obj );
  Player->control_mode = PCM_WARPOUT_STAGE2;
- Player->saved_viewer_mode = Viewer_mode;
- Viewer_mode |= VM_WARP_CHASE;
-
- Warp_camera = warp_camera(Player_obj);
+
+ if (!(The_mission.ai_profile->flags2 & AIPF2_NO_WARP_CAMERA)) {
+ Player->saved_viewer_mode = Viewer_mode;
+ Viewer_mode |= VM_WARP_CHASE;
+ Warp_camera = warp_camera(Player_obj);
+ }
  }
  break;
 

Of course, if there's a strong sentiment that it should really be a SEXP, then I can make it one.

EDIT: Committed to trunk in r7982.
« Last Edit: November 13, 2011, 04:34:05 am by zookeeper »

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Patch: mod-wide disable of the warp camera
This should actually be in the "yet to be coded by anyone" mod.tbl not AI_Profiles for exactly the reason you mention. :p
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: Patch: mod-wide disable of the warp camera
Isn't AIProfiles essentially a mod.tbl? It houses all mod-specific flags and everything that fits in "miscellaneous changes" category.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Patch: mod-wide disable of the warp camera
Yup, that's what ai_profiles has become because no one seems interested in creating the mod.tbl
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Iss Mneur

  • 210
  • TODO:
Re: Patch: mod-wide disable of the warp camera
Yup, that's what ai_profiles has become because no one seems interested in creating the mod.tbl
I'm interested, I just haven't gotten to it yet.  In the meantime ai_profiles suffices.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Patch: mod-wide disable of the warp camera
Isn't AIProfiles essentially a mod.tbl? It houses all mod-specific flags and everything that fits in "miscellaneous changes" category.

Mod.tbl should be "Set it and forget it." With AI_Profiles you must remember to copy everything to the next profile should you decide to have more than one.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]