Jump to content
TheManGoesWild

Adding code to play a super visor video to a script?

Recommended Posts

Is there anyway to play a supervisor video in a script? like I have a test call for fire station script which plays tone test, I was wondering if its possible to add play super video video to the script?

Below is my script that I've edited

object TestAlarm : CommandScript
{
     TestAlarm ()
    {
        SetIcon("tones");
        SetCursor("tones");
        SetRestrictions(RESTRICT_SELFEXECUTE);
        SetPossibleCallers(ACTOR_VEHICLE);
    }

    bool CheckPossible(GameObject *Caller)
    {
        if (!Caller->IsValid())
            return false;

        if (!Caller->GetType() == ACTOR_VEHICLE)
            return false;

        return true;
    }

    bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
    {
        if (!Target->IsValid() || Target->GetID() != Caller->GetID())
            return false;

        return true;
    }

    void PushActions(GameObject *Caller, Actor *Target, int childID)
    {
        Vehicle v(Caller);
        if (!v.HasCommand(DUMMY_HASSIREN))
        {
            if (!v.IsBlueLightEnabled())
            {
                v.EnableBlueLights(true);
            }

            
        Vector Pos = Caller->GetPosition();
        Audio::PlaySample3D("mod:Audio/FX/tones/Test.wav", Pos);
        }

        if (v.HasCommand(DUMMY_HASSIREN))
        {
            if (childID == 1)
            {
                v.EnableBlueLights(false);
            }

            int ref = v.GetUserData();
            v.UnattachSound(ref);
            Audio::StopSample(ref);

            int mSirTest;
            GameObjectList list = Game::GetGameObjects(NAME_DUMMYOBJECT);
            for(int i=0; i<list.GetNumObjects(); i++)
            {
                GameObject *obj = list.GetObject(i);
                if (obj->GetUserData() == ref)
                {
                    mSirTest = i;
                }
            }

            GameObject *obj = list.GetObject(mSirTest);
            obj->PushActionDeleteOwner(ACTION_NEWLIST);

            if (v.HasCommand(DUMMY_HASSIREN))
                v.RemoveCommand(DUMMY_HASSIREN);

            return;
        }
    }
};

Link to comment
Share on other sites

everything for the audio part look ok to my eyes.

ive been reading through the script/code SDK and found nothing that allows the player to play a supervisor type video. there are 2 others that allow for videos to be played ingame, but they are not what you are looking for unfortunately.

one function plays an actual mpg video overtop the entire gameplay (and makes the game unplayable as the video plays), while another one plays a video on an object. the second function is actually useful for doing things like video billboards or movie screens in a theater.

try looking at the SDK though, i may have missed something.

found the function. it is this.

Mission::PlayComment("PATH TO VIDEO FILE HERE");

Simply put the path of the vid file "mod:Lang/blah" and be sure to use the correct resolution, file format and video and audio format as well.

Edited by itchboy
found the function
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...