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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Mikael

Pages: 1 ... 5 6 [7] 8 9
91
Technical forum / Problems with disabling the inventory
« on: June 29, 2007, 04:46:43 PM »
I have this little problem that I hope that someone can help me with. Try to follow me here:

To be able to disable the inventory in certain scenes I have done the following:

Changed the line in the data/scripts/game_daemon.script file which reads

Code: [Select]
if(Game.Interactive && Game.MouseY < 45 &&! Game.ResponsesVisible &&! WinMenu.Visible) Game.InventoryVisible = true;
to

Code: [Select]
if(Game.Interactive && Game.MouseY < 45 &&! Game.ResponsesVisible &&! WinMenu.Visible && InventoryActive) Game.InventoryVisible = true;
Added the line

Code: [Select]
global InventoryActive;
in data/scripts/base.inc.

Added the line

Code: [Select]
InventoryActive = true;
in data/scripts/game.script.

I then enabled/disabled the inventory by setting the global variable InventoryActive in the scene_init.script files.

So far so good. Then, in order to make the inventory slide down when an item is picked up, I added the following piece of code to game.script.

Code: [Select]
method TakeItem(var ItemName)
{
// call the original method we have just overriden
this.TakeItem(ItemName);

global InventoryHint = true;
Sleep(1000);
InventoryHint = false;
}

And modified the inventory-showing condition in game_daemon.script to:

Code: [Select]
global InventoryHint;
if(InventoryHint;
(Game.Interactive && Game.MouseY < 45 && !Game.ResponsesVisible && !WinMenu.Visible))

The inventory slides down when an item is picked up now, BUT it overrides the enable/disable inventory settings. Is there a way around this?

Thanks in advance!

92
Technical forum / Re: Flashlight script issue
« on: May 19, 2007, 10:18:24 AM »
I'm stupid. But the scene looks fine now, and that's what matters.

Thanks!

Mikael

93
Technical forum / 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

94
Technical forum / Re: Warning message question
« on: April 28, 2007, 09:46:57 AM »
I moved both declarations outside of the "if" block, and the log stopped bugging me. Thanks! I would never have figured that out for myself.

Mikael

95
Technical forum / Warning message question
« on: April 28, 2007, 02:50:59 AM »
I'm trying out a script that makes entities appear and disappear depending on the positions of switches. Everything works exactly as planned, except that I get this error log message: "Warning: variable 'ent_handle_2_down' is inaccessible in the current block. Consider changing the script."

I've tried the scene back and forth, and it no doubt works perfectly, despite the message. I can not see how I could mess around with the "inaccessible" variable without causing major dysfunction.

The code looks like this (it's probably idiotic):

Code: [Select]
global handles_down;

on "LeftClick"

{
  if(handles_down==1)
  {
  global handle_2_down = 1;
  var ent_handle_2_down = Scene.GetNode("handle_2_down");
  if(handle_2_down==1) ent_handle_2_down.Active = true;
  handles_down = 2;
  }
  else
  {
  handle_2_down = 1;
  ent_handle_2_down = Scene.GetNode("handle_2_down");
  if(handle_2_down==1) ent_handle_2_down.Active = true;
  handles_down = 0;
}}

The warning refers to the 3rd line from the bottom.

Thanks,

Mikael

96
Technical forum / Re: Subtitles disappearing when changing scenes
« on: April 27, 2007, 06:21:21 PM »
Thanks. The Derman, I had actually been thinking about something like that. Weather it's strange or not depends on the situation, I guess.

Mikael

97
Technical forum / Subtitles disappearing when changing scenes
« on: April 26, 2007, 02:18:59 PM »
I have this (slight) problem with subtitles. When a subtitle is displayed upon using the Talk command, it is interrupted as soon as another scene is loaded. So let's say that I have a closeup scene of something. I look at something in the closeup, which triggers a comment, with its subtitle. I have set the subtitle to be displayed for 3 seconds. However, if I get out of the closeup scene 1 second after the subtitle line is triggered, the subtitle will disappear. This is no biggie, but I was wondering if there is any way around it?

Thanks!

Mikael

98
Technical forum / Re: Inventory sliding down
« on: April 22, 2007, 10:54:37 AM »
Wow, that was elegant.

I did try to search the forum for an answer, but it's sometime hard to know which key phrases to use.

Thanks a lot.

Mikael

99
Technical forum / Inventory sliding down
« on: April 22, 2007, 02:56:04 AM »
This is not really that important, but I think it would be a nice touch to let the inventory slide down for a second or two when an object is added to it. Is there any way to implement this without much hassle to it?

Thanks,

Mikael

100
Technical forum / Re: Bringing up the menu with right click
« on: April 21, 2007, 01:08:56 AM »
Thanks!

Mikael

101
Technical forum / Bringing up the menu with right click
« on: April 20, 2007, 07:06:47 PM »
I've tried to modify game.script in the WME Demo to make a simple right click on an "inactive" area bring up the main menu. I know that this should be simple, but for some reason, I haven't succeed.

Thanks for any help!

Mikael

102
Technical forum / Re: Compiled game questions
« on: April 10, 2007, 09:01:10 PM »
Quote
You can add your own icon under "project settings" - just check the "change icon to" and then browse to your icon file.

I'm almost embarrassed to have missed such a thing. Thanks a lot!

And The Derman, that was exactly what i meant! Thanks.

Regards,

Mikael

103
Technical forum / Compiled game questions
« on: April 10, 2007, 07:33:03 PM »
I seem to remember that there is some kind of debug log for games that have been test run from the compiled .exe file. Is this something I have dreamt?

And while I'm at the topic: Is there some easy way to change the icon for the compiled .exe file? The (otherwise excellent) installer that I use snatches the Wintermute icon for the install file, and off course, I'd like to use my own.

Thanks!

Mikael

104
Technical forum / Re: Custom menu screen problems
« on: April 08, 2007, 03:25:15 PM »
Oh, thanks. Now it works fine.

Mikael

105
Technical forum / Custom menu screen problems
« on: April 08, 2007, 03:04:22 PM »
Again, I feel quite stupid. However, it's clear that I am not the only one having this problem, which gives me the courage to ask.

I want to bring up a custom menu screen when the escape key is pressed. I've borrowed a code snippet from the Mystic Triddle demo (see below).

When I paste the code into the game script everything works PERFECTLY FINE, except that when I am in the menu scene, and press escape again, it reloads the menu scene, instead of resuming the game. What makes this especially annoying is that when the menu scene has been reloaded, "Resume game" does not work, since it goes back to the previous scene, in this case the previous occurence of the menu scene.

In the Mystic Triddle demo, pressing escape when in the menu resumes game, BUT, in the Beyond the Threshold demo, in which the same method is used, the exact same problem occurs, that is when pressing escape in the menu, the menu reloads, and the game can't be resumed after that.

This is the code I've used:

Code: [Select]
////////////////////////////////////////////////////////////////////////////////
on "Keypress"
{
  // on Esc or F1 key
  if(Keyboard.KeyCode==VK_ESCAPE || Keyboard.KeyCode==VK_F1)
  {

  if(Scene.name == "menu")
  {
     if(Game.PrevSceneFilename == "")
      ;
     else
      {
  Game.ChangeScene(Game.PrevSceneFilename); // Go back to game - acts like resume game
  }
  }
  else
  {
  if(Game.SelectedItem!=null) // deselect Items if active
  Game.SelectedItem = null;
 
  //Game.ScreenshotEx("saves\temp.bmp",200,150);   // when we want to store a screenshot manually
  Game.ChangeScene("scenes\menu\menu.scene");      // load and display the main menu window
  }
   
  }
}

Thanks for any help!

Regards,

Mikael

Pages: 1 ... 5 6 [7] 8 9

Page created in 0.038 seconds with 23 queries.