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: How to change mouse cursor when selecting item from inventory?  (Read 3545 times)

0 Members and 1 Guest are viewing this topic.

Eyes_Only

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
    • View Profile

Hi guys,

I'm new to WME and at the moment I'm trying various things. I have got a "keycard" object and after picking it up a "keycard" item. When I hover over the item in the inventory, the mouse cursor changes shape. That works nice. But I would like to change the cursor when I choose the item from the inventory but that doesn't work because the engine always shows the standard cursor. What can I do?

Here's my keycard script:
Code: [Select]
#include "scripts\base.inc"


////////////////////////////////////////////////////////////////////////////////

on "MouseEntry"
{
this.SetCursor ("Medien\cursor_nina\cursor_full.png");
}

on "LeftClick"
{
Game.SelectedItem = "keycard";
this.SetCursor ("Medien\cursor_nina\cursor_back.png"); --> this is the part, that doesn't do what I want
}

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

Thank you very much
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How to change mouse cursor when selecting item from inventory?
« Reply #1 on: April 14, 2009, 03:39:53 PM »

Judging by the other thread, I suppose you already solved it? You define the cursor appearance in the items definition file.
Or do I understand it wrong?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Eyes_Only

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
    • View Profile
Re: How to change mouse cursor when selecting item from inventory?
« Reply #2 on: April 14, 2009, 05:15:16 PM »

Hi Mnemonic,

no, I haven't solved it yet. In the other post you said:
Quote
You can change the standard cursor by using Game.SetCursor() and Game.SetActiveCursor(). However, individual game objects can define their own cursors. If you want to change it no matter what, perhaps it would be better NOT to use cursor_combined.

The problem is, that when I do NOT use cursor_combined I have only the item on the screen but I want the cursor combined with the item.

Quote
Or do I understand it wrong?

Yes. I know that I can change the appearance in the items definition file. But there I couldn't define the appearance of the mouse cursor.

In my Script of the keycard item I have written:
Code: [Select]
on "LeftClick"
{
Game.SelectedItem = "keycard";
Game.SetCursor ("Medien\cursor_nina\cursor_back.sprite");
}

But the cursor doesn't change when I click the keycard in the inventory. There is always the standard cursor. Is it possible that this command doesn't work in an item script?
When I want to use the item in combination with the cursor, I guess I have to use the cursor_combined command. Or is there another way to realize that?

Thank you
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How to change mouse cursor when selecting item from inventory?
« Reply #3 on: April 14, 2009, 05:23:00 PM »

Well my idea was you would not use cursor_combined, but rather you'd paint an image of the item + the changed cursor and set this image in items definition file.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Eyes_Only

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 18
    • View Profile
Re: How to change mouse cursor when selecting item from inventory?
« Reply #4 on: April 15, 2009, 09:16:14 AM »

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

Logged
 

Page created in 0.034 seconds with 20 queries.