Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Part of the script doesn't get executed - sometimes  (Read 3572 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'
Part of the script doesn't get executed - sometimes
« on: November 17, 2009, 11:18:10 AM »

Here's a chunk from a scene_init that runs a sequence then switches on a few nodes. The nodes come up fine in the debug version, but not when the code is compiled. Makes no sense to me, so I'm going to us an alternative way of doing it (window) but I thought it might be of interest.

Code: [Select]
// setup scene according to state variables
Game.SetCursor("sprites\system\RhiannonCursors\NoCursor.png");
global InventoryOn = false;
global AllowEscape = false;
Game.PlayMusicChannel(0,"scenes\00_Intro\Intro01\DistantStorm.ogg",true);
var an = Scene.GetNode("an");
an.AlphaColor = MakeRGBA(255,255,255,0);
var logo = Scene.GetNode("logo");
logo.AlphaColor = MakeRGBA(255,255,255,0);
var prod = Scene.GetNode("prod");
prod.AlphaColor = MakeRGBA(255,255,255,0);
var sell = Scene.GetNode("sell");
sell.AlphaColor = MakeRGBA(255,255,255,0);
var video = Scene.GetNode("video");
video.Active = true;
video.PlayTheora("scenes\99_Credits\CreditsMovie.ogg", false);
while(video.IsTheoraPlaying() == true)
  {
  Sleep(20);
  }
video.Active = false;
var f;
an.Active = true;
for(f = 0; f < 256; f = f + 5)
  {
  an.AlphaColor = MakeRGBA(255,255,255,f);
  Sleep(40);
  }
logo.Active = true;
for(f = 0; f < 256; f = f + 5)
  {
  logo.AlphaColor = MakeRGBA(255,255,255,f);
  Sleep(40);
  }
prod.Active = true;
for(f = 0; f < 256; f = f + 5)
  {
  prod.AlphaColor = MakeRGBA(255,255,255,f);
  Sleep(40);
  }
Sleep(2000);
sell.Active = true;
for(f = 255; f > -1; f = f - 5)
  {
  an.AlphaColor = MakeRGBA(255,255,255,f);
  logo.AlphaColor = MakeRGBA(255,255,255,f);
  prod.AlphaColor = MakeRGBA(255,255,255,f);
  sell.AlphaColor = MakeRGBA(255,255,255,255-f);
  Sleep(20);
  }
Sleep(2000);
// Following lines run in debug mode but NOT in compiled version
var p;
p = Scene.GetNode("b_play");
p.Active = true;
var r;
r = Scene.GetNode("b_rep");
r.Active = true;
var e;
e = Scene.GetNode("b_end");
e.Active = true;
// Execution resumes from here
Game.SetCursor("sprites\system\RhiannonCursors\Cursor_ball.png");
Game.SetMousePos(515,645);
Game.Interactive = true;

 
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: Part of the script doesn't get executed - sometimes
« Reply #1 on: November 17, 2009, 01:19:00 PM »

Enable error logging in the compiled game, see if the log contains any errors.
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: Part of the script doesn't get executed - sometimes
« Reply #2 on: October 31, 2011, 04:34:22 PM »

I found out what this is.

Scene Nodes may not respond to anynode.Active=true or anynode.Interactive=true if they are sprite entities that either have no picture assigned to them, or they contain a transparency just as a graphic file (eg. a .PNG in 'Wintermute pink' 255/0/255). For a scene node to be both transparent and active, its transparent graphic should be loaded in the form of a sprite, with 'Pixel Precise' deselected.

Took me a while to figure that one out, but it makes sense, and this selectable pixel precision is just one more useful feature of this wonderful engine.  ::rock
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.044 seconds with 20 queries.