Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: this.GetControl ignored or not?  (Read 4288 times)

0 Members and 1 Guest are viewing this topic.

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
this.GetControl ignored or not?
« on: January 13, 2010, 03:01:27 PM »

Hello all

Something I thought I'd done thousand times before, picking up a control in a window - but this time it's ignored, except that the allegedly 'ignored' control still executes.
Script says:
Code: [Select]
this.xResult = false;
PDA.Showing = true;
var m = this.GetControl("Message");
var c = this.GetControl("IncomingCall");
var x = this.GetControl("Idle");
var a = PDA.Notify;
PDA.Notify = null;
switch (a)
  {
  case "M":
    m.Disabled = false;
m.Visible = true;
  break;

  case "C":
    c.Disabled = false;
c.Visible = true;
  break;

  default:
    x.Disabled = false;
x.Visible = true;
  break;
  }
self.GoExclusive();

And I get the following eror messages:

Code: [Select]
13:51:32:  Runtime error. Script 'interface\PDA\PDA.script', line 6
13:51:32:    Call to undefined method 'GetControl'. Ignored.
13:51:32:  Runtime error. Script 'interface\PDA\PDA.script', line 7
13:51:32:    Call to undefined method 'GetControl'. Ignored.
13:51:32:  Runtime error. Script 'interface\PDA\PDA.script', line 8
13:51:32:    Call to undefined method 'GetControl'. Ignored.
13:51:32:  Runtime error. Script 'interface\PDA\PDA.script', line 28
13:51:32:    Call to undefined method 'GoExclusive'. Ignored.

And yet the summoned Control "IncomingCall" does actually display, so it wasn't ignored:
AND there's no error reported for the this.xresult = false; line

 ??? ??? ???

Any thoughts?
Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: this.GetControl ignored or not?
« Reply #1 on: January 13, 2010, 07:33:13 PM »

That would appear the script is not attached to a window, but to something else. Try adding this to the beginning of the script:

Game.Msg(this.Type);
Game.Msg(this.Name);

to see in what context the script is being executed.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: this.GetControl ignored or not?
« Reply #2 on: January 14, 2010, 11:04:36 AM »

Hi Mnemonic

Thanks for the suggestion. I edited the script by calling it from within the window editor, so it had to be attached. But your suggestion showed that somehow I had attached the same script to one of the objects in the window, which revealed then its name.

I removed the second association and  it all worked as expected. Spot on again, Jan.

Cheers
 
Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com
 

Page created in 0.025 seconds with 19 queries.