@@ -627,6 +627,7 @@ SCP_vector<sexp_oper> Operators = {
627627 { "trigger-ship-animation", OP_TRIGGER_ANIMATION_NEW, 3, 7, SEXP_ACTION_OPERATOR, }, //Lafiel
628628 { "stop-looping-animation", OP_STOP_LOOPING_ANIMATION, 3, 3, SEXP_ACTION_OPERATOR, }, //Lafiel
629629 { "update-moveable-animation", OP_UPDATE_MOVEABLE, 2, INT_MAX, SEXP_ACTION_OPERATOR, }, //Lafiel
630+ { "advance-moveable-animation", OP_ADVANCE_MOVEABLE, 2, 2, SEXP_ACTION_OPERATOR, }, //Lafiel
630631
631632 //Coordinate Manipulation Sub-Category
632633 { "set-object-position", OP_SET_OBJECT_POSITION, 4, 4, SEXP_ACTION_OPERATOR, }, // WMC
@@ -2870,7 +2871,8 @@ int check_sexp_syntax(int node, int desired_return_type, int recursive, int *bad
28702871
28712872 break;
28722873 }
2873- case OP_UPDATE_MOVEABLE: {
2874+ case OP_UPDATE_MOVEABLE:
2875+ case OP_ADVANCE_MOVEABLE:{
28742876 //Second OP name
28752877 SCP_string name = CTEXT(CDR(ship_node));
28762878 SCP_tolower(name);
@@ -23557,6 +23559,19 @@ void sexp_update_moveable_animation(int node)
2355723559 Ship_info[ship_entry->shipp()->ship_info_index].animations.updateMoveable(model_get_instance(ship_entry->shipp()->model_instance_num), name, args);
2355823560}
2355923561
23562+ void sexp_advance_moveable_animation(int node)
23563+ {
23564+ auto ship_entry = eval_ship(node);
23565+ if (!ship_entry || !ship_entry->has_shipp())
23566+ return;
23567+
23568+ node = CDR(node);
23569+
23570+ SCP_string name(CTEXT(node));
23571+
23572+ Ship_info[ship_entry->shipp()->ship_info_index].animations.advanceMoveableToFinal(model_get_instance(ship_entry->shipp()->model_instance_num), name);
23573+ }
23574+
2356023575void sexp_add_remove_escort(int node)
2356123576{
2356223577 int flag;
@@ -30675,6 +30690,11 @@ int eval_sexp(int cur_node, int referenced_node)
3067530690 sexp_update_moveable_animation(node);
3067630691 break;
3067730692
30693+ case OP_ADVANCE_MOVEABLE:
30694+ sexp_val = SEXP_TRUE;
30695+ sexp_advance_moveable_animation(node);
30696+ break;
30697+
3067830698 case OP_STOP_LOOPING_ANIMATION:
3067930699 sexp_val = SEXP_TRUE;
3068030700 sexp_stop_looping_animation(node);
@@ -32013,6 +32033,7 @@ int query_operator_return_type(int op)
3201332033 case OP_SET_ALPHA_MULT:
3201432034 case OP_TRIGGER_ANIMATION_NEW:
3201532035 case OP_UPDATE_MOVEABLE:
32036+ case OP_ADVANCE_MOVEABLE:
3201632037 case OP_STOP_LOOPING_ANIMATION:
3201732038 case OP_CONTAINER_ADD_TO_LIST:
3201832039 case OP_CONTAINER_REMOVE_FROM_LIST:
@@ -34939,6 +34960,12 @@ int query_operator_argument_type(int op_index, int argnum)
3493934960 else
3494034961 return OPF_NUMBER;
3494134962
34963+ case OP_ADVANCE_MOVEABLE:
34964+ if (argnum == 0)
34965+ return OPF_SHIP;
34966+ else
34967+ return OPF_ANIMATION_NAME;
34968+
3494234969 case OP_IS_CONTAINER_EMPTY:
3494334970 case OP_GET_CONTAINER_SIZE:
3494434971 if (argnum == 0) {
@@ -37210,6 +37237,7 @@ int get_category(int op_id)
3721037237 case OP_DESTROY_INSTANTLY_WITH_DEBRIS:
3721137238 case OP_TRIGGER_ANIMATION_NEW:
3721237239 case OP_UPDATE_MOVEABLE:
37240+ case OP_ADVANCE_MOVEABLE:
3721337241 case OP_NAV_SET_COLOR:
3721437242 case OP_NAV_SET_VISITED_COLOR:
3721537243 case OP_CONTAINER_ADD_TO_LIST:
@@ -37547,6 +37575,7 @@ int get_subcategory(int op_id)
3754737575 case OP_SET_ALPHA_MULT:
3754837576 case OP_TRIGGER_ANIMATION_NEW:
3754937577 case OP_UPDATE_MOVEABLE:
37578+ case OP_ADVANCE_MOVEABLE:
3755037579 case OP_STOP_LOOPING_ANIMATION:
3755137580 return CHANGE_SUBCATEGORY_MODELS_AND_TEXTURES;
3755237581
@@ -42871,6 +42900,13 @@ SCP_vector<sexp_help_struct> Sexp_help = {
4287142900 "\tThree optional numbers: x, y, z rotation target relative to base, in degrees\r\n"
4287242901 },
4287342902
42903+ { OP_ADVANCE_MOVEABLE, "advance-moveable-animation\r\n"
42904+ "\tAdvances a moveable animation to its final state instantly.\r\n"
42905+ "Takes 2 arguments...\r\n"
42906+ "\t1: The ship (ship must be in-mission).\r\n"
42907+ "\t2: The name of the moveable.\r\n"
42908+ },
42909+
4287442910 { OP_TOGGLE_ASTEROID_FIELD, "toggle-asteroid-field\r\n"
4287542911 "\tTurns an existing asteroid or debris field on/off. Will do nothing if no field is defined in the mission file or set with sexps.\r\n"
4287642912 "\tNote that this differs from actually removing and adding a field in that it only toggles a field from being rendered or calculated.\r\n"
0 commit comments