View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0003094 | FSSCP | scripting | public | 2014-08-14 16:03 | 2014-09-17 08:24 |
| Reporter | Parias | Assigned To | m_m | ||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.7.2 RC1 | ||||
| Target Version | 3.7.2 | ||||
| Summary | 0003094: Request for new scripting function: ts.playCutscene() (.patch included) | ||||
| Description | Another request as part of a co-op enhancement project I'm working on. This just allows you to force a cutscene to play using the scripting system (all it does is call the internal movie_play() function) - simply pass it the desired filename. Considered "experimental" for now and best used as you're entering a state such as GS_STATE_BRIEFING as otherwise the back-end stuff might not line up correctly (i.e. music and stuff will continue playing while the cutscene is running if you call it mid-mission, I assume because the appropriate state changes aren't covered here). My own testing shows this works perfect for my needs otherwise - the underlying intent is to be able to trigger cutscenes that play for both host and client in a multiplayer session. However, I've never created a new scripting function before (I barely know how to code) so feedback on any needed changes would be appreciated - this is a pretty simple function though. A .patch of how I have this working now is attached. | ||||
| Tags | No tags attached. | ||||
|
|
lua.cpp-playCutscene.patch (1,226 bytes)
Index: code/parse/lua.cpp
===================================================================
--- code/parse/lua.cpp (revision 10927)
+++ code/parse/lua.cpp (working copy)
@@ -3,6 +3,7 @@
#include "asteroid/asteroid.h"
#include "camera/camera.h"
#include "cfile/cfilesystem.h"
+#include "cutscene/movie.h"
#include "debris/debris.h"
#include "cmdline/cmdline.h"
#include "freespace2/freespace.h"
@@ -15567,7 +15568,19 @@
return ADE_RETURN_TRUE;
}
+ADE_FUNC(playCutscene, l_Testing, NULL, "Forces a cutscene by the specified filename string to play. Should really only be used in a non-gameplay state (i.e. start of GS_STATE_BRIEFING) otherwise odd side effects may occur. Highly Experimental.", "string", NULL)
+{
+ //This whole thing is a quick hack and can probably be done way better, but is currently functioning fine for my purposes.
+ char *filename;
+ if (!ade_get_args(L, "s", &filename))
+ return ADE_RETURN_FALSE;
+
+ movie_play(filename);
+
+ return ADE_RETURN_TRUE;
+}
+
// *************************Helper functions*********************
//WMC - This should be used anywhere that an 'object' is set, so
//that scripters can get access to as much relevant data to that |
|
|
Assigning to m!m to review. |
|
|
Patch looks good to me. |
|
|
Fix committed to trunk@11076. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2014-08-14 16:03 | Parias | New Issue | |
| 2014-08-14 16:03 | Parias | File Added: lua.cpp-playCutscene.patch | |
| 2014-08-15 10:36 | Echelon9 | Status | new => code review |
| 2014-09-17 01:52 | Goober5000 | Note Added: 0016282 | |
| 2014-09-17 01:52 | Goober5000 | Assigned To | => m_m |
| 2014-09-17 01:55 | Goober5000 | Target Version | => 3.7.2 |
| 2014-09-17 08:21 | m_m | Note Added: 0016283 | |
| 2014-09-17 08:24 | m_m | Changeset attached | => fs2open trunk r11076 |
| 2014-09-17 08:24 | m_m | Note Added: 0016284 | |
| 2014-09-17 08:24 | m_m | Status | code review => resolved |
| 2014-09-17 08:24 | m_m | Resolution | open => fixed |