Script Accidentally Duplicates Items

RoseReveries

Villager
Member
Joined
Mar 18, 2012
Messages
14
Reaction score
11
First Language
English
Primarily Uses
Hi, sorry if this is the wrong place to post this.


I'm pretty new to scripting, but I've been working on a rune crafting script and have run into a problem. If you have only one rune in your inventory and you select it you're able to select it again for the second rune, essentially duplicating it. I have no idea how to fix it to be honest haha, I was hoping someone here could shed some light on how to fix it.


Here is a demo that includes my script, I figured it would make more sense this way.


https://www.dropbox.com/sh/q543pnj9ubixaxs/AACROFmAbeP6W1oxjvI00rgVa?dl=0


Thanks so much for taking a look.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,107
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
I haven't looked at your script, but normally you'd look at how many items you have in inventory, and subtract how many have already been selected, in order to determine what's available.  So you should have a list somewhere of the items already selected and the quantities of each.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,848
First Language
English
If the idea is


1: Select a rune,


2: Select another rune (to combine with, etc)


You would need to make sure that the second time around, you prevent the user from selecting a rune that is already selected.


So for example you could keep track of a list of items that have been selected, and then checking whether the selected item is already in the list or not.
 

RoseReveries

Villager
Member
Joined
Mar 18, 2012
Messages
14
Reaction score
11
First Language
English
Primarily Uses
Thanks guys, I'll give that a shot :D
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,189
Members
137,771
Latest member
evoque
Top