Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Flashlight script issue  (Read 2734 times)

0 Members and 1 Guest are viewing this topic.

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Flashlight script issue
« on: May 19, 2007, 03:14:24 AM »

I have this peculiar problem when using the (magnificent) flashlight script by Mnemonic. The player is supposed to light up a room by holding a bicycle lamp. The lamp is in the inventory, and is dragged to a large hotspot in an almost black screen. The flashlight script is activated and up comes the light beam. So far no problems. Then something happens which I didn't anticipate. Since the lamp item was used to bring up the scene where the script is used, the icon for the lamp stays in the middle of the light beam (until the player right clicks, off course). The scene contains an item that can be picked up, and has a hand icon attached to it. Assuming that the player doesn't think of right clicking to get rid of the lamp icon, the hand icon is never revealed.

Is there any way to make the lamp icon go away (to be "released") as soon as it is used in the scene?

Making a transparent icon for the lamp doesn't help, since that doesn't reveal the hand icon either.

If there isn't any workaround for this, I will try a different approach, like letting the game itself activate the lamp as soon as it is held, so the player doesn't have to drag it. However, I'm not really pleased with that compromise, so I thought I'd turn here for advice first.

Thanks in advance!

Mikael
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Flashlight script issue
« Reply #1 on: May 19, 2007, 09:10:53 AM »

Is there any way to make the lamp icon go away (to be "released") as soon as it is used in the scene?
Sure, you can deactivate any selected inventory item by setting Game.SelectedItem = null;
So your lamp code would look like this:

Code: [Select]
on "lamp"
{
  // light the flashlight
  // ...

  Game.SelectedItem = null;
}
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Re: Flashlight script issue
« Reply #2 on: May 19, 2007, 10:18:24 AM »

I'm stupid. But the scene looks fine now, and that's what matters.

Thanks!

Mikael
Logged
 

Page created in 0.033 seconds with 20 queries.