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: How to make taken item blink in inventory  (Read 4143 times)

0 Members and 1 Guest are viewing this topic.

rkitting

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 44
    • View Profile
How to make taken item blink in inventory
« on: April 16, 2008, 09:22:55 AM »

Hello, I would like an item in a visible inventory blink for a few seconds after being taken. Using the this.Active attribute seems to only affect the item BEFORE it was taken.
How can I make an item in the inventory invisible then visible, then invisible etc.... 

Any suggestions would be greatly appreciated!

rkitting
« Last Edit: April 16, 2008, 10:06:13 AM by rkitting »
Logged

rkitting

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 44
    • View Profile
Re: How to make taken item blink in inventory
« Reply #1 on: April 16, 2008, 10:05:29 AM »

Ok, I think I solved it with the following code:

  for(var i=6; i>0; i=i-1)
  {
     Sleep(450);
   
     if (Game.IsItemTaken(this.Name))
     {
        Game.DropItem(this.Name);
        this.Active = false;
     }
     else
        Game.TakeItem(this.Name);
  }


Thx anyway :)
rkitting
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: How to make taken item blink in inventory
« Reply #2 on: April 16, 2008, 10:24:04 AM »

this is a huge overkill. You can change the AlphaColor for the item and you can even achieve fluent blinking.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

rkitting

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 44
    • View Profile
Re: How to make taken item blink in inventory
« Reply #3 on: April 16, 2008, 11:35:58 AM »

Overkill is right   :-\ I tried changing the AlphaColor, but it only works when the item is not yet taken.

rkitting
« Last Edit: April 16, 2008, 12:06:21 PM by rkitting »
Logged

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: How to make taken item blink in inventory
« Reply #4 on: April 16, 2008, 01:43:44 PM »

Could you do it by using a non-looping sprite as the inventory item, with two frames, one of which is blank, given say four instances each at a 400ms delay and ending with the item showing?
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: How to make taken item blink in inventory
« Reply #5 on: April 16, 2008, 03:09:37 PM »

originally I thought about something like this:

Code: [Select]
var it = Game.GetItem("Dagger");
var sp = it.GetSpriteObject();
        var frame = sp.GetFrame(0);

for (var a=0; a<255; a=a+10)
{
frame.AlphaColor = MakeRGBA(255,255,255,a);
Sleep(50);
}


But it doesn't work?? Try it and maybe Mnemonic would look into this himself.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

rkitting

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 44
    • View Profile
Re: How to make taken item blink in inventory
« Reply #6 on: April 16, 2008, 05:12:24 PM »

Not sure what I'm doing wrong, but the script above didn't work in the inventory, only outside of it (after commenting out the GetItem line).
Tried with both .png and single-framed .sprite.
Logged
 

Page created in 0.042 seconds with 21 queries.