Author Topic: Patch [committed]: customizable warpout engage time  (Read 1325 times)

0 Members and 1 Guest are viewing this topic.

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Patch [committed]: customizable warpout engage time
This patch adds a way to change the time it takes for a ship's warp drive to engage. If used, it overrides the default 3.0s warpout delay for the player, and affects AI ships as well.

Code: [Select]
Index: ai/aicode.cpp
===================================================================
--- ai/aicode.cpp (revision 7940)
+++ ai/aicode.cpp (working copy)
@@ -12890,7 +12890,10 @@
  aip->submode_start_time = Missiontime;
  break;
  case AIS_WARP_2: // Make sure won't collide with any object.
- if (timestamp_elapsed(aip->force_warp_time) || !collide_predict_large_ship(objp, objp->radius*2.0f + 100.0f)) {
+ if (timestamp_elapsed(aip->force_warp_time)
+ || (!collide_predict_large_ship(objp, objp->radius*2.0f + 100.0f)
+ || (Ship_info[shipp->ship_info_index].warpout_type == WT_HYPERSPACE
+ && !collide_predict_large_ship(objp, 100000.0f)))) {
  aip->submode = AIS_WARP_3;
  aip->submode_start_time = Missiontime;
 
@@ -12931,9 +12934,12 @@
  }
  break;
  case AIS_WARP_4: {
- shipfx_warpout_start(objp);
- aip->submode = AIS_WARP_5;
- aip->submode_start_time = Missiontime;
+ // Only lets the ship warp after waiting for the warpout engage time
+ if ((Missiontime / 100) >= (aip->submode_start_time / 100 + Ship_info[shipp->ship_info_index].warpout_engage_time)) {
+ shipfx_warpout_start(objp);
+ aip->submode = AIS_WARP_5;
+ aip->submode_start_time = Missiontime;
+ }
  break;
  }
  case AIS_WARP_5:
Index: playerman/playercontrol.cpp
===================================================================
--- playerman/playercontrol.cpp (revision 7940)
+++ playerman/playercontrol.cpp (working copy)
@@ -919,8 +919,16 @@
 
  if ( Player->control_mode == PCM_WARPOUT_STAGE1 )
  {
+ float warpout_delay;
+ ship_info *sip = &Ship_info[Ships[objp->instance].ship_info_index];
+
+ if (sip->warpout_engage_time >= 0)
+ warpout_delay = sip->warpout_engage_time / 1000.0f;
+ else
+ warpout_delay = MINIMUM_PLAYER_WARPOUT_TIME;
+
  // Wait at least 3 seconds before making sure warp speed is set.
- if ( Warpout_time > MINIMUM_PLAYER_WARPOUT_TIME ) {
+ if ( Warpout_time > warpout_delay) {
  // If we are going around 5% of the target speed, progress to next stage
  float diffSpeed = objp->phys_info.fspeed;
  if(target_warpout_speed != 0.0f) {
Index: ship/ship.cpp
===================================================================
--- ship/ship.cpp (revision 7940)
+++ ship/ship.cpp (working copy)
@@ -1943,6 +1943,17 @@
  parse_sound("$Warpout Start Sound:", &sip->warpout_snd_start, sip->name);
  parse_sound("$Warpout End Sound:", &sip->warpout_snd_end, sip->name);
 
+ if(optional_string("$Warpout engage time:"))
+ {
+ float t_time;
+ stuff_float(&t_time);
+ if (t_time >= 0)
+ sip->warpout_engage_time = fl2i(t_time*1000.0f);
+ else
+ Warning(LOCATION, "Warp-out engage time specified as 0 or less on ship '%s'; value ignored", sip->name);
+ } else
+ sip->warpout_engage_time = -1;
+
  if(optional_string("$Warpout speed:"))
  {
  stuff_float(&sip->warpout_speed);
Index: ship/ship.h
===================================================================
--- ship/ship.h (revision 7940)
+++ ship/ship.h (working copy)
@@ -1168,6 +1168,7 @@
  float warpout_radius;
  int warpout_snd_start;
  int warpout_snd_end;
+ int warpout_engage_time; //in ms
  float warpout_speed;
  int warpout_time; //in ms
  float warpout_accel_exp;

Example tabling:
Code: [Select]
...
$Warpout type:                Hyperspace
$Warpout engage time:         2.0 ;Two-second warpout delay
$Warpout time:                6.0
...

EDIT: Committed to trunk in r7980.
« Last Edit: November 13, 2011, 04:30:14 am by zookeeper »

 

Offline Enigmatic Entity

  • Exemplar Essayer
  • 28
  • Amigo ad infinitum.
Re: Patch: customizable warpout engage time
Does this mean if you set it to say, 0.1s, that if you are in afterburner mode and you press alt + j, the ship will slow to warp speed in 0.1s ?
This will be great for those times you have to fight Dragons and have to "return to base", i.e. Trinity mission :)
Juvenescence and multifariousness is eternal.

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Patch: customizable warpout engage time
Does this mean if you set it to say, 0.1s, that if you are in afterburner mode and you press alt + j, the ship will slow to warp speed in 0.1s ?
This will be great for those times you have to fight Dragons and have to "return to base", i.e. Trinity mission :)

No, it means that it will only take 0.1s for the warpout to start after you've reached the warpout speed, whereas by default that delay is always 3s for the player and nothing for AI ships.

 

Offline petar91

  • 25
Re: Patch: customizable warpout engage time
About the warpout time, (feature request on) is it possible to increase the time when a ship is entering the field of action from subspace.

As you can see in the briefing cutscene and full screen cutscene (ravana from the knossos, or the bastion collapsing subspace with bombs), biggest ships warpin and warpout time is longer than ingame warpin/out where a juggernaut warp as speed as a fighter...

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Patch: customizable warpout engage time
About the warpout time, (feature request on) is it possible to increase the time when a ship is entering the field of action from subspace.

As you can see in the briefing cutscene and full screen cutscene (ravana from the knossos, or the bastion collapsing subspace with bombs), biggest ships warpin and warpout time is longer than ingame warpin/out where a juggernaut warp as speed as a fighter...
Umm, yeah, there's $Warpin time and $Warpout time.

 

Offline Enigmatic Entity

  • Exemplar Essayer
  • 28
  • Amigo ad infinitum.
Re: Patch: customizable warpout engage time
Play Wings of Dawn if you want to see something take a long time to warp in... ;)
Juvenescence and multifariousness is eternal.