Translations of this page:


Q: How do I setup the first game scene?

A: Find a line in data/scripts/game.script which starts with Game.ChangeScene. Change this line to match the correct scene.

Q: My scene works in Project Manager but not in compiled mode?

A: It's most probably path problem. Remember that you should use relative path to the package. So if you for example in WME demo have
package called data, you don't include data into the path. So in demo you have Game.ChangeScene("scenes\room\room.scene"); and not
Another problem can occur while moving some scenes into or from nested folders. You have to check the scene file for the moved scene and
apart from correcting pathes, double check that the $EDITOR_PROJECT_ROOT_DIR$ really points to root dir.

Also important to know is that all your gfx, music etc. must reside in your project directory otherwise it doesn't get compiled into packages.

Q: How to disable inventory in a scene?

A: Normally would have been sufficient to set Game.InventoryVisible = false; but WME demo has a sliding inventory, so we would need a bit more for that.

Go into data/scripts/game_loop.script file to the line which reads

  if(Game.Interactive && Game.MouseY < 45 &&! Game.ResponsesVisible &&! WinMenu.Visible) 
    Game.InventoryVisible = true;

and change it to

  if(Game.Interactive && Game.MouseY < 45 &&! Game.ResponsesVisible &&! WinMenu.Visible && InventoryActive) 
    Game.InventoryVisible = true;

Add into data/scripts/ line global InventoryActive; and finally in data/scripts/game.script insert at the begining line InventoryActive = true;
From now on you can easily enable / disable inventory setting global variable InventoryActive in your scene_init.script files.

Q: How to wrap a line in string tab?

A: Simply put | to the place you want to have the line wrapped.
TXT000001[TAB]Hi, I would like to speak with you about | somereallystrangeandincomprehensible thing.

Q: How to work in scripts with lines from string tab?

A: If you need to assign your localised string to some variable, you have to call Game.ExpandString() function.
So Example:

var txt = Game.ExpandString("/TXT000001/"); 

Q: How to work with automated speech files?

A: WME has a great capability to play automatically voice files associated with your key. There are a few catches
you need to avoid though.

First you must tell WME where those speech files are located (by default it looks into speech directory).
this can be done through for example:


Your sound files should be named according to your keys in the file so for example if your line there reads

TOWN0010001 Hi, my name is Armitage! 

your sound file will be named town0010001.ogg

Last thing which can happen to you is that if you use any extended properties of Talk, you must simply supply null as the second parameter. So for example more complex line can read:

actor.Talk("/TOWN0010001/", null, 0, "", this.talign);

(where this.talign is a variable storing the alignment of your text)

Q: How to write special characters in WME strings?

for " use ~"
for newline use ~n

actor.Talk("Hello you ~"strange~" person.~nHow is it going?");

Q: How to work with Arrays as a member class of a custom object?


Thanks to dot notation limitation to one level, you have to trick this through temporary variable. Here's the example:

file Arrayclass.script?

#include "scripts\" 
this.Field = new Array(10); 
method SetNumber(position,number) 
  var tmp = this.Field; 
  tmp[position] = number; 
  this.Field = tmp; 

faq.txt · Last modified: 2010/10/07 17:38 by Mnemonic
Recent changes RSS feed Creative Commons License Driven by DokuWiki