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

Pages: 1 [2]  All

Author Topic: Fading in/out the inventory window  (Read 14931 times)

0 Members and 1 Guest are viewing this topic.

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Fading in/out the inventory window
« Reply #15 on: January 13, 2006, 10:22:29 AM »

I am having trouble with this, I have used the scripts listed but the inventory does not show at all now.


I have connected it to my INVENTORY window script.

Updated Game Deamon but still nothing.


Any help or full scripts would be good, save my hair being pulled out. hahahahahahaha


Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

TheDerman

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 225
    • View Profile
Re: Fading in/out the inventory window
« Reply #16 on: January 13, 2006, 02:37:17 PM »

These are the scripts I have:


inventory.script:

Code: [Select]
#include "scripts\base.inc"

global Faded;

method FadeIn()
{
 Game.InventoryVisible = true;
 for(var i=1; i<=10; i=i+1)
   {
    this.AlphaColor = MakeRGBA(255, 255, 255, 25*i);
    Sleep(40);
   }
 this.AlphaColor = MakeRGBA(255, 255, 255, 255);
 Faded = true;
}

method FadeOut()
{
  for(var i=10; i>=1; i=i-1)
   {
    this.AlphaColor = MakeRGBA(255, 255, 255, 25*i);
    Sleep(40);
   }
 this.AlphaColor = MakeRGBA(255, 255, 255, 0);
 Game.InventoryVisible = false;
 Faded = false;
}


And the relevant section of the game_daemon.script:

Code: [Select]
  // display the inventory window
  var InvWindow = Game.GetInventoryWindow();
  if(Game.Interactive && Game.MouseY > 704 && !Game.ResponsesVisible && !WinMenu.Visible && Faded==false)
   {
     InvWindow.FadeIn();
   }

  else if(Game.MouseY < 704 && Faded==true)
   {
     InvWindow.FadeOut();
   }

Hope that helps.
« Last Edit: January 13, 2006, 02:49:11 PM by TheDerman »
Logged

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Fading in/out the inventory window
« Reply #17 on: January 13, 2006, 03:41:30 PM »

Many thanks TheDerman.

In the game deamon scripts does this new code replace the old (unchanged demo script) or does it need to be added with the old code??


Cheers
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

TheDerman

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 225
    • View Profile
Re: Fading in/out the inventory window
« Reply #18 on: January 13, 2006, 03:49:02 PM »

It replaces only the part of the daemon script which deals with the inventory (down at the bottom) - everything else should be left as it is.

You will have to change certain things specific to your game, like the Y value - my inventory is at the bottom of the screen - you may have yours at the top or somewhere else.
Logged

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Fading in/out the inventory window
« Reply #19 on: January 13, 2006, 03:51:26 PM »

ok many thanks, will give it a bash and let you know.


Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Fading in/out the inventory window
« Reply #20 on: January 14, 2006, 01:46:52 PM »

Hi,
     I have tried to implement these scripts but my inventory does not show.

I have attached the inventory fade script to my inventory window and changed Game Deamon script but still no inventory is showing.

TheDerman can you show me your full Game Deamon script on this thread as I think that is the issue here.


Cheers
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

PoselSmrti

  • Guest
Re: Fading in/out the inventory window
« Reply #21 on: January 14, 2006, 04:32:46 PM »

Hi SBOVIS :)!

Did you create a global Faded = false; in your game_daemon.script?
« Last Edit: January 14, 2006, 04:36:02 PM by PoselSmrti »
Logged

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Fading in/out the inventory window
« Reply #22 on: January 15, 2006, 12:35:39 AM »

Certainly did, still no show on my inventory though, If I take the fade code out and reset it back the way it was, I get the inventory no problem. (just not fadeing)




Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

TheDerman

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 225
    • View Profile
Re: Fading in/out the inventory window
« Reply #23 on: January 15, 2006, 09:32:29 AM »

Maybe if you post your inventory script and daemon script, we could spot the problem?

Did you insert SCRIPT = "interface\inventory.script" into your inventory.def in the WINDOW section of the file?
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Fading in/out the inventory window
« Reply #24 on: January 15, 2006, 10:15:25 AM »

Also please check your wme.log for error messages. You'll usually find some clues as why it doesn't work there. If there is something written what looks like an error, post it together with requested files too. ;)
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Fading in/out the inventory window
« Reply #25 on: January 15, 2006, 03:04:50 PM »

ok will check and post files if needed.


many thanks



cheers
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Fading in/out the inventory window
« Reply #26 on: January 16, 2006, 01:43:20 PM »

Got this to work now, many thanks, looks great,

It was the Game.Deamon script as I have other code that conflicted with it.


By the way can this fade method be used for any windows??

I have several that would work well when faded, I have defined windows so do I do a similar script and attach it and call that within other scripts when I want it to fade??


Seems feasible??

Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Fading in/out the inventory window
« Reply #27 on: January 16, 2006, 01:44:55 PM »

yes, you can definitely use it for any window you like.

Glad it works for you now.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

djb

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 28
  • ... dream journey beyond ...
    • View Profile
    • DreamJourneyBeyond.com
Re: Fading in/out the inventory window
« Reply #28 on: January 16, 2006, 03:57:00 PM »

i think, that you can optimize it and skip needlessly tests in game_daemon.script...

inventory.script:
Code: [Select]
#include "scripts\base.inc"

global Faded;

method FadeIn()
{
 if(!Faded) {
  Game.InventoryVisible = true;
  for(var i = 0; i <= 255; i = i + 25) {
    this.AlphaColor = MakeRGBA(255, 255, 255, i);
    Sleep(40);
   }
   this.AlphaColor = MakeRGBA(255, 255, 255, 255);
   Faded = true;
 }
}

method FadeOut()
{
 if(Faded) {
  for(var i = 255; i >= 0; i = i - 25) {
   this.AlphaColor = MakeRGBA(255, 255, 255, i);
   Sleep(40);
  }
  this.AlphaColor = MakeRGBA(255, 255, 255, 0);
  Game.InventoryVisible = false;
  Faded = false;
 }
}
« Last Edit: January 16, 2006, 04:04:57 PM by djb »
Logged

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Fading in/out the inventory window
« Reply #29 on: January 16, 2006, 04:32:33 PM »

This is cool, I now have an inventory and other windows fadeing in and out, many thanks.
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS
Pages: 1 [2]  All
 

Page created in 0.023 seconds with 21 queries.