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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Kaz

Pages: 1 [2] 3 4 ... 16
16
Technical forum / Re: Mouseentry loops?
« on: August 24, 2011, 11:18:59 AM »
Thanks Mnemonic. Sorry I didn't get it the first time. I get it now. Cheers for the help.

17
Technical forum / Re: Mouseentry loops?
« on: August 23, 2011, 02:02:48 PM »
It seems that MouseEntry, on its own loads the window and that's the end of it. But introduce a MouseLeave event to the same script, and the MouseLeave code runs, while the mouse is still over the entity... huh? The MouseEntry then runs again, and round and round we go, "Loading window, Closing window". I thought the mouse had to leave for MouseLeave to run? Here's the whole script. Grateful for your spotting any errors. Cheers.

if(Translate.Loaded == null)
  {
  Translate.Loaded = false;
  }

on "MouseEntry"
  {
  this.Interactive = false;
  if(Translate.Loaded != true)
    { 
    if(Game.Language != "English")
      {
     Translate.Message = "FRIDAY";
      Game.Msg("loading window");
     Translate.Window = Game.LoadWindow("interface\Localization\Translator.window");
     Translate.Loaded = true;
     Sleep(200);
     }
   }
  this.Interactive = true;
  }
 
on "MouseLeave"
  {
  this.Interactive = false;
  if(Translate.Loaded == true)
    {
    Game.Msg("closing window");
   Translate.Loaded = false;
   var win = Translate.Window;
   win.Close();
   Sleep(200);
   }
  this.Interactive = true;
  }

 

18
Technical forum / Mouseentry loops?
« on: August 22, 2011, 06:16:13 PM »
Hi all.

I'm trapping a MouseEntry event thus:
on "MouseEntry"
  {
  this.Active = false;
  if(Game.Language != "English")
    {
   Translate.Message = "FRIDAY";
   if(Translate.Loaded != true)
     {
     Game.Msg("!!!!");
     //Translate.Window = Game.LoadWindow("interface\Localization\Translator.window");
     Translate.Loaded = true;
     }
   }
  while(Translate.Loaded == true)
   {
   Sleep(20);
   }
  }

This routine loops! The Game.Msg keeps being displayed. Before I commented out the window, that kept getting loaded. I thought MouseEntry was a single event, but it appears to be constantly testing its state. What am I missing?

Thanks




19
I've now made sure nothing else is on the Windows desktop. Still get the same fault.

What's more confusing is that it still fails to work for me in the runtime, every time - but the compiled version of the same code works fine, every time. Can you suggest why that difference might be between the runtime and the compiled?

I also added the following lines to the 'Newplayer' window that contains the editor:
this.Focus();
var e=this.GetControl("NameEditor");
e.Focus();
but still no keyboard input in the runtime.

 ??? ??? ???
 

20
Project zipped and sent to forum at dead code email.

Cheers

21
The one I'm working on now isn't big - just a proof of concept of a player management screen.

How should I get it to you?


22
Thank you. As you suggested, I have removed the extra Exclusive and sleeps. Some of them are actually meant as a weird visual effect, and those I've left in :)

The Editor still does not accept keyboard input.

Thanks again for looking at this. It has me foxed. I've read everything I can find about it. But I cannot find what's wrong with my code.
 

23
Hi

Sorry about the NewPlayer.Exclusive - but I've since tried it the way Mnemonic suggested, which incidentally was the way it was originally, when it worked :(

Thanks for doing this.

Three scripts involved. IntroMenu is the game's introductory menu, and if no players are registered, pressing "Play" will call the NewPlayer window with the Editor in question. PlayerList allows for registering and deleting additional players, so also calls the NewPlayer window. Then there's the NewPlayer itself

Quote

#include "scripts\base.inc"
#include "scripts\keys.inc"

// I AM INTROMENU

this.xResult = false;
var BeenHere = Game.IsSaveSlotUsed(0);
if(BeenHere != true)
  {
  // Initialize system
  var RegKeyName;
  Game.RegWriteNumber("PlayerNum", null);
  Game.RegWriteNumber("PlayerCurrent", null);
  for(var t = 1; t<7; t = t+1);
    {
   RegKeyName = "Player"+t;
   Game.RegWriteString(RegKeyName, null);
   }
  Game.SaveGame(0, "SystemSave");
  }
var PlayerName = this.GetControl("PlayerName");
// Find out who's playing and update this menu for current and player list for profile changes
Player.Num = Game.RegReadNumber("PlayerNum");
if(Player.Num == null)
  {
  Player.Num = 0;
  Game.RegWriteNumber("PlayerNum", Player.Num);
  }
else
  {
  Player.Num = Game.RegReadNumber("PlayerNum");
  }
 
if(Player.Num > 0)
  {
  // Get already registered players
  Player.Current = Game.RegReadNumber("PlayerCurrent");
  // Initialise list
  for(var a = 1; a <7; a = a+1)
    {
    Player[a] = null;
    }
  // Repopulate list   
  for(a = 1; a < Player.Num +1; a = a + 1)
   {
   RegKeyName = "Player" + a;
   Player[a] = Game.RegReadString(RegKeyName);
   }
  DoPlayer();
  }

function DoPlayer()
  {
  var dp = Player.Current;
  PlayerName.Text = Game.ExpandString("/IM_PlayerName/")+" "+Player[dp];
  PlayerName.Visible = true;
  var ChangeProfile = this.GetControl("ChangeProfile");
  ChangeProfile.Visible = true;
  ChangeProfile.Disabled = false;
  }

on "Play"
  {
  // If we don't have any players, create one
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  if(Player.Num == 0)
    {
   NewPlayer = Game.LoadWindow("interface\IntroMenu\NewPlayer.window");
   NewPlayer.GoExclusive();
   while(NewPlayer != null)
     {
     Sleep(20);
     }
   DoPlayer();
   }
  else
    {
   Game.LoadGame(Player.Current);
   }
  }
 
on "Options"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  Game.Msg("No options yet");
  }

on "Credits"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  Game.Msg("No credits yet");
  }
 
on "Exit"
  {
  // ARE YOU SURE?
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  var qg = Game.LoadWindow("interface\IntroMenu\QuitSure.window");
  }

on "ChangeProfile"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  var PlayerList = Game.LoadWindow("interface\IntroMenu\PlayerList.window");
  if(Player.Changed == true)
    {
   Player.Changed = null;
   DoPlayer();
   }
  }


////////////////////////////////////////////////////////////////////////////////
on "close"
  {
  this.Close();
  }


////////////////////////////////////////////////////////////////////////////////
on "yes"
  {
  this.xResult = true;
  this.Close();
  }


////////////////////////////////////////////////////////////////////////////////
on "Keypress"
  {
  var button;

  if(Keyboard.KeyCode==VK_ESCAPE)
    {
    button = this.GetControl("close");
    button.Press();
   }
  else if(Keyboard.KeyCode==VK_RETURN)
    {
    // button = this.GetControl("yes");
    // button.Press();
    }
  }


Quote
#include "scripts\base.inc"
#include "scripts\keys.inc"

// I AM PLAYERLIST

this.xResult = false;
for(var w = 1024; w > 512; w = w - 32)
  {
  this.X = w;
  Sleep(20);
  }


Player.Was = Player.Current;
InitButtons();
NoDelete();
NoNew();
this.GoExclusive();

function InitButtons()
  {
  Game.Interactive = false;
  for(var ib = 1; ib < 7; ib = ib + 1)
    {
   //Initialize buttons
   var ic = this.GetControl(ib);
   Game.Msg("ic is "+ic);
   ic.Text = "";
   ic.Disabled = true;
   ic.Visible = false;
   }
   
  for(ib = 1; ib < Player.Num+1; ib = ib+1)
    {
   ic = this.GetControl(ib);
   ic.Text = Player[ib];
   ic.Disabled = false;
   ic.Visible = true;
   if(Player.Current == ib)
     {
     ic.SetFont("fonts\Arial20BoldRed.font");
     }
   else
     {
     ic.SetFont("fonts\arial20.font");
     }
   }
  Game.Interactive = true;
  }

function NoDelete()
  {
  Game.Interactive = false;
  var d = this.GetControl("Delete");
  if(Player.Current == 1)
    {
   d.Disabled = true;
   d.Visible = true;
   d.SetFont=("fonts\arial20greyed.font");;
   }
  else
    {
   d.Disabled = false;
   d.Visible = true;
    d.SetFont("fonts\arial20.font");   
   }
  Game.Interactive = true;
  }

function NoNew()
  {
  Game.Interactive = false;
  var n = this.GetControl("New");
  if(Player.Num > 5)
    {
   n.Disabled = true;
   n.Visible = true;
   n.SetFont("fonts\arial20greyed.font");
   }
  else
    {
   n.Disabled = false;
   n.Visible = true;
   n.SetFont("fonts\arial20.font");
   }
  Game.Interactive = true;
  }

function CloseThis()
  {
  Player.Was = null;
  this.Close();
  Game.UnloadObject(this);
  }
////////////////////////////////////////////////////////////////////////////////
on "1"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  Player.Current = 1; 
  InitButtons();
  }
 
on "2"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  Player.Current = 2; 
  InitButtons();
  }
 
on "3"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  Player.Current = 3; 
  InitButtons();
  }
 
on "4"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  Player.Current = 4; 
  InitButtons();
  }
 
on "5"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  Player.Current = 5; 
  InitButtons();
  }
 
on "6"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  Player.Current = 6; 
  InitButtons();
  }
 
on "New"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  var fn = this.GetControl("New");
  NewPlayer = Game.LoadWindow("interface\IntroMenu\NewPlayer.window");
  NewPlayer.GoExclusive();
  while(NewPlayer != null)
    {
   Sleep(20);
   }
  InitButtons();
  NoDelete();
  NoNew();
  fn.Pressed = false;   
  }
 
on "Delete"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  var fd = this.GetControl("Delete");
  var dw = Game.LoadWindow(""); // ARE YOU SURE?
  if(dw == true)
    {
   Player.Changed = true;
    for(var pd = Player.Current; pd < Player.Num; pd = pd + 1)
      {
     Player[pd] = Player[pd + 1];
     var RegKeyName = "Player" + pd;
      Game.RegWriteString(RegKeyName, Player[pd]);
     }
   var px = Player.Num;
   RegKeyName = "Player"+Player.Num;
   Player[px] = null;
   Game.RegWriteString(RegKeyName, null);
   Player.Num = Player.Num - 1;
   Game.RegWriteNumber("PlayerNum", Player.Num);
   InitButtons();
   NoDelete();
   NoNew();
   }
  dw.Pressed = false;
  }

on "Continue"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  this.xResult = true;
  CloseThis();     
  }

on "Cancel"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  if(Player.Current != Player.Was)
    {
   Player.Current = Player.Was;
   InitButtons();
   }
  this.xResult = false;
  CloseThis();
  }


////////////////////////////////////////////////////////////////////////////////
on "Keypress"
  {
  var button;

  if(Keyboard.KeyCode==VK_ESCAPE)
    {
    button = this.GetControl("close");
    button.Press();
   }
  else if(Keyboard.KeyCode==VK_RETURN)
    {
    // button = this.GetControl("yes");
    // button.Press();
    }
  }




Quote
#include "scripts\base.inc"
#include "scripts\keys.inc"

// I AM NEWPLAYER

this.xResult = false;
for(var w = 1024; w > 312; w = w - 64)
  {
  this.X = w;
  Sleep(20);
  }
///////////////////////////////////////////////////////////////////////////////
on "Cancel"
  {
  NewPlayer = null;
  this.Close();
  Game.UnloadObject(this);
  }


////////////////////////////////////////////////////////////////////////////////
on "OK"
  {
  Game.Interactive = false;
  var ed = this.GetControl("NameEditor");
  var pn = ed.Text;
  Game.Msg("Player is "+pn);
  Player.Num = Player.Num+1;
  Game.Msg("Player.Num is "+Player.Num);
  var px = Player.Num;
  Player[px] = pn;
  Player.Current = px;
  Player.Changed = true;
  Game.RegWriteNumber("PlayerNum", Player.Num);
  Game.RegWriteNumber("PlayerCurrent", Player.Current);
  for(var a = 1; a < Player.Num +1; a = a +1)
    {
   var RegKeyName = "Player" + a;
   Game.RegWriteString(RegKeyName, Player[a]);
   }
  Game.Interactive = true;
  NewPlayer = null;
  this.Close();
  Game.UnloadObject(this);
  }


////////////////////////////////////////////////////////////////////////////////
on "Keypress"
  {
  var button;

  if(Keyboard.KeyCode==VK_ESCAPE)
    {
    button = this.GetControl("close");
    button.Press();
   }
  else if(Keyboard.KeyCode==VK_RETURN)
    {
    // button = this.GetControl("yes");
    // button.Press();
    }
  }


24
Thanks Jan - herewith.

; generated by WindowEdit

; $EDITOR_PROJECT_ROOT_DIR$ ..\..\..\

WINDOW
{
  NAME="NewPlayer"
  CAPTION=""
 
 
  TITLE_ALIGN="left"
 
  X=1024
  Y=234
  WIDTH=400
  HEIGHT=300
  DISABLED=FALSE
  VISIBLE=TRUE
  PARENT_NOTIFY=FALSE
  TRANSPARENT=FALSE
  PAUSE_MUSIC=TRUE
  MENU=FALSE
  IN_GAME=FALSE
  CLIP_CONTENTS=FALSE
 
  ALPHA_COLOR { 0, 0, 0 }
  ALPHA=0
 
  SCRIPT="interface\IntroMenu\NewPlayer.script"
 
  EDITOR_PROPERTY
  {
    NAME="Selected"
    VALUE="False"
  }

  STATIC
  {
    NAME="Background"
    CAPTION=""
   
    IMAGE="ui_elements\BackgroundSuper400x300.JPG"
    TEXT=""
    TEXT_ALIGN="left"
    VERTICAL_ALIGN="center"
   
    X=0
    Y=0
    WIDTH=400
    HEIGHT=300
    DISABLED=FALSE
    VISIBLE=TRUE
    PARENT_NOTIFY=TRUE
   
   
    EDITOR_PROPERTY
    {
      NAME="Selected"
      VALUE="False"
    }

  }
  STATIC
  {
    NAME="Title"
    CAPTION=""
   
    FONT="fonts\Arial20BoldRed.font"
    TEXT="/IM_NewPlayer/"
    TEXT_ALIGN="center"
    VERTICAL_ALIGN="center"
   
    X=30
    Y=20
    WIDTH=335
    HEIGHT=65
    DISABLED=FALSE
    VISIBLE=TRUE
    PARENT_NOTIFY=TRUE
   
   
    EDITOR_PROPERTY
    {
      NAME="Selected"
      VALUE="False"
    }

  }
  BUTTON
  {
    NAME="OK"
    CAPTION=""
   
    FONT="fonts\arial20.font"
    FONT_PRESS="fonts\Arial20BoldRed.font"
   
    TEXT="/IM_ButtonOK/"
    TEXT_ALIGN="center"
   
    X=80
    Y=180
    WIDTH=90
    HEIGHT=96
    DISABLED=FALSE
    VISIBLE=TRUE
    PARENT_NOTIFY=TRUE
    FOCUSABLE=FALSE
    CENTER_IMAGE=FALSE
    PRESSED=FALSE
    PIXEL_PERFECT=FALSE
   
   
    EDITOR_PROPERTY
    {
      NAME="Selected"
      VALUE="False"
    }

  }
  BUTTON
  {
    NAME="Cancel"
    CAPTION=""
   
    FONT="fonts\arial20.font"
    FONT_PRESS="fonts\Arial20BoldRed.font"
   
    TEXT="/IM_Cancel/"
    TEXT_ALIGN="center"
   
    X=260
    Y=180
    WIDTH=90
    HEIGHT=90
    DISABLED=FALSE
    VISIBLE=TRUE
    PARENT_NOTIFY=TRUE
    FOCUSABLE=FALSE
    CENTER_IMAGE=FALSE
    PRESSED=FALSE
    PIXEL_PERFECT=FALSE
   
   
    EDITOR_PROPERTY
    {
      NAME="Selected"
      VALUE="False"
    }

  }
  EDIT
  {
    NAME="NameEditor"
    CAPTION=""
   
    FONT="fonts\arial20.font"
   
    TEXT=""
   
    X=56
    Y=96
    WIDTH=275
    HEIGHT=60
    MAX_LENGTH=20
    CURSOR_BLINK_RATE=530
    FRAME_WIDTH=0
    DISABLED=FALSE
    VISIBLE=TRUE
    PARENT_NOTIFY=TRUE
   
    EDITOR_PROPERTY
    {
      NAME="Selected"
      VALUE="True"
    }

  }
}


25
Thanks for the suggestion. Over-complications were due to me trying Everything I Could Think Of. :(
I implemented your suggestion as I understood it, and it made no difference. So I must be doing something else wrong?

Herewith the relevant part of one of the calling scripts:
Quote
on "New"
  {
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  var fn = this.GetControl("New");
  NewPlayer = Game.LoadWindow("interface\IntroMenu\NewPlayer.window");
  NewPlayer.GoExclusive();
  while(NewPlayer != null)
    {
   Sleep(20);
   }
  InitButtons();
  NoDelete();
  NoNew();
  fn.Pressed = false;   
  }

And here is the other calling script:
Quote
on "Play"
  {
  // If we don't have any players, create one
  this.PlaySound("ui_elements\GenMoveClick.ogg");
  if(Player.Num == 0)
    {
   NewPlayer = Game.LoadWindow("interface\IntroMenu\NewPlayer.window");
   NewPlayer.GoExclusive();
   while(NewPlayer != null)
     {
     Sleep(20);
     }
   DoPlayer();
   }
  else
    {
   Game.LoadGame(Player.Current);
   }
  }


In the New Player window where the Editor is, all components are set to Parent Notify TRUE and the relevant part of the script says:
Quote
on "OK"
  {
  Game.Interactive = false;
  var ed = this.GetControl("NameEditor");
  var pn = ed.Text;
  Game.Msg("Player is "+pn);
  Player.Num = Player.Num+1;
  Game.Msg("Player.Num is "+Player.Num);
  var px = Player.Num;
  Player[px] = pn;
  Player.Current = px;
  Player.Changed = true;
  Game.RegWriteNumber("PlayerNum", Player.Num);
  Game.RegWriteNumber("PlayerCurrent", Player.Current);
  for(var a = 1; a < Player.Num +1; a = a +1)
    {
   var RegKeyName = "Player" + a;
   Game.RegWriteString(RegKeyName, Player[a]);
   }
  Game.Interactive = true;
  NewPlayer = null;
  this.Close();
  Game.UnloadObject(this);
  }

Still no keyboard input on the window. So what am I doing wrong? Thanks for your help on this.

(BTW, this 'Post Reply' box is very difficult to write in - it bounces what I'm typing out of sight and any corrections cause its window to scroll)

26
This one still foxes me every time - I include an editor in a window and sometimes can put text in it, and then on the next occasion I use it, the editor will not accept keyboard input.

I have read that it's to do with the Window being exclusive, but the window calling the offending NewPlayer window has "NewPlayer = Game.LoadWindow("newplayer.window"); NewPlayer.Exclusive; = true, along with newplayer.script containing the line this.GoExclusive(); - but still the editor ignores the keyboard.

Any ideas?

Thanks

27
Technical forum / Re: One page of graphics becomes an animation
« on: January 13, 2011, 08:26:48 AM »
Thanks.

28
Wintermute is brilliant for First Person games. That's how we did 'Rhiannon'. This is a magnificently flexible engine.

What Adventure Maker had that Wintermute doesn't (officially) is the 'inside of a sphere' effect for full rotation. But Darkling Room found a way round it for their latest game and for 'Coven', we're working on a form of rotation based on running videos during turns. It needs more rendering from the model, timing is critical and you need to fade from the video back to the still, but it works. And in any case, a lot of adventures are moving away from rotation these days.

29
Technical forum / One page of graphics becomes an animation
« on: December 10, 2010, 02:57:20 PM »
Hi,
I've seen some Wintermute games that apparently have a very tidy way of doing animations. You have all the images ('frames') of the amination in one transparent PNG and them somehow reference each of the images in turn to to make the sprite animation. I'd like to be able to do it that way. Has anybody got a way of programatically referring to one part of an image and displaying only that part in a sprite?

Thanks
 

30
Technical forum / Re: Localizing Subtitles
« on: March 12, 2010, 03:25:31 PM »
Thanks Mnemonic.

Pages: 1 [2] 3 4 ... 16

Page created in 0.05 seconds with 18 queries.