Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: left click pick up item  (Read 3125 times)

0 Members and 1 Guest are viewing this topic.

sunrosea

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
left click pick up item
« on: September 06, 2012, 01:50:31 PM »

Hi!

I've tried to figure out how to make it so when you left click an item, the character will pick it up, instead of right click
and then choose to pick it up.
Basically, I'd like my character to pick up item when left click, and "look at" item when right click without the "menu" popping up. The right click will therefore make her only speak about the item.
Could someone tell me which files I should edit and what i should write to make that work?

Also Im having problems with making the object(an apple) appear in the inventory with the right-click menu thing, even tho i followed the steps in the manual.
When I choose to pick it up, it doesn't disappear from its position nor appearing in the inventory.
here's what i got so far:
the apple.script
Code: [Select]
#include "scripts\base.inc"


////////////////////////////////////////////////////////////////////////////////
on "LookAt"
{
  actor.Talk("Looks like an apple....");
}

////////////////////////////////////////////////////////////////////////////////
on "Take"
{
  actor.Talk("It could be useful, I might get hungry.");
  Game.TakeItem("apple");
 
  Game.SelectedItem = "apple";
}


The items.item file:
Code: [Select]
ITEM
{
   CURSOR_COMBINED = TRUE
   CAPTION = "WME User's Guide"
   NAME = "book"
   IMAGE = "items\book.bmp"
   CURSOR = "items\book.bmp"
   CURSOR_HOVER = "items\book_h.bmp"
   SCRIPT = "items\book.script"
}
ITEM
{
   CURSOR_COMBINED = TRUE
   CAPTION = "apple"
   NAME = "apple"
   IMAGE = "items\apple.png"
   CURSOR = "items\apple.png"
   CURSOR_HOVER = "items\apple.png"
   SCRIPT = "items\apple.script"
}

 i also added the apple.script file to the sceneEdit, by clicking on the apple entity and then adding the script file.
Also added "apple" to the "item" text box and saved it.

have I missed something?
« Last Edit: September 06, 2012, 02:06:48 PM by sunrosea »
Logged

ciberspace

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 116
    • View Profile
    • Tele Juego
Re: left click pick up item
« Reply #1 on: September 06, 2012, 04:54:20 PM »

When I choose to pick it up, it doesn't disappear from its position nor appearing in the inventory.
here's what i got so far:
the apple.script
Quote
// hide the apple entity and place "apple" item into the inventory
  Game.TakeItem("apple");
  var Entapple = Scene.GetNode("apple");  //Entity properties Name ("apple") //
  Entapple.Active = false;

sunrosea

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
Re: left click pick up item
« Reply #2 on: September 07, 2012, 08:54:56 AM »

Thank you for the suggestion. :) This did not work tho. I have been working further with the scripts but have not been able to make the item disappear from the ground. What happens when i click "take" it only puts the apple on my cursor, and so theres an apple following my cursor, and an apple lying on the ground.
Nothing in the inventory. Do I have to adjust the inventory files?
 
Logged

sunrosea

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
    • View Profile
Re: left click pick up item
« Reply #3 on: September 07, 2012, 09:04:30 AM »

well i noticed a problem. When i save the changes to the apple.script file it does not update.  ???
Anyone know why? I open the file i WME and edit it and then save. But it doesn't seem to register it.

EDIT: I had to press "save as" instead of just save, weirdly enough. But yeah, its working fine now. Thanks for the help. :)
« Last Edit: September 07, 2012, 09:07:36 AM by sunrosea »
Logged
 

Page created in 0.037 seconds with 24 queries.