Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: movie clip intro  (Read 5890 times)

0 Members and 1 Guest are viewing this topic.

brankomaster

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
    • View Profile
movie clip intro
« on: July 02, 2014, 11:28:32 AM »

i want to make movie intro for my game, i need some help with scripts, how to write script and where to put it that will tell to go to another (static) scene when intro movie is finished
Logged

eborr

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 196
    • View Profile
Re: movie clip intro
« Reply #1 on: July 05, 2014, 10:06:12 AM »

The key method for playing a movie is PlayTheora()

If you do a search on that in the forums you will see plenty of examples of how to script that.

You use PlayTheora within a scene.

The code could be Game.PlayTheora("data\video\intro.ogv");

The documentation is your friend,.
Logged

brankomaster

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
    • View Profile
Re: movie clip intro
« Reply #2 on: July 05, 2014, 11:11:54 AM »

Thank you
Logged

brankomaster

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
    • View Profile
Re: movie clip intro
« Reply #3 on: July 05, 2014, 11:42:54 PM »

now i have new problem, inventory appears on mouse over even during movie playback, how can i disable inventory only during intro scene (when movie is playing ) and then make it work in next static scene?
Logged

Azrael

  • Regular poster
  • ***
  • Karma: 9
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • View Profile
    • Mad Orange
Re: movie clip intro
« Reply #4 on: July 06, 2014, 07:28:13 AM »

You have to change the script that show inventory on game_daemon.script and adding something that block when you want.
There are a couple of way to do it, you could check the scene name:

Code: WME Script
  1. if (Game.MouseY < 66 && Scene.Name != "NameOfTheSceneWithTheVideo")
  2. {
  3. //Show inventory
  4. }

Or you could use a variable so if you have many scenes with movie you don't have to add each name.
In the scene_init.script of the movie scene:
Code: WME Script
  1. Scene.NotShowInventory = true;

In game_daemon.script:
Code: WME Script
  1. if (Game.MouseY < 66 && Scene.NotShowInventory != true)
  2. {
  3. //Show inventory
  4. }

As i said there are many way, it depends on what you want to achieve and how your scripts works.
Logged

brankomaster

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
    • View Profile
Re: movie clip intro
« Reply #5 on: July 06, 2014, 12:22:15 PM »

i've added: Scene.NotShowInventory = true; to intro scene init script and

    if (Game.MouseY < 66 && Scene.NotShowInventory != true)
    {
    Game.InventoryVisible = true;
    }

to scripts\game_loop.script at the bottom of the script but its not working
Logged

Azrael

  • Regular poster
  • ***
  • Karma: 9
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • View Profile
    • Mad Orange
Re: movie clip intro
« Reply #6 on: July 06, 2014, 02:16:18 PM »

You don't have to add it at the end of the script, you have to change the script you are using to show inventory. That was only an example, i don't know which script are you using :)
Also remember that you have to set the variable in the scene_init.
Logged

brankomaster

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 14
    • View Profile
Re: movie clip intro
« Reply #7 on: July 06, 2014, 04:05:33 PM »

heres the code from game loop scrip, from my very poor knowledge it looks like this part of script toggles inventory visibility
Code: [Select]
// display the inventory window
  if(Game.Interactive && Game.MouseY < 45 && !Game.ResponsesVisible && !WinMenu.Visible) Game.InventoryVisible = true;
  else if(Game.MouseY > 100 || Game.ResponsesVisible || !Game.Interactive) Game.InventoryVisible = false;
and this part is telling when it needs to be hidden
Code: [Select]
  else if(Game.MouseY > 100 || Game.ResponsesVisible || !Game.Interactive) Game.InventoryVisible = false;should i add that new condition in this bracket and how.
And another thing i dont understand is it enought just to add
Code: [Select]
Scene.NotShowInventory = true; in the scene script or it needs some additional handlers like onEnterFrame or something like that
« Last Edit: July 06, 2014, 04:18:33 PM by brankomaster »
Logged

Azrael

  • Regular poster
  • ***
  • Karma: 9
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • View Profile
    • Mad Orange
Re: movie clip intro
« Reply #8 on: July 06, 2014, 07:27:06 PM »

You need only to change this:

Code: WME Script
  1. if(Game.Interactive && Game.MouseY < 45 && !Game.ResponsesVisible && !WinMenu.Visible && Scene.NotShowInventory != true) Game.InventoryVisible = true;

No need to change the part that hide the inventory.

And yes, is enough to add:
Code: WME Script
  1. Scene.NotShowInventory = true;

On the scene_init of the scene in which you want the menu to not show. Since the script that show or hide the inventory is an infinite loop it will check each time if the variable is set or no.
Logged
 

Page created in 0.055 seconds with 25 queries.