Jump to content

Moving items from inventory to a character


Ogislookin

Recommended Posts

You can accomplish this a few ways. One of my favorite ways is to define a command that works with the character and item. The Wherigo engine is supposed to take care of making sure you're in the same zone as the character. When you have both the item and character in the same zone, the command will work. Make sure you disable the command on the command's event so the character cannot be bribed again (or move the item to nil). If you want something cleaner, you could always enable the command when the player reaches the zone with the character (and, if you'd like, disable it when the player leaves the zone).

 

If you won't be dealing with people playing using a Garmin device, you could use the click event to determine if the item is in the player's inventory and display a message that looks like it's coming from the character. Some click events don't work with Garmin devices, so you might not want to go this route.

 

Another way is when the user enters or is in proximity to a zone. Test to see if the player has an item in his or her inventory. If so, show a dialog that asks if the player wishes to give the item to a character. Define the input, store the value in a variable, define an event on the OnGetInput event, test for the variable's value, and determine if the player decided to bribe the character.

 

If you have money in the game, store the quantity in a variable, do some math every time a bribe is given, and update the money object's description or name with the amount remaining (the variable's value).

 

I have attached a basic cartridge (unzip the file). It demos three ways to set up what you want: when the player enters a zone, a command defined on the item, and a command defined on the character.

 

In the end, it's up to you which approach fits your style.

Ogislookin.zip

Link to comment

It depends on, what you want to do with the item after you have removed it from the inventory.

 

1. You want, that the item vanishs. Than you should move it to nil.

2. You want, that the item still exists. Than you should move it to a zone.

3. You want, that the item change the character. Than you should make two characters, lets say "wizzard without hat" and "wizzard with hat", and, if you give the item to the character, set the first character to invisible, the second character to visible and the item is moved to nil.

 

In all cases, the function Move is what you are looking for.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...