Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Kaz on October 17, 2008, 07:27:10 PM

Title: Automating region entities in scene templates
Post by: Kaz on October 17, 2008, 07:27:10 PM
Hello All

With 'Rhiannon' off and making its way in the world, time to start the next project. Want to speed up production this time, so now very interested in templates. The thing I'd like to learn is how to make a scene template that already has some pre-made regions, with cursors, already associated with partially-written scripts.

Eg we need a scene template "WidePan" that will always contain at least five region entities - GoLeft, PanLeft, GoForward, PanRight, GoRight and possibly LookUp, LookDown - always the same size, with appropriate cursors and associated scripts - so the PanLeft script will always contain a ScrollTo(); and the GoLeft script will always contain a Game.ChangeScene("",0,0); and so on. Another case is that we'll need a ZoomedView scene template that will always have a 'ZoomOut' region with a given cursor - and so on.

Can anybody point me to a tutorial for scene templates with predefined regions and scripts - or perhaps pass me a few tips?

Thanks
Title: Re: Automating region entities in scene templates
Post by: Mnemonic on October 18, 2008, 09:39:12 AM
1) Create your scene in SceneEdit as you normally would, add all the common functionality you want new scenes to inherit. Save and quit SceneEdit.
2) Copy the directory containing your scene to [path where wme is installed]\template\scene.
3) Rename the .scene file to $$NAME$$.scene
4) Edit the renamed file in some text editor (notepad will do) and change the first few lines to:

Code: [Select]
; $EDITOR_PROJECT_ROOT_DIR$ $$PROJECT_ROOT$$

SCENE {
  NAME="$$NAME$$"
  CAPTION=""
  SCRIPT="$$BASE_PATH$$\scr\scene_init.script"
  SCRIPT="scripts\scene.script"

Basically, you need to replace the real name of the scene with $$NAME$$ macro and the path to scene file with $$BASE_PATH$$ macro.

5) Create a new file called _template in the scene directory, with the following content:

Code: [Select]
$$DESC Some description of the template

If unsure, look at the existing scene templates for reference.


And that's it. Next time you add a new scene in ProjectMan, it should offer you your new template.
Title: Re: Automating region entities in scene templates
Post by: Kaz on October 22, 2008, 08:13:32 AM
Thanks, I'll try that.

And finally got it finished. And Vista only fought me every millimetre of the way :(

But it works! Thanks again.