Aller au contenu

Photo

Cutscenes script help.


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

#1
Ogre78

Ogre78
  • Members
  • 26 messages
Someone could post a working script to add a cutscenes to a mod? i'll try this for trigger the cutscene but give an error, i dont figure what is wrong...

#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_MODULE_LOAD:
        {
            object oPlayer = GetHero();
            CS_LoadCutscene(R"intro_la_via.cut");
            DisplayFloatyMessage(oHero, "Test", FLOATY_MESSAGE, 16777215, 2.f);
            PlayCutscene();
            break;
        }
    }
}



this is the error in compiling: E: 14:04:07 - intro_script.nss - intro_script.nss(17): Variable defined without type (while compiling var_constants_h.nss)

#2
EJ42

EJ42
  • Members
  • 723 messages
Looking at line 17 of your code you'll see the following:



DisplayFloatyMessage(oHero, "Test", FLOATY_MESSAGE, 16777215, 2.f);



You referenced "oHero", but you defined "oPlayer" above. That's what the error message is telling you. Either change "oPlayer" in the "object oPlayer = GetHero();" to "oHero" or change the "oHero" in the "DisplayFloatyMessage" to "oPlayer" if you prefer.

#3
Ogre78

Ogre78
  • Members
  • 26 messages
THX!