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: item on inventory scrollbutton  (Read 3669 times)

0 Members and 1 Guest are viewing this topic.

Drax

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 78
  • This engine rocks!
    • View Profile
    • Ganja Joe - And the myth of the holy pot
item on inventory scrollbutton
« on: April 04, 2004, 09:23:44 AM »

Good morning wintermute forum.

A good sunday morning to code.  ;D

And at 10 a clock the first problem ???

I think the problem is not only relevant in my game.

I choose an Item in the Inventory and want to use it with an other Item in the Inventory which is not shown in the list, because I have to scroll. My cursor is now the selected Item. If I klick now on the scrollbutton, my actor always say the standart sentence "I can't use this together" (I don't know if the sentence is correct in english). The scrolling works fine.

Now there are 2 possibilities:

1.I can turn the Talk routine for the buttons off. But How?

2.I can define for every Item an 'on "ITEM"' for the button. But I don't no where, because a button has no Button.script and the inventory functions are not detectale.

(I'm shure there's a nother solution anyway ;))

DraX  
Logged
I'm Lost!

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:item on inventory scrollbutton
« Reply #1 on: April 04, 2004, 09:49:05 AM »

1.I can turn the Talk routine for the buttons off. But How?

If you used the default scripts to build your game, open the "game.script" and find the part with the "I can't use..." message. Modify the last line to something like:

      var Item = Game.SelectedItem;
      if(ActObj.CanHandleEvent(Item.Name)) ActObj.ApplyEvent(Item.Name);
      else if(Item.CanHandleEvent("default-use")) Item.ApplyEvent("default-use");
      else if(ActObj.CanHandleEvent("default-use")) ActObj.ApplyEvent("default-use");
      else if(ActObj.Type!="window" && ActObj.Type!="button") actor.Talk("I can't use these things together.");
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Drax

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 78
  • This engine rocks!
    • View Profile
    • Ganja Joe - And the myth of the holy pot
Re:item on inventory scrollbutton
« Reply #2 on: April 04, 2004, 10:49:46 AM »

thx. now it works.

(I don't know the ActObj referenz before.)
Logged
I'm Lost!
 

Page created in 0.048 seconds with 23 queries.