Creating triggers to play cutscenes....
#1
Posté 08 novembre 2009 - 04:37
#2
Posté 08 novembre 2009 - 06:56
http://social.biowar..._from_a_trigger
Link the script to the trigger you place in your level. Fill in your cutscene info into the script.
Modifié par EmeryQuinn, 08 novembre 2009 - 06:57 .
#3
Posté 08 novembre 2009 - 07:16
#4
Posté 08 novembre 2009 - 07:38
The error is stating just that it is missing a } somewhere.
#5
Posté 08 novembre 2009 - 08:03
http://img691.images...0/screencap.jpg
#6
Posté 08 novembre 2009 - 08:36
Doctorbashir wrote...
I'm going crazy, copy and pasting the script from the link just always gives me an error on compile, here is a screenshot, can someone give me a clue:
http://img691.images...0/screencap.jpg
Check your {}'s, you're missing a closing brace on your case statement.
If you place the cursor next to a brace and then right-click for the context menu there will be an option called "Go to matching brace". This can be helpful in isolating problems like these.
#7
Posté 08 novembre 2009 - 08:54
#8
Posté 08 novembre 2009 - 09:09
#include "events_h"
#include "global_objects_h"
#include "utility_h"
void main ()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
int nEventHandled = FALSE;
switch (nEventType)
{
case EVENT_TYPE_ENTER:
{
object oCreature = GetEventCreator(ev);
if(IsHero(oCreature))
{
resource rCutscene = GetLocalResource(GetModule(), "dr1_cut_intro");
CS_LoadCutscene(rCutscene);
DestroyObject(OBJECT_SELF, 0);
}
break;
}
}
if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
{
HandleEvent(ev, RESOURCE_SCRIPT_TRIGGER_CORE);
}
}
#9
Posté 08 novembre 2009 - 09:34
#10
Posté 08 novembre 2009 - 09:42
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "events_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
Log_Events("", ev);
switch(nEventType)
{
case EVENT_TYPE_ENTER:
{
object oHero = GetHero();
DisplayFloatyMessage(oHero, "Test", FLOATY_MESSAGE, 16777215, 2.f);
CS_LoadCutscene(R"cut_start.cut");
PlayCutscene();
break;
}
}
}
This works for me (cutscene name is "cut_start"). If it fails to play, it displays a message over the head of your character.
#11
Posté 08 novembre 2009 - 10:26
#12
Posté 08 novembre 2009 - 10:39
#13
Posté 09 novembre 2009 - 03:54
But the actual error is somewhere else.Dmuse wrote...
The wiki script should be correct. Make sure you have all of the {}'s in your script and make sure the name of your .nss file is valid (should be).
The error is stating just that it is missing a } somewhere.
From the wiki:
IsPlayer -> IsHeroIsPlayer(oCreature)
The wiki should be correct yes, but I guess it isn't?
Modifié par Tyharo, 09 novembre 2009 - 03:59 .
#14
Posté 09 novembre 2009 - 05:29
I don't want it to play a cutscene but make a journal entry/update instead.
In my area I have placed a trigger wich has a script in it called 'trigger_test'.
This is in trigger_test:
It doesn't give any errors, but it doesn't trigger my journal to update either.#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "events_h"
#include "plt_kill_leonard"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
int nEventHandled = FALSE;
Log_Events("", ev);
switch(nEventType)
{
case EVENT_TYPE_ENTER:
{
object oCreature = GetEventCreator(ev);
if(IsHero(oCreature))
{
WR_SetPlotFlag(PLT_KILL_LEONARD, LEONARD_FOUND, TRUE);
}
break;
}
}
if (!nEventHandled) //If this event wasn't handled by this script, let the core script try
{
HandleEvent(ev, RESOURCE_SCRIPT_TRIGGER_CORE);
}
}
I included the plotfile and I also checked the names regarding the updating of the plot, but it doesn't do anything.
Seems I am missing something.
Maybe it has to do with this:
When I open up my area and click on the trigger added to it, you see in the right lower corner some info regarding it.
Like active (wich is set to TRUE), Importance (wich is set to Critical) etc.
There isn't filled out a name in the name box, and can't change that either.
Also no variables set.
Maybe the problem is somewhere over there?
Modifié par Tyharo, 09 novembre 2009 - 05:30 .
#15
Posté 10 novembre 2009 - 11:32
#16
Posté 10 novembre 2009 - 03:20
This one definately works:nametab wrote...
I've had the same problem as Doctorbashir, the script just wouldn't compile. After reading this thread and fixing the script it compiles but doesn't really do anything. The cutscene will not play in-game and I even tried the script with the floating text appearing if there's a problem with the scene. The floating text did appear but I just don't know what to make that cutscene play in the game and I've used all of the scripts mentioned here.
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "events_h"
void main()
{
event ev = GetCurrentEvent();
int nEventType = GetEventType(ev);
Log_Events("", ev);
switch(nEventType)
{
case EVENT_TYPE_ENTER:
{
object oHero = GetHero();
DisplayFloatyMessage(oHero, "Test", FLOATY_MESSAGE, 16777215, 2.f);
CS_LoadCutscene(R"1cutscene.cut");
PlayCutscene();
break;
}
}
}Change 1cutscene.cut.
Modifié par st4rdog, 10 novembre 2009 - 03:21 .
#17
Posté 10 novembre 2009 - 04:42
The script I wrote worked fine afterall, I already couldn't find what the hell would be wrong with that.
It was just me forgetting to export the trigger.
#18
Posté 11 novembre 2009 - 11:48
st4rdog wrote...
This one definately works:nametab wrote...
I've had the same problem as Doctorbashir, the script just wouldn't compile. After reading this thread and fixing the script it compiles but doesn't really do anything. The cutscene will not play in-game and I even tried the script with the floating text appearing if there's a problem with the scene. The floating text did appear but I just don't know what to make that cutscene play in the game and I've used all of the scripts mentioned here.#include "log_h" #include "utility_h" #include "wrappers_h" #include "events_h" void main() { event ev = GetCurrentEvent(); int nEventType = GetEventType(ev); Log_Events("", ev); switch(nEventType) { case EVENT_TYPE_ENTER: { object oHero = GetHero(); DisplayFloatyMessage(oHero, "Test", FLOATY_MESSAGE, 16777215, 2.f); CS_LoadCutscene(R"1cutscene.cut"); PlayCutscene(); break; } } }
Change 1cutscene.cut.
You, kind sir, are a genius! Thank you very much for your help.
#19
Posté 11 novembre 2009 - 01:43
#20
Posté 11 novembre 2009 - 01:58
#21
Posté 29 novembre 2009 - 11:16





Retour en haut






