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

Author Topic: Why won't the cursor appear / node go live?  (Read 3727 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'
Why won't the cursor appear / node go live?
« on: April 17, 2008, 08:08:10 PM »

Hi all

My script says:

on "Scraper"
  {
  Game.Interactive = false; //works
  var ItemNormal = Scene.GetNode("YourLifeX");  //works
  ItemNormal.Active = true; //works
  Game.PlaySound("sounds\WallPuzzle\WallScrape"+Random(1,5)+".ogg"); //works
  Sleep(1400); //works
  ItemNormal.Active = false; //works
  Game.SelectedItem = null; //works
  ItemNormal = Scene.GetNode("YourLife"); // unsure
  ItemNormal.SetSprite("Objects\BlankMoss.png"); // unsure (it's transparent)
  global WallPuzzle; //works
  if(WallPuzzle.Next == null) // unsure, but doesn't matter coz '1' is in there anyway
    {
   WallPuzzle.Next = 1; //works
   }
Game.Msg(WallPuzzle.Next); // works
  if(WallPuzzle.Next == 1) // it does
    {
   ItemNormal = Scene.GetNode("YourLife"); // unsure
    ItemNormal.SetCursor("sprites\system\RhiannonCursors\Action2.sprite");  // fails, no cursor
   ItemNormal.Active = true; //fails, no interaction
    }
  WallPuzzle.YourLife = true; // unsure
  Game.Interactive = true; // works
  }

Upshot is, the cursor doesn't appear in the SetCursor command. The condition for setting the cursor (if WallPuzzle.Next == 1) is valid. the Game.Msg says so. I've been at this one script ALL DAY, trying options, testing, comparing with almost identical scripts that do show the cursor. Any ideas, muties?

If all you can say is "Your code looks as though it should work" or "that'll never work because of X", that'll be a help.

Thanks.
 
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

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Why won't the cursor appear / node go live?
« Reply #1 on: April 17, 2008, 09:03:26 PM »

don't see anything wrong. Here's what I'd do:

...

Code: [Select]
if(WallPuzzle.Next == 1) // it does
  {
     Debug();
     ItemNormal = Scene.GetNode("YourLife"); // unsure
     ItemNormal.SetCursor("sprites\system\RhiannonCursors\Action2.sprite");  // fails, no cursor
     ItemNormal.Active = true; //fails, no interaction
   }

Then make sure you run the game in window and set the Debugger on in Project manager. Then upon entering debugger (on the debug command) and stepping through the commands you easily see if the ItemNormal is correctly set.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: Why won't the cursor appear / node go live?
« Reply #2 on: April 18, 2008, 07:23:32 AM »

Metamorphium

Thanks for the contribution. It helps a lot just to know that the code doesn't have any howlers in it. I've not used 'Debug' before - wasn't aware of it - thanks for the idea.
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

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Why won't the cursor appear / node go live?
« Reply #3 on: April 18, 2008, 07:33:22 AM »

LOL, I think I get it.

ItemNormal = Scene.GetNode("YourLife"); // unsure
ItemNormal.SetSprite("Objects\BlankMoss.png"); // unsure (it's transparent)

Make a sprite out of BlankMoss.png and turn off pixel precise. By default the pixel precise is on which means, that transparent pixels are handled as non active.

I wonder why are you doing this that way? Why having transparent thing? I'd myself use Region Entity, shape it around the newly appeared hotspot (if I got the logic right) turn it off in
Scene Edit by default and in this code then set it's Active to true.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: Why won't the cursor appear / node go live?
« Reply #4 on: April 18, 2008, 09:00:18 AM »

Pixel precise. Of course. I could kick myself. I suspected it might be because the node was somehow of an indeterminate size. It worked, of course. Thanks MM. Respect  ::rock

As to why I'm doing it that way, two main reasons.

First, there's a lot going on in this scene. Rather than set up nodes for everything, I've found in the past that can make the scene run slowly in the interpreter, and I don't want to take that chance in the compiled version. So I try to minimise the number of nodes and poke and pop them with what I need them to contain, because it's faster in execution.

Second, I simply did not realise I could use a Region entity to contain sprites, but only because SceneEdit won't allow it.

BTW, the debugger simply didn't tell me what I needed to know. It doesn't give the node cursor state, doesn't mention the width of the node, gives the 'filename' as null even though there's a .png in it, and although I'd done several things to my multidimensional global 'WallPuzzle', it wasn't even mentioned. Is there a document anywhere on the deft and skilful use of Debug?

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

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Why won't the cursor appear / node go live?
« Reply #5 on: April 18, 2008, 09:05:01 AM »

I have it meant as a part of my online book, but I didn't get to it yet. :( It's coming though. Be sure you step over the instructions so they got properly filled.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet
 

Page created in 0.047 seconds with 24 queries.