Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: SP on July 08, 2009, 11:33:06 PM

Title: Videos
Post by: SP on July 08, 2009, 11:33:06 PM
Hi, I´m new with the WME and a friend and I wanted to make a graphic adventure. The problem is that we have no idea how to reproduce a video when you do something like to ignite the light...

Please, i know you are good like this, if anyone can help us we would be grateful for it.

Thanks!!
Title: Re: Videos
Post by: Catacomber on July 09, 2009, 04:45:33 AM
The best instructions for videos are here.

http://res.dead-code.org/doku.php/kbase:tranzaudiosimple

But you don't have to use a video to ignite a light.  It's much better to use a sprite.  Get a glow sprite that goes from a small to a large image (so you'd have at least 3 images--small glow, medium glow and large glow) and then change the sprite for your object that holds the light to that.   

For example:

Code: WME Script
  1. var Entvar=Scene.GetNode("Gl");
  2.  

then somewhere

Code: WME Script
  1. Entvar.SetSprite("scenes\Name of your scene\Glow.sprite");
  2.  
Title: Re: Videos
Post by: SP on July 09, 2009, 03:54:25 PM
We've tryed it, but it apeard an "script error"

I attach you the code:

Code: [Select]
#include "scripts\base.inc"


////////////////////////////////////////////////////////////////////////////////
on "LookAt"
{
  GoToObject(551, 565);
var mirar;
 
mirar[0] = "Una lámpara"; 
mirar[1] = "Está encendida";
var reply = Random(0,1);
actor.Talk(mirar[reply]);
}

////////////////////////////////////////////////////////////////////////////////
on "Take"
{
  GoToObject(551, 565);
var Entvar=Scene.GetNode("Gl");
Entvar.SetSprite("scenes\Room\Lámparaencendida\Lámparavideo.sprite");
Sleep(650);
}


////////////////////////////////////////////////////////////////////////////////
on "Talk"
{
  actor.GoTo(551, 565);
  actor.TurnTo(DI_RIGHT);
var hablar;
 
hablar[0] = "¿Por quién me has tomado?"; 
hablar[1] = "No quiero hablar con la lámpara";
hablar[2] = "Ilumíname";
var reply = Random(0,2);
actor.Talk(hablar[reply]);
}

////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
  GoToObject();
}


////////////////////////////////////////////////////////////////////////////////
function GoToObject()
{
  actor.GoTo(551, 565);
  actor.TurnTo(DI_UPRIGHT);
}


Sorry if my english is not perfect and thanks!!
Title: Re: Videos
Post by: Mnemonic on July 09, 2009, 04:21:17 PM
It would really help if you said WHAT error exactly.
Title: Re: Videos
Post by: SP on July 10, 2009, 04:35:32 PM
When you enter the room where theres is a lamp, at the top-right appeard: "Script compiled error. View log for details".

When you pulsate to "use" the lampp appears another message that says the following thing "Script runtime mistake. View log for details"
Title: Re: Videos
Post by: odnorf on July 10, 2009, 04:54:04 PM
Please, post the log file in here. You can find the log file in the directory of your project.
Title: Re: Videos
Post by: SP on July 11, 2009, 12:33:53 PM
Code: [Select]
19:46: ********** DEBUG LOG OPENED 09-07-2009 (Release Build) *****************
19:46: Wintermute Engine ver 1.8.10, Compiled on Feb 14 2009, 16:19:25
19:46: Platform: Windows XP Service Pack 2 (Build 2600)
19:46: DirectX version: 9.0
19:46:
19:46: Scanning packages...
19:46:   Registered 0 files in 0 package(s)
19:46: Initializing scripting engine...
19:46:   Script compiler bound successfuly
19:46: Loading plugins...
19:46:   wme_sample_pixel.dll
19:46:   wme_snow.dll
19:46: Loading string table...
19:46:   51 strings loaded
19:46: Enumerating Direct3D devices...
19:46: Enumerating DirectSound devices...
19:46: Game aspect ratio:    1.333333
19:46: Monitor aspect ratio: 1.250000
19:46: Game aspect ratio is the same as monitor aspect ratio.
19:46: Backup resolution:  1024 x 768
19:46:
19:46: Available video devices:
19:46:   RADEON 9200 PRO Family (Microsoft Corporation) (accelerated)
19:46:     Driver: ati2dvag.dll 6.14.10.6462
19:46:     Monitor: 0
19:46: Available audio devices:
19:46:   Controlador primario de sonido
19:46:   C-Media Wave Device
19:46:   [no sound]
19:46:
19:46: User selected:
19:46:   Using requested resolution (1024 x 768)
19:46:   Video: RADEON 9200 PRO Family (Microsoft Corporation) (accelerated)
19:46:          Windowed:no  Colors:32bit  T&L:no  Multisample:0
19:46:   Audio: Controlador primario de sonido
19:46: Maximum texture size: 2048x2048
19:46: Compiling script 'items\Cristal\cristal.script'...
19:46:   Error@line 15: Variable 'InsertAfter' is referenced but not defined
19:46: Engine initialized in 363 ms
19:46:
19:46: Missing image: 'wme projects\summer work\videolampara\1.png'
19:46: Missing image: 'wme projects\summer work\videolampara\2.png'
19:46: Missing image: 'wme projects\summer work\videolampara\3.png'
19:46: Missing image: 'wme projects\summer work\videolampara\4.png'
19:46: Missing image: 'wme projects\summer work\videolampara\5.png'
19:46: Missing image: 'wme projects\summer work\videolampara\6.png'
19:46: Missing image: 'wme projects\summer work\videolampara\7.png'
19:46: Missing image: 'wme projects\summer work\videolampara\8.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9b.png'
19:46: Missing image: 'wme projects\summer work\videolampara\10.png'
19:46: Missing image: 'wme projects\summer work\videolampara\11.png'
19:46: Missing image: 'wme projects\summer work\videolampara\12.png'
19:46: Missing image: 'wme projects\summer work\videolampara\1.png'
19:46: Missing image: 'wme projects\summer work\videolampara\2.png'
19:46: Missing image: 'wme projects\summer work\videolampara\3.png'
19:46: Missing image: 'wme projects\summer work\videolampara\4.png'
19:46: Missing image: 'wme projects\summer work\videolampara\5.png'
19:46: Missing image: 'wme projects\summer work\videolampara\6.png'
19:46: Missing image: 'wme projects\summer work\videolampara\7.png'
19:46: Missing image: 'wme projects\summer work\videolampara\8.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9b.png'
19:46: Missing image: 'wme projects\summer work\videolampara\10.png'
19:46: Missing image: 'wme projects\summer work\videolampara\11.png'
19:46: Missing image: 'wme projects\summer work\videolampara\12.png'
19:46: Missing image: 'wme projects\summer work\videolampara\1.png'
19:46: Missing image: 'wme projects\summer work\videolampara\2.png'
19:46: Missing image: 'wme projects\summer work\videolampara\3.png'
19:46: Missing image: 'wme projects\summer work\videolampara\4.png'
19:46: Missing image: 'wme projects\summer work\videolampara\5.png'
19:46: Missing image: 'wme projects\summer work\videolampara\6.png'
19:46: Missing image: 'wme projects\summer work\videolampara\7.png'
19:46: Missing image: 'wme projects\summer work\videolampara\8.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9b.png'
19:46: Missing image: 'wme projects\summer work\videolampara\10.png'
19:46: Missing image: 'wme projects\summer work\videolampara\11.png'
19:46: Missing image: 'wme projects\summer work\videolampara\12.png'
19:46: Missing image: 'wme projects\summer work\videolampara\1.png'
19:46: Missing image: 'wme projects\summer work\videolampara\2.png'
19:46: Missing image: 'wme projects\summer work\videolampara\3.png'
19:46: Missing image: 'wme projects\summer work\videolampara\4.png'
19:46: Missing image: 'wme projects\summer work\videolampara\5.png'
19:46: Missing image: 'wme projects\summer work\videolampara\6.png'
19:46: Missing image: 'wme projects\summer work\videolampara\7.png'
19:46: Missing image: 'wme projects\summer work\videolampara\8.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9b.png'
19:46: Missing image: 'wme projects\summer work\videolampara\10.png'
19:46: Missing image: 'wme projects\summer work\videolampara\11.png'
19:46: Missing image: 'wme projects\summer work\videolampara\12.png'
19:46: Missing image: 'wme projects\summer work\videolampara\1.png'
19:46: Missing image: 'wme projects\summer work\videolampara\2.png'
19:46: Missing image: 'wme projects\summer work\videolampara\3.png'
19:46: Missing image: 'wme projects\summer work\videolampara\4.png'
19:46: Missing image: 'wme projects\summer work\videolampara\5.png'
19:46: Missing image: 'wme projects\summer work\videolampara\6.png'
19:46: Missing image: 'wme projects\summer work\videolampara\7.png'
19:46: Missing image: 'wme projects\summer work\videolampara\8.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9b.png'
19:46: Missing image: 'wme projects\summer work\videolampara\10.png'
19:46: Missing image: 'wme projects\summer work\videolampara\11.png'
19:46: Missing image: 'wme projects\summer work\videolampara\12.png'
19:46: Missing image: 'wme projects\summer work\videolampara\1.png'
19:46: Missing image: 'wme projects\summer work\videolampara\2.png'
19:46: Missing image: 'wme projects\summer work\videolampara\3.png'
19:46: Missing image: 'wme projects\summer work\videolampara\4.png'
19:46: Missing image: 'wme projects\summer work\videolampara\5.png'
19:46: Missing image: 'wme projects\summer work\videolampara\6.png'
19:46: Missing image: 'wme projects\summer work\videolampara\7.png'
19:46: Missing image: 'wme projects\summer work\videolampara\8.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9b.png'
19:46: Missing image: 'wme projects\summer work\videolampara\10.png'
19:46: Missing image: 'wme projects\summer work\videolampara\11.png'
19:46: Missing image: 'wme projects\summer work\videolampara\12.png'
19:46: Missing image: 'wme projects\summer work\videolampara\1.png'
19:46: Missing image: 'wme projects\summer work\videolampara\2.png'
19:46: Missing image: 'wme projects\summer work\videolampara\3.png'
19:46: Missing image: 'wme projects\summer work\videolampara\4.png'
19:46: Missing image: 'wme projects\summer work\videolampara\5.png'
19:46: Missing image: 'wme projects\summer work\videolampara\6.png'
19:46: Missing image: 'wme projects\summer work\videolampara\7.png'
19:46: Missing image: 'wme projects\summer work\videolampara\8.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9b.png'
19:46: Missing image: 'wme projects\summer work\videolampara\10.png'
19:46: Missing image: 'wme projects\summer work\videolampara\11.png'
19:46: Missing image: 'wme projects\summer work\videolampara\12.png'
19:46: Missing image: 'wme projects\summer work\videolampara\1.png'
19:46: Missing image: 'wme projects\summer work\videolampara\2.png'
19:46: Missing image: 'wme projects\summer work\videolampara\3.png'
19:46: Missing image: 'wme projects\summer work\videolampara\4.png'
19:46: Missing image: 'wme projects\summer work\videolampara\5.png'
19:46: Missing image: 'wme projects\summer work\videolampara\6.png'
19:46: Missing image: 'wme projects\summer work\videolampara\7.png'
19:46: Missing image: 'wme projects\summer work\videolampara\8.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9.png'
19:46: Missing image: 'wme projects\summer work\videolampara\9b.png'
19:46: Missing image: 'wme projects\summer work\videolampara\10.png'
19:46: Missing image: 'wme projects\summer work\videolampara\11.png'
19:46: Missing image: 'wme projects\summer work\videolampara\12.png'
19:46: Error opening file 'scenes\room\scr\scene_intit2.script'
19:46: CScEngine::GetCompiledScript - error opening script 'scenes\room\scr\scene_intit2.script'
19:46: Using texture format: 21
19:46: Error opening file 'scenes\room\scr\scene_intit2.script'
19:46: CScEngine::GetCompiledScript - error opening script 'scenes\room\scr\scene_intit2.script'
19:46: Compiling script 'scenes\room\luz encendida\scr\pomo.script'...
19:46:   Error@line 17: Invalid character
19:46: Compiling script 'scenes\room\luz encendida\scr\pomo.script'...
19:46:   Error@line 17: syntax error
19:47: Runtime error. Script 'scenes\room\luz encendida\scr\lámpara.script', line 21
19:47:   Call to undefined method 'SetSprite'. Ignored.
19:47: Runtime error. Script 'scenes\room\luz encendida\scr\lámpara.script', line 21
19:47:   Call to undefined method 'SetSprite'. Ignored.
19:47:
19:47: Shutting down...
19:47: Shutting down scripting engine
19:47: ********** DEBUG LOG CLOSED ********************************************

Thanks ;)
Title: Re: Videos
Post by: HelLRaiseR on July 12, 2009, 07:28:33 PM
Hmm! I'm afraid that you has a lot of errors in your code

I can see in the log:

- Variable not defined in items/cristal/cristal.script
- There are a lot of image files missing (probably can be a sprite?)
- The script /room/scene_init2.script can't be opened
- Invalid character in the script pomo.script (I think that this error is caused due that the object and var names are in spanish with accents and other signs)
- Invalid call to SetSprite method in lampara.script (it's probably that you are used this function in object but this one isn't a actor, item or entity)

By other way, I see your video problem in the spanish forum, and now I see that catacomber has recommended you to use a sprite, but you are trying to "play" a sprite.  ???

If you wish, send me a private message and I talk with you in the chat, becouse there are a lot of things to explain here
Title: Re: Videos
Post by: SP on July 14, 2009, 11:04:01 AM
Thanks!! After several attempts we have achieved that the video works by means of the code " Game. PlayTheora " and converting it to the format ogm =)
Now we would like to know how to play animations. I mean, the videos are very useful for intros or very long animations, but when you want that the actor move his arm switch on a light, or stooping to take an object its more useful using sprites not??

Thank you very much. Smiley
Title: Re: Videos
Post by: Darky on July 14, 2009, 11:31:02 AM
Yes, in that case you'd of course use Sprites and the PlayAnim() function. Take a look at the default WME Demo Project too, it helps.
Title: Re: Videos
Post by: HelLRaiseR on July 14, 2009, 04:56:42 PM
You have a detailed explanation in Spanish forum. I recommend you that read the chapter "actors" and "entities" in the wintermute help file. It's explained very well