Modifié par Schnipsy2, 01 janvier 2010 - 04:46 .
Scripting the end of a conversation to start a cinematic
#1
Posté 01 janvier 2010 - 04:44
#2
Posté 01 janvier 2010 - 08:23
#3
Posté 01 janvier 2010 - 02:32
#4
Posté 02 janvier 2010 - 04:33
</cod></cod>
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "events_h"
#include "plt_items"
#include "plt_main"
void main()
{
int flag_value2 = WR_GetPlotFlag(PLT_MAIN, SHERIFF);
{
WR_SetPlotFlag(PLT_MAIN, SHERIFF, 1, TRUE);
object oHero = GetHero();
resource rCutscene = R"attack.cut";
CS_LoadCutscene(rCutscene);
PlayCutscene(oHero);
} }
Then what you do is go under the scripting section of one of the lines of your conversation, find the action section, then set the script. When the conversation ends it should fire. You're going to have to change some things in the script to match yours (PLT_MAIN to PLT_whatever, SHERIFF to whatever, attack.cut to whatever etc.)
Hope this helps.
Modifié par ShadowAvatar87, 02 janvier 2010 - 04:35 .
#5
Posté 02 janvier 2010 - 04:36
Modifié par Schnipsy2, 02 janvier 2010 - 04:38 .
#6
Posté 02 janvier 2010 - 04:39
thnx though that helps alot. I will try it out and see what happens!
Modifié par Schnipsy2, 02 janvier 2010 - 04:41 .
#7
Posté 02 janvier 2010 - 06:22
I'm not really sure where to begin... There are many things wrong with the above script. It will work, sort of, but most of it isn't really doing anything and you definitely aren't doing what you think you are with the plot flags.ShadowAvatar87 wrote...
I recently figured this out myself. Here's the script I use:
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "events_h"
#include "plt_items"
#include "plt_main"
void main()
{
int flag_value2 = WR_GetPlotFlag(PLT_MAIN, SHERIFF);
{
WR_SetPlotFlag(PLT_MAIN, SHERIFF, 1, TRUE);
object oHero = GetHero();
resource rCutscene = R"attack.cut";
CS_LoadCutscene(rCutscene);
PlayCutscene(oHero);
} }
To start a cutscene with a script attached to a conversation node all you need is this:
[dascript]
#include "utility_h"
void main()
{
resource rCutscene = R"attack.cut";
CS_LoadCutscene(rCutscene);
}
[/dascript]
If you want to associate it with a plot flag, then you will need to create a plot file ("my_plot.plo"), create a main flag with a unique name in the manner of MY_PLOT_CUTSCENE_RUN. Then associate a new script with the plot* ("my_plot.nss").Then do the following:
- In the new blank script click on the Templates button in the upper right corner of the script editor.
- Double-click Custon plot events.txt in the templates list - this will insert the template into the blank script.
- Change the line //#include "PLOT_NAME_GOES_HERE" to
#include "plt_my_plot"
and replace the first
switch(nFlag)
{
}
with
[dascript]
switch(nFlag)
{
case MY_PLOT_CUTSCENE_RUN:
{
resource rCutscene = R"attack.cut";
CS_LoadCutscene(rCutscene);
break;
}
}
[/dascript]
- Back in your conversation, select my_plot from the Plot drop down and MY_PLOT_CUTSCENE_RUN from the Flag dropdown.
- Export your plot file, your plot script and your conversation.
* To make a new plot script:
- With the plot file open, click inthe Plot field of the Object Inspector
- click on the ... (elipsis)
- Select the folder where you would like to have the script
- Click the New button (to the left of the OK button)
- Name your plot script the same as your plot file (e.g. "my_plot")
- Click OK
- Open the new script by right-clicking the Script field of the Object Inspector and selecting Open Resource
Modifié par Craig Graff, 04 janvier 2010 - 10:48 .
#8
Posté 02 janvier 2010 - 10:45
I've got almost no formal training in programming (a class in java is about it), so I've just been cobbling together scripts posted on this forum and the wiki. My solutions usually aren't the most elegant I'm sure, but if it compiles and runs I consider it a victory. I just posted it because I hadn't seen an answer to that posted here yet, and my script did work.
#9
Posté 03 janvier 2010 - 09:12
#10
Posté 04 janvier 2010 - 10:40





Retour en haut






