Aller au contenu

Photo

Dragon age toolset - Cutscenes


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
chimptits

chimptits
  • Members
  • 2 messages
 Hey,

Just wanted to ask if anyone knew how to script it so that when you start your module your cutscene plays
before you start playing.

Where do I put the script once i've done it? I'm missing something really stupid. So a noob guide would be of greatest help. Sorry If this queston has been asked a thousand times..i know that must be annoying...:crying:

#2
chimptits

chimptits
  • Members
  • 2 messages
Bump =(

please I'm really stuck!

#3
Proleric

Proleric
  • Members
  • 2 362 messages
There are several ways to do this.

My preference is to place a trigger around the start waypoint.

Here's the trigger event script. I've removed some lines you don't need.

The script sets a plot flag at the end of the cutscene. The plot script handles everything else I need to happen, including starting a conversation automatically. If you don't need that, just omit the plot flag parameters from the call to zDoCutscene.

The header coc_h contains my plot flags, so remove it, and substitute your own plot flag header if necessary.

// Crown of Creation - Trigger Event Script
//
// Proleric 26-May-2010 (adapted from a script provided by Beerfish)
//
// Events handled :
//    ENTER : tag-based action e.g. cutscene
//
// One-shot triggers are deleted when the script is complete.
// Any event not handled is passed to the Bioware core script.
//

#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "events_h"
#include "coc_h"
/**
* @brief Load and run cutscene then delete trigger
*
* @param rCutscene    - cutscene to play
* @param sPlot        - plot to set at the end (optional)
* @param nPlotFlag    - plot flag to set (optional)
* @param sTalkspeaker - tag of creature who will initiate dialog at the end (optional)
*
* @returns TRUE to indicate that the event has been handled.
**/
int zDoCutscene(resource rCutscene, string sPlot = "", int nPlotFlag = - 1,
                                    string sTalkSpeaker = "");

void main()
{
    event    ev            = GetCurrentEvent();
    int      nEventType    = GetEventType(ev);
    int      bEventHandled = FALSE;
    object   oTrigger      = OBJECT_SELF;
    string   sTrigger      = GetTag(oTrigger);
    object   oCreature     = GetEventCreator(ev);

    switch(nEventType)
    {
        case EVENT_TYPE_ENTER:
        {
          if (IsPartyMember(oCreature))
            {
              if (sTrigger == "coc330tr_intro")
                bEventHandled = zDoCutscene(R"coc330cs_intro.cut",
                                            PLT_COCPT_DESPAIR, 
                                            COC_DESPAIR_EXIT_PROLOG);

              if (sTrigger == "coc330tr_mirror")
                bEventHandled = zDoCutscene(R"coc330cs_mirror_1.cut",
                                            PLT_COCPT_OBSIDIAN_MIRROR, 
                                        COC_OBSIDIAN_MIRROR_CUTSCENE_DONE);
            }
         }
         break;
    }

    if (!bEventHandled)
    {
        HandleEvent(ev, RESOURCE_SCRIPT_TRIGGER_CORE);
    }
}


// Load and run cutscene

int zDoCutscene(resource rCutscene, string sPlot = "", int nPlotFlag = - 1,
                                    string sTalkSpeaker = "")
  {
    object oTrigger = OBJECT_SELF;

    CS_LoadCutscene(rCutscene, sPlot, nPlotFlag, sTalkSpeaker);
    PlayCutscene();
    DestroyObject(oTrigger, 0);
    return TRUE;
  }



#4
FergusM

FergusM
  • Members
  • 460 messages
You can also try putting it in your module script, with the event type module_start. Something like:


#include "utility_h"

void main()
{
event ev = GetCurrentEvent();
switch (GetEventType(ev))
{
case EVENT_TYPE_MODULE_START:
{
CS_LoadCutscene(R"my_cutscene.cut");
break;
}
}
HandleEvent(ev,RESOURCE_SCRIPT_MODULE_CORE);
}



To set your module script, go to file -> manage modules -> properties and select your script. Or, if you do the above with a trigger, you'd create a trigger (in the resource pallet on the right), select your script in the 'script' field and then place your trigger at the start location.

If you have a little trouble figuring out how this all works, try looking at some of the tutorials on the wiki, like the demo module, which should help you understand why the above code works and what it all means.

Modifié par FergusM, 20 juillet 2010 - 08:47 .


#5
Arrtis

Arrtis
  • Members
  • 3 679 messages
Bump....Spammer came by....