Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: General Battuta on May 08, 2012, 02:17:01 pm
-
/me triggers supernova-start
...Actually, maybe I should wait until the thing is actually released first.
/me attempts supernova-stop before realizing it doesn't exist
/me puts a supernova-stop sexp on the todo list
Why do you need it? Axem and I have done mid-mission supernova stops a bunch of times :smug:
e: actually i think it's really easy
-
sexp elegance ftw
-
pretty sure it literally takes 1 sexp already
-
yay
/me sets off fireworks
That all you got?
/me detonates bombs
Son, I am disappoint.
/me triggers supernova-start
...Actually, maybe I should wait until the thing is actually released first.
/me attempts supernova-stop before realizing it doesn't exist
/me puts a supernova-stop sexp on the todo list
*yuezhi divides by zero, invents black hole
:warp:
-
Speaking of which, how do you actually set the time it takes for the supernova to hit you? I've never been able to figure that out by myself.
-
Speaking of which, how do you actually set the time it takes for the supernova to hit you? I've never been able to figure that out by myself.
argument on the sexp
-
Ah. I thought arguments might do something to increase the time. Getting supernovas to take really long to hit you, like in JAD was something I was never really sure of how to do. Thanks.
-
You just need to look at the SEXP help text in the bottom of the events window while you've got it highlighted.
-
pretty sure it literally takes 1 sexp already
In theory yeah. You just need to keep re-applying the supernova-start sexp (and disable the supernova text gauge). HOWEVER, all glares from stars are still gone, and the first star in the suns list will try to grow, so you need to have a repeat delay of like 1 second.
I would not be adverse to seeing a supernova-stop sexp.
-
/me puts a supernova-stop sexp on the todo list
Because, supernova, your supernova, supernova goes pop. Supernova, ya' think its over but that supernova don't stop
:(
-
:nervous:
Index: code/parse/sexp.cpp
===================================================================
--- code/parse/sexp.cpp (revision 8772)
+++ code/parse/sexp.cpp (working copy)
@@ -511,6 +511,7 @@
{ "weapon-create", OP_WEAPON_CREATE, 5, 10 }, // Goober5000
{ "ship-vanish", OP_SHIP_VANISH, 1, INT_MAX },
{ "supernova-start", OP_SUPERNOVA_START, 1, 1 },
+ { "supernova-stop", OP_SUPERNOVA_STOP, 0, 0 }, //CommanderDJ
{ "shields-on", OP_SHIELDS_ON, 1, INT_MAX }, //-Sesquipedalian
{ "shields-off", OP_SHIELDS_OFF, 1, INT_MAX }, //-Sesquipedalian
{ "ship-tag", OP_SHIP_TAG, 3, 8 }, // Goober5000
@@ -17926,6 +17927,11 @@
supernova_start(eval_num(node));
}
+void sexp_supernova_stop(int node)
+{
+ supernova_stop();
+}
+
int sexp_is_secondary_selected(int node)
{
int sindex;
@@ -21679,6 +21685,11 @@
sexp_supernova_start(node);
break;
+ case OP_SUPERNOVA_STOP:
+ sexp_val = SEXP_TRUE;
+ sexp_supernova_stop(node);
+ break;
+
case OP_SHIELD_RECHARGE_PCT:
sexp_val = sexp_shield_recharge_pct(node);
break;
@@ -22955,6 +22966,7 @@
case OP_TURRET_TAGGED_CLEAR_ALL:
case OP_SUBSYS_SET_RANDOM:
case OP_SUPERNOVA_START:
+ case OP_SUPERNOVA_STOP:
case OP_SET_SPECIAL_WARPOUT_NAME:
case OP_SHIP_VAPORIZE:
case OP_SHIP_NO_VAPORIZE:
@@ -23200,6 +23212,7 @@
case OP_INVALIDATE_ALL_ARGUMENTS:
case OP_VALIDATE_ALL_ARGUMENTS:
case OP_NUM_VALID_ARGUMENTS:
+ case OP_SUPERNOVA_STOP:
return OPF_NONE;
case OP_AND:
@@ -26526,6 +26539,7 @@
case OP_CUTSCENES_RESET_TIME_COMPRESSION:
case OP_SET_CAMERA_SHUDDER:
case OP_SUPERNOVA_START:
+ case OP_SUPERNOVA_STOP:
return CHANGE_SUBCATEGORY_CUTSCENES;
case OP_JUMP_NODE_SET_JUMPNODE_NAME: //CommanderDJ
@@ -29027,6 +29041,10 @@
{ OP_SUPERNOVA_START, "supernova-start\r\n"
"\t1: Time in seconds until the supernova shockwave hits the player\r\n"},
+ { OP_SUPERNOVA_STOP, "supernova-stop\r\n"
+ "\t Stops a supernova in progress.\r\n"
+ "\t Note this only works if the camera hasn't cut to the player's death animation yet.\r\n"},
+
{ OP_WEAPON_RECHARGE_PCT, "weapon-recharge-pct\r\n"
"\tReturns a percentage from 0 to 100\r\n"
"\t1: Ship name\r\n" },
Index: code/parse/sexp.h
===================================================================
--- code/parse/sexp.h (revision 8772)
+++ code/parse/sexp.h (working copy)
@@ -678,6 +678,7 @@
#define OP_TRIGGER_SUBMODEL_ANIMATION (0x000b | OP_CATEGORY_CHANGE2 | OP_NONCAMPAIGN_FLAG) // Goober5000
#define OP_HUD_CLEAR_MESSAGES (0x000c | OP_CATEGORY_CHANGE2 | OP_NONCAMPAIGN_FLAG) // Swifty
#define OP_SET_PLAYER_ORDERS (0x000d | OP_CATEGORY_CHANGE2 | OP_NONCAMPAIGN_FLAG) // Karajorma
+#define OP_SUPERNOVA_STOP (0x000e | OP_CATEGORY_CHANGE2 | OP_NONCAMPAIGN_FLAG) //CommanderDJ
Index: code/starfield/supernova.cpp
===================================================================
--- code/starfield/supernova.cpp (revision 8772)
+++ code/starfield/supernova.cpp (working copy)
@@ -85,6 +85,36 @@
Supernova_status = SUPERNOVA_STARTED;
}
+void supernova_stop()
+{
+ // There's no currently active supernova
+ if(Supernova_status != SUPERNOVA_STARTED)
+ {
+ return;
+ }
+
+ // We're too late.
+ if(supernova_time_left() < SUPERNOVA_CUT_TIME)
+ {
+ return;
+ }
+
+ // A supernova? In MY multiplayer?
+ if(Game_mode & GM_MULTIPLAYER) {
+ return;
+ }
+
+ Supernova_time_total = -1.0f;
+ Supernova_time = -1.0f;
+ Supernova_finished = 0;
+ Supernova_popup = 0;
+ Supernova_fade_to_white = 0.0f;
+ Supernova_particle_stamp = -1;
+
+ Supernova_status = SUPERNOVA_NONE;
+}
+
+
int sn_particles = 100;
DCF(sn_part, "")
{
Index: code/starfield/supernova.h
===================================================================
--- code/starfield/supernova.h (revision 8772)
+++ code/starfield/supernova.h (working copy)
@@ -44,6 +44,9 @@
// start a supernova
void supernova_start(int seconds);
+// stop a supernova
+void supernova_stop();
+
// call once per frame
void supernova_process();
-
Committed in 8773. :)
-
:confused: .... How exactly does a supernova stop. I hope I don't see use of this SEXP in a serious mission. :P
-
:confused: .... How exactly does a supernova stop. I hope I don't see use of this SEXP in a serious mission. :P
You already saw it in a serious mission in Vassago's Dirge, and it made perfect sense there.
-
:confused: .... How exactly does a supernova stop. I hope I don't see use of this SEXP in a serious mission. :P
It happened in Gene Roddenberry's Andromeda.