Wintermute Engine Forum

Game development => Game design => Topic started by: visionmind on September 15, 2006, 01:37:35 AM

Title: Portrait Style conversations?
Post by: visionmind on September 15, 2006, 01:37:35 AM
I've done some searching and have found some people referring to it, but I'd like to clarify if WME is capable (without scripting) to make portrait style conversations? (like Sierra KQ6 (windows version))  I read an old post (2003) where Jan mentioned he was planning to implement it in an easier way, but I can't find it documented. (am I not looking in right place?) 

I'm really liking WME, although a little wary of scripting...  Keep up the good work Jan.

Thanks for your time,

visionmind
Title: Re: Portrait Style conversations?
Post by: metamorphium on September 15, 2006, 07:50:16 AM
hello visionmind,

this feature is scriptable but requires really some lines of script. There are two approaches to this:

Fully dynamic is to create a new window and attach a script to it with a couple of methods likei
insertButton and removeButton where insertButton will as a parameter take name of the button (which
will be further referenced in script as on "" event, image of the button, hover image of the button). removeButton on the contrary will remove the button from
window and reorder the rest of buttons so there's o gap from the missing button.

Than you'll have some sort of activation routine, which will construct this window on the fly from the lobal variables.


so something like

if (frogKilled) yourwindow.insertButton("deadfrog","frog.png","frog_h.png");
etc.

If you look into window object definition you'll find a method CreateButton and DeleteButton so adding your new button will be:

method insertButton(name, image,hoverImage)
{
  var nButton =  yourwindow.CreateButton(name);
  nButton.SetImage(image);
  nButton.SetHoverImage(hoverImage);
  nButton.X = [some position here];
  nButton.Y = [some position here];
  nButton.Visible  = true;
}


The positioning of the buttons in the window should be set according to some variable, so you simply increment it by some number
with each added button and decrement it with each removed button by the size of the Button image.

The less dynaimc system is more or less the same, but the window already contains the buttons in the window definition (fixed ammount)
and you are only changing their sprites and Visible attribute.

Since I have no ideas about your coding skills, let me know if this was helpful and if you need help with something more concrete.
I'd advise you to try to code this and if you're stuck we can always help.

And welcome to our forums btw.


Title: Re: Portrait Style conversations?
Post by: metamorphium on September 16, 2006, 08:19:46 PM
See this I quickly put together:

http://wiki.dead-code.org/wakka.php?wakka=IconBased