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

Pages: 1 2 [All]

Author Topic: "I can't use these items together"  (Read 12995 times)

0 Members and 1 Guest are viewing this topic.

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
"I can't use these items together"
« on: May 25, 2009, 07:07:21 AM »

Can I get rid of this phrase when I try to use an inventory object on something it can't interact with?

"I can't use these objects together."

I don't see the script where this causes this to pop up. But I would like to get rid of it.  Thanks for any help.

Also I think I saw a post here by Mnemonic that you could show the number of a certain item in your inventory.  If that's possible, how would I do that?  I unfortunately can't find that post.
« Last Edit: May 25, 2009, 07:12:50 AM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: "I can't use these items together"
« Reply #1 on: May 25, 2009, 12:22:38 PM »

It's handled in game.script, in the on "LeftClick" handler.
Inventory items have .Amount and .DisplayAmount properties. Set DisplayAmont to true and Amount to some value and it will be displayed.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #2 on: May 25, 2009, 09:53:32 PM »

Thank you!  I got rid of the sentence "I can't use these things together."  ;)

But am a little stuck on where to put the .Amount and .Display Amount to get a display of the number of an item in inventory.  Does it go in the Items/items description?  On the script for the item?  I tried both and nothing happened. 
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: "I can't use these items together"
« Reply #3 on: May 26, 2009, 03:15:49 PM »

You need to do something like this:

Code: WME Script
  1. var SomeItem = Game.QueryItem("item name");
  2. SomeItem.Amount = 100;
  3.  

As for where... well it depends on when you want the amount to change.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #4 on: May 26, 2009, 04:10:22 PM »

Thanks.   :D    So I could, f.e., put it in dialogue where you trade one item for another and amount you have would show up and then after trade, new amount would show up?  I'll try this tonight.
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: "I can't use these items together"
« Reply #5 on: May 26, 2009, 05:21:14 PM »

Yes, exactly. However, remember you need to enable the amount display first; either by setting the DisplayAmount property to true, or directly in the items definition file (see the "money" item in WME demo for reference).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #6 on: May 26, 2009, 05:22:32 PM »

Thank you!  This solves a major problem.  :  )   ;D :D
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #7 on: May 27, 2009, 01:40:07 AM »

This works perfectly now but I have just two more questions about "money" as an inventory item. 

1) The font that shows up that I have 100 money is green, the system font, and tiny.  It's hard on older eyes.  Is there any way I can change the font and save old eyes? 

2)  How can I add or subtract from that amount via script?  I don't know how to access the money.AmountDisplay from items/items. 

Thanks, Mnemonic, you have a lot of patience.
« Last Edit: May 27, 2009, 04:17:29 AM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #8 on: May 27, 2009, 04:32:50 AM »

Solved how to add and subtract from the item amount:

var MoneyItem = Game.GetItem("konung");
MoneyItem.Amount = MoneyItem.Amount + 1;

[or -1 as the case may be]

But, dear Mnemonic, if you could help me save old eyes by being able to increase the size of the green system font there or substitute a different font, it would be much appreciated.  :  )   :D

« Last Edit: May 27, 2009, 06:47:30 AM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: "I can't use these items together"
« Reply #9 on: May 27, 2009, 07:15:32 AM »

Documentation is your friend. You must add a "FONT = ..." line to the definition of the item.
Working with the inventory
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #10 on: May 27, 2009, 04:03:18 PM »

Ah, yes, documentation.  :  )  Thanks, Mnemonic!  Now everything looks good.   :D
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #11 on: May 28, 2009, 01:32:33 AM »

Hey, Mnemonic, I'm sorry to have asked so many questions I could have solved by reading the documentation but I have been so wrapped up in trying to polish the game and you have been so kind to answer my questions, that I totally forgot about the documentation.  : )  Will try to look before I ask.  :  )
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #12 on: May 31, 2009, 04:48:11 AM »

I read the documentation and just want to check something.  :  )

If I put

CURSOR_COMBINED = FALSE

on items I want to use on one another, I can't use one on the other

only if I set it to true


If I put

CURSOR_COMBINED = FALSE

on items for example that I want to use as weapons, the normal cursor disappears and it looks like I'm using the weapon on whatever it strikes---this is great because that's what I was hoping to do.

So for items that you want to use to affect something else but not combine with something else you go FALSE.

But if you want to combine one item with another, you go TRUE?

I was just trying to get the effect with a weapon that the item when you strike the target doesn't appear to the right of the normal cursor---it is the cursor.  And that happens if I go FALSE.

Just checking.  :  )

Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: "I can't use these items together"
« Reply #13 on: June 01, 2009, 03:44:04 PM »

CURSOR_COMBINED = TRUE simply means that the mouse pointer displayed is the standard one (arrow etc.) combined with the item image (as opposed to displaying the item image only).
It has nothing to do with combining items together.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #14 on: June 01, 2009, 04:28:30 PM »

Thank you. Then the problem of not combining is something else---I'll recheck a few things. 
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #15 on: June 02, 2009, 06:02:52 AM »

For some reason if I set the combined cursor to false for one inventory object that can be combined with another inventory object to get a new inventory object, the inventory objects that are supposed to work on each other don't. 

If it's an inventory object working on an in-game object it's ok, everything works fine-- but not an inventory object working on another inventory object.  This is not a big deal, I'll work around it but I'd like to know why it's happening like this.  : )

That is, I'd like to know if I made a mistake somewhere or this is the way it's supposed to be.

My code on the objects looks fine and it's the same code that was there before I changed the combined cursor to false so I could just have the pic of the object and not the cursor with the object.
« Last Edit: June 02, 2009, 06:04:32 AM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: "I can't use these items together"
« Reply #16 on: June 03, 2009, 02:30:41 PM »

Using an inventory item on another item should definitely work. But it's hard to tell what you're doing wrong. It's handled in game.script in the LeftClick handler.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #17 on: June 03, 2009, 03:09:59 PM »

Thanks, I'll post the scripts tonight.  I think it's because the image (cursors) of both items used on each other would disappear before the new image (cursor) item is generated but not sure.

For example---and again I'll post the code later--am not at my computer:

You have a bar and a crow.  You can use the crow on the bar to make a crowbar.  Or use the bar on the crow to make a crowbar.  The pictures of the items are their cursor--not the ingame cursor.  When they should combine and both bar picture and crow picture go away to be replaced by picture of crowbar--nothing happens if and only if CURSOR_COMBINED = FALSE.  If CURSOR-COMBINED = TRUE, everything works as normal.
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #18 on: June 04, 2009, 01:04:50 AM »

Here's the code:

Code on gold bar

Code: WME Script
  1. #include "scripts\base.inc"
  2.  
  3. on "LeftClick"
  4. {
  5.     Game.SelectedItem = "bar";
  6. }
  7.  
  8.  
  9. on "crow"
  10. {   Game.TakeItem("crowbar");
  11.      Game.DeleteItem("crow");
  12.      Game.DeleteItem("bar");    
  13.         }
  14.  

Code on the crow

Code: WME Script
  1.  
  2. #include "scripts\base.inc"
  3.  
  4. on "LeftClick"
  5. {
  6.     Game.SelectedItem = "crow";
  7. }
  8.  
  9. on "bar"
  10. {   Game.TakeItem("crowbar");
  11.      Game.DeleteItem("bar");   
  12.      Game.DeleteItem("crow");
  13.  
  14. }
  15.  

Code on the crowbar

Code: WME Script
  1. #include "scripts\base.inc"
  2.  
  3. on "LeftClick"
  4. {
  5.     Game.SelectedItem = "crowbar";
  6. }
  7.  
  8.  


Items:
Code: WME Script
  1. ITEM
  2. {
  3.    CURSOR_COMBINED = FALSE;
  4.    CAPTION = "Crow"
  5.    NAME = "crow"
  6.    IMAGE = "scenes\House_Arrest2\Crow2.png"
  7.    CURSOR = "scenes\House_Arrest2\Crow2.png"
  8.    CURSOR_HOVER = "scenes\House_Arrest2\Crow2.png"
  9.    SCRIPT = "items\crow.script"
  10. }
  11.  

Code: WME Script
  1. ITEM
  2. {
  3.        CURSOR_COMBINED = FALSE;
  4.            CAPTION = "Bar"
  5.            NAME = "bar"
  6.            SPRITE = "scenes\House_Arrest2\Bar2.png"
  7.            CURSOR = "scenes\House_Arrest2\Bar2.png"
  8.            CURSOR_HOVER = "scenes\House_Arrest2\Bar2.png"
  9.            SCRIPT = "items\bar.script"
  10. }
  11.  
  12.  

Code: WME Script
  1. ITEM
  2. {
  3.        CURSOR_COMBINED = FALSE;
  4.            CAPTION = "Crowbar"
  5.            NAME = "crowbar"
  6.            SPRITE = "scenes\House_Arrest2\crowbar.png"
  7.            CURSOR = "scenes\House_Arrest2\crowbar.png"
  8.            CURSOR_HOVER = "scenes\House_Arrest2\crowbar.png"
  9.            SCRIPT = "items\crowbar.script"
  10. }
  11.  
  12.  
« Last Edit: June 04, 2009, 03:52:30 AM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #19 on: July 04, 2009, 05:26:24 AM »

I still have a problem here and it's really annoying a betatester who would not like the cursor to be visible with the object when you're using an inventory object on an object in the scene.  I've done this successfully with a different object in a different scenario in the scene so am not sure what's wrong here.  But it happens in other places, f.e. if I'm using an inventory object on another--I can't use combined equals false.  I'd really like to sort this out.

I have a little in game puzzle.  You apply a gem to an object in the scene.  This is the code for the object in the scene:

Code: WME Script
  1.  
  2. #include "scripts\base.inc"
  3.  
  4. global R;
  5. global G;
  6. global B;
  7. var EntGgem=Scene.GetNode("Ggem");
  8.  
  9. on "T2"
  10.  
  11. {
  12. if((R==1) && (G==null) && (B==null))
  13. {var x = hud.GetControl("loc")
  14. EntGgem.SetSprite("scenes\House_Arrest2\T2.png");
  15. x.Text = "Bling.";
  16. Sleep(350);
  17. G=1;
  18. Game.DropItem("T2");
  19. }
  20. else
  21. {if(R==null)
  22. {
  23. x.Text = "Oops.";
  24. Sleep(350);
  25. R=null;
  26. G=null;
  27. B=null;
  28. Game.TakeItem("T1");
  29. Game.TakeItem("T3");
  30. }
  31. }
  32. }
  33.  

This is the code for the item that interacts with that object in the scene.

Code: WME Script
  1.  
  2. #include "scripts\base.inc"
  3.  
  4. on "LeftClick"
  5. {
  6.     Game.SelectedItem = "T2";
  7. }
  8.  
  9.  

This is the code for the item T2:

Code: WME Script
  1.  
  2. ITEM
  3. {
  4.        CURSOR_COMBINED = TRUE
  5.            CAPTION = "Green Gem"
  6.            NAME = "T2"
  7.            SPRITE = "scenes\House_Arrest2\T2.png"
  8.            CURSOR = "scenes\House_Arrest2\T2h.png"
  9.            CURSOR_HOVER = "scenes\House_Arrest2\T2h.png"
  10.            SCRIPT = "items\T2.script"
  11. }
  12.  
  13.  

If I change the CURSOR COMBINED to FALSE, I cannot place the T2 item on the object in the scene where it's supposed to go but it would be more elegant to be able to do that.  What am I doing wrong?

Help!  Thanks as always. 
« Last Edit: July 04, 2009, 05:33:27 AM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: "I can't use these items together"
« Reply #20 on: July 04, 2009, 07:58:07 AM »

Sorry, but I still don't get what your problem is. CURSOR_COMBINED really only affects how the mouse pointer is painted. It does NOT affect function. You'd have to prove otherwise to me by providing some demo :)

Remember the hot spot placement for the sprite used for mouse pointer is important. You will want to move the hot spot to the point where the player expects the pointer to interact. If your pointer is an arrow, the hot spot should be at the point of the arrow. If your pointer is an hourglass, the shot spot should be in the middle of the hourglass, etc.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #21 on: July 05, 2009, 08:25:44 AM »

My cursor is an embellished circle and the hotspot is in the middle.

But I have a hover cursor--hotspot also in middle.

I am going to have a demo in the next day or so.  I am going to send that demo to BigFish Games.
I am sure they will come back with comments but I would like to anticipate and satisfy all their comments. [If we cannot satisfy all their comments we will just have to find a different market, but trying.  : )]

If it is OK with you, I would like to pm it to you.  If you have a chance to look at it, it would be very helpful.  Thanks, Mnemonic. 

Am still struggling with this.  I understand totally what you say, but using an object on another object in the scene is still random success.  It seems to work fine if the scene item is not a sprite area but is a region area.

Have conquered a number of things but this is still a brick wall for me.  : )  Trying!
« Last Edit: July 05, 2009, 09:00:05 AM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #22 on: July 06, 2009, 05:39:11 AM »

Still same problem.
« Last Edit: August 26, 2009, 09:55:22 PM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: "I can't use these items together"
« Reply #23 on: July 07, 2009, 09:29:52 AM »

Cool, I'll look into it.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: "I can't use these items together"
« Reply #24 on: July 07, 2009, 02:39:59 PM »

Thank you, Mnemonic!!!!  The doorknob works exactly as it should -- you don't see any cursor attached.  However, the colored triangles drag the cursor.  Am scrutinizing the script to see why there's a difference but just not seeing it.  The doorknob hovers over and interacts with a region entity. The colored triangles hover over a sprite entity but I changed that to region and still no good.  Thanks.  If you need any script please let me know.
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  
Pages: 1 2 [All]
 

Page created in 0.075 seconds with 24 queries.