Author Topic: Dysable use item  (Read 1422 times)

0 Members and 1 Guest are viewing this topic.

michael95

  • Tier 3
  • *
  • Posts: 70
  • Current Mood: happy happy
Dysable use item
« on: August 26, 2011, 09:17:50 AM »
 have when actor use item, he learn some skill, but must be on level 1 or higher (this is test i se in future level 5)
The item is not consumable, so I want when the skill is already this character learned (I have skill shop) disable use this item for this character, but stay enebled for others. How to do?
Here is picture for better understanding.


Ruben

  • ~True Remembrance~
  • Mod-Suspect
  • Tier 7
  • *
  • Posts: 2115
  • Gender: Male
  • :)
  • Current Mood: happy happy
Re: Dysable use item
« Reply #1 on: August 26, 2011, 01:28:05 PM »
Instead of disabling the usage of this item, you could disable the Commen Even by inserting another Conditional Branch.

Conditional Branch → Page 2 → Actor (Choose Actor) → Skill → (Choose Skill).

Example: See attachment.

Disabling an item is not really hard, though. You could either check if the actor has learned the skill and then delete the item from your inventory and replace it with another item that has the same name but cannot be used. The more elegant way is to use RGSS (via the Script... command):

Code: [Select]
$data_items[1].occasion = 3
Short explanation: $data_items contains all items in the database. By writing a number in the square brackets, you refer to the item in the database that has the same id. In this case, it is the first item because I have written $data_items[1]. You probably need to change the number in your project.

By writing $data_items[item_id].occasion = 3, you tell the game that the item with the id "item_id" cannot be used anymore. You can also write  $data_items[item_id].occasion = 0 (or 1 or 2).
0 = can always be used
1 = only in battles
2 = only in menu
3 = never

It's actually pretty simple if you know how to do it.

I hope this solves your problem.  :)
« Last Edit: August 26, 2011, 01:58:33 PM by Squall »

michael95

  • Tier 3
  • *
  • Posts: 70
  • Current Mood: happy happy
Re: Dysable use item
« Reply #2 on: August 27, 2011, 12:28:26 PM »
I´m not sure if I not do enywhere mistake, when character have learned skill, so item I can use and after use (to charcter who have skill learned), when I go to item menu item is disabled. I tried to do this for more characters, but doesn´t work. Can I dysable item use in first time do not aply and for more characters?