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 - Eyes_Only

Pages: [1] 2
1
Technical forum / Re: WME resets door state
« on: June 28, 2009, 01:35:55 PM »
I solved it -  :D :D :D - Jippiiiiiiiii

in my scene_init script I wrote:

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

// here comes the stuff which initializes the scene

actor.SkipTo(461, 566);
actor.Direction = DI_DOWNRIGHT;
actor.Active = true;


////////////////////////////////////////////////////////////////////////////////
// scene state
global StateFionas_Zimmer;


// default values
if(StateFionas_Zimmer==null)
{
  StateFionas_Zimmer.Visited = false;
  // add scene states here
  StateFionas_Zimmer.dooropen = false;
}



////////////////////////////////////////////////////////////////////////////////
// setup scene according to state variables
if(StateFionas_Zimmer.dooropen) // If the door is opened
{
var doorclosed = Scene.GetNode ("fiona_door_closed");
var dooropen = Scene.GetNode ("fiona_door_open");
var flur = Scene.GetNode ("fiona_flur");

doorclosed.Active = false;
dooropen.Active = true;
flur.Active = true;
}
else // If the door is closed
{
doorclosed.Active = true;
dooropen.Active = false;
flur.Active = false;
}

////////////////////////////////////////////////////////////////////////////////
if(!StateFionas_Zimmer.Visited)
{
  StateFionas_Zimmer.Visited = true;

  // this is our first visit in this scene...
}

And then when opening or closing the door, I changed the StateFionas_Zimmer value to true or false and now it works.

It's a bit different from what HelLRaiseR posted, but the idea is the same, thanks alot...

2
Technical forum / Re: WME resets door state
« on: June 28, 2009, 12:55:24 PM »
for the door I have a closed (door_closed) and an open (door_open) sprite and when opening (door_opening) or closing (door_closing) there is for each playing an animation containig 10 sprites. so for the closed door I have for example:

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

var dooropen = Scene.GetNode ("fiona_door_open");
var doorclosed = Scene.GetNode ("fiona_door_closed");
var dooropenblocked = Scene.GetNode ("blocked_door_open");
var dooropening = Scene.GetNode ("fiona_door_opening");
var flur = Scene.GetNode ("fiona_flur");

on "LeftClick"
{
actor.GoToObject (this);
Game.Interactive = false;
actor.Talk ("Ich öffne sie mal.");
doorclosed.Active = false;
dooropening.Active = true;
var sprite = dooropening.GetSpriteObject();
while (!sprite.Finished) Sleep(1);
sprite.Reset ();
dooropening.Active =false;
dooropen.Active = true;
dooropenblocked.Active = true;
flur.Active = true;
Game.Interactive = true;
}

And the same for the open door. But the strange thing is, that wme reminds the status of the second room. That is, when I enter the second room again, the door is still open.

I tried what HelLRaiseR posted first, but while having 4 different entities for the door, the whole thing was (for me) to difficult to code. Has perhaps anyone an example how I can do this with globals?

Thanks a lot...

3
Technical forum / Re: WME resets door state
« on: June 27, 2009, 02:01:45 PM »
Thanks for your reply, but it doesn't work. I also tried another method. In room2 after opening the door, there is a corridor entity which I can click on, to change to room1 so in the corridor script I wrote:

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

var room1_door = Scene.GetNode ("scenes\room1\room1.scene\room1_door_closed");

on "LeftClick"
{
  actor.GoToObject(this);
  room1_door.Active = false; 
  Game.ChangeScene ("scenes\room1\room1.scene");
}

But the crazy thing is, that when I enter room1, the door ist still there... How can this be???

Thanks...

4
Technical forum / WME resets door state
« on: June 26, 2009, 02:28:23 PM »
Hello everybody,

I have two rooms. When I want to walk from room1 to room2 I have to open the door from room1 and when I click, I can change scene. Now I am in room2. But when I go back from room2 to room1 and the scene is loaded, the room1 door is closed.

I tried to change the starting order so that I start with room2 and then go to room1 and there it's the same, when returnig a second time to the room the room1 door is set back to closed, while room2 door stays open.

How can this be? Has anyone an idea?

Thank you...

5
Thank you very much... ::thumbup

6
Hi guys,

does anyone have the metro.zip file from this post?

http://forum.dead-code.org/index.php?topic=1821.0


If so, I 'd like to ask you to send it to me please.

eyes--only@web.de

Thanks a lot

7
Technical forum / Re: on "MouseEntry" and if-command
« on: April 16, 2009, 10:02:25 PM »
Thank you,

I thought that I could then add the amount of wanted objects in the game.script. A lot of work but it should work.
But I will keep in mind what you said.

Thanks a lot

8
Technical forum / Re: on "MouseEntry" and if-command
« on: April 16, 2009, 08:37:45 PM »
I solved it. Great. Juhuuuu!!!  ;D ;D ;D ;D ;D ;D

in game.script I added:

Code: [Select]
on "RightClick"
{
var ActObj = Game.ActiveObject;
var EntTable = Scene.GetNode ("table"); <-- this here
  // if inventory item selected? deselect it
  if (Game.SelectedItem != null)
  {
    Game.SelectedItem = null;
EntTable.ApplyEvent ("item-deselected"); <-- and this here
return;

  }

And now it works fine - for so far.

I also testet your  method mnemonic and with this, it only worked, when I was deselecting the item ON the table.

Anyway. Many many thanks mnemonic for your work. Very nice support within the forum. If you perhaps have another idea (for example with the ActObj variable) I'm also willing to know. But thanks a lot.  ::thumbup


9
Technical forum / Re: on "MouseEntry" and if-command
« on: April 16, 2009, 08:22:37 PM »
Thank for yout post.

Quote
In the Tools menu, there is an invaluable command called 'Compile', which checks your script for syntax errors (Ctrl+F7). If you use this command, you'll get:
Quote from: SciTE
game.script(91) : Duplicate declaration of variable 'ActObj'

That's what I also found out.
Therefore I did something like this:

Code: [Select]
// if inventory item selected? deselect it
if (Game.SelectedItem != null){   
Game.SelectedItem = null;   
var ActObj = Game.ActiveObject; 
if(ActObj != null) ActObj.ApplyEvent("item-deselected");   
return;     


//var ActObj = Game.ActiveObject;

// is the righ-click menu visible? hide it
if(WinMenu.Visible == true) WinMenu.Visible = false;
else if(ActObj!=null)
{


I put the second var ... as comment.
Ok, so far. Now the bad news: Also your new posted script doesn't work. Still the same changed cursor. And no standard one. I want to use a mouse control as it is used in "The Art of murder" which is, I know, made with WME. Perhaps you know how they realized it?

10
Technical forum / Re: on "MouseEntry" and if-command
« on: April 16, 2009, 07:08:55 PM »
Hmm, that doesn't work:

In game.script I added:

Code: [Select]
on "RightClick"
{
  // if inventory item selected? deselect it
  if (Game.SelectedItem != null)
  {
    Game.SelectedItem = null;
    return;
  }

  var ActObj = Game.ActiveObject;
  if(ActObj != null) ActObj.ApplyEvent("item-deselected");

With this it's the same like before. The cursor is still the changed one.

When I write:

Code: [Select]
on "RightClick"
{
  // if inventory item selected? deselect it
  if (Game.SelectedItem != null)
  {
    Game.SelectedItem = null;
    return;
    var ActObj = Game.ActiveObject;
    if(ActObj != null) ActObj.ApplyEvent("item-deselected");
  }

or:
Code: [Select]
on "RightClick"
{
  // if inventory item selected? deselect it
  if (Game.SelectedItem != null)
  {
    Game.SelectedItem = null;
    var ActObj = Game.ActiveObject;
    if(ActObj != null) ActObj.ApplyEvent("item-deselected");
    return;
  }
 
then the rightclick event doesn't work anymore. Neither the mouse menu nor the righclick events in the object scripts.
 

11
Technical forum / Re: on "MouseEntry" and if-command
« on: April 15, 2009, 10:05:58 PM »
Great, the code worked fine. But there is one problem left, when I click the right mouse button, the item is deselected and put back in the inventory. Because of game.script:

Code: [Select]
on "RightClick"
{
  // if inventory item selected? deselect it
  if (Game.SelectedItem != null)
  {
    Game.SelectedItem = null;
    return;
  }

But when I then hover the table with the cursor, it although shows me the changed cursor (and not the standard one) but not the Game.Msg () command. Do I have to deselect the item someway?

12
Technical forum / Re: on "MouseEntry" and if-command
« on: April 15, 2009, 09:58:12 PM »
Ok I will try that. The engine reports [item] because in game.script there is defined:
Code: [Select]
var Item = Game.SelectedItem; right?



13
Technical forum / Re: on "MouseEntry" and if-command
« on: April 15, 2009, 09:39:58 PM »
Hi,

nothing happens. It seems to me as if the engine doensn't execute the if-command, because when putting the cursor with the selected item over the table, nothing happens.

I tried something: When I write: if (Game.SelectedItem =="[item]") it's ok and the cursor changes. How can this be???


14
Technical forum / on "MouseEntry" and if-command
« on: April 15, 2009, 09:11:05 PM »
Hi guys,

I've got a new Problem. I've got a table. In it's script I wrote:

Code: [Select]
on "MouseEntry"
{
if (Game.SelectedItem =="keycard")
{
Game.Msg("mouse entry");
this.SetCursor ("sprites\system\cursor_interact.sprite");
}
}

In my keycard item script I wrote:

Code: [Select]
on "MouseEntry"
{
this.SetCursor ("Medien\cursor_nina\cursor_full.png");
}

on "LeftClick"
{
Game.SelectedItem = "keycard";
}

on "RightClick"
{
actor.Talk ("Das ist eine Schlüsselkarte.");
}

But when I put the mouse onto the table, the cursor doesn't change. You know any help? If I remove the if-command everything worls fine. Can it be that the engine doesn't get the Game.SelectedItem command?

15
Hm, yes, I already thought about that. But then I guess I will get a further problem because I would like to change the cursor (with the selected item) when I hover an object wich the selected item can "interact" with. It's the method use in "Secret Files: Tunguska" and "Secret Files 2: Puritas Cordis". You know these two games? There the cursor changes depending on the options, the selected item can have with the objects in the room. Ok. If there isn't a way to change the cursor by a command in the script, I think I must use another method...


Pages: [1] 2

Page created in 0.101 seconds with 23 queries.