Basically I am making a little workshop belonging to an artist NPC, who has a "paintmaker". If the player has the right ingredients, he/she can make pots of paint with them. For this I have attached a script to the paintmaker, but am having problems getting it working. With the needed ingredients in my characters inventory, it still doesn't give me the paint.. here is what I have:
begin aiy_makepaintshort controlvarshort buttonshort objectcountif ( MenuMode == 1 ) returnendifif ( controlvar == 1 ) set button to GetButtonPressed if ( button == 3 ) return elseif ( button == 0 ) if ( GetItemCount "ingred_stoneflower_petals_01" >=1 ) player->additem "aiy_paint_blue" 1 player->removeitem "ingred_stoneflower_petals_01" 1 set controlvar to 0 else return set controlvar to 0 endif elseif ( button == 1 ) if ( GetItemCount "ingred_gold_kanet_01" >=1 ) player->additem "aiy_paint_yellow" 1 player->removeitem "ingred_gold_kanet_01" 1 set controlvar to 0 else return set controlvar to 0 endif elseif ( button == 2 ) if (GetItemCount "ingred_fire_petal_01" >=1 ) player->additem "aiy_paint_red" 1 player->removeitem "ingred_fire_petal_01" 1 set controlvar to 0 else return set controlvar to 0 endif else set controlvar to 0 return endifelse if ( onactivate ) MessageBox "Proceed in making paint?", "Blue", "Yellow", "Red", "None" set controlvar to 1 endifendifend
I am also unsure if the little "else return setcontrolvar to 0 endif" parts after each paintmaking part are necessary.
I would also like to expand the script and, on successful paintmaking, let one hour pass and a messagebox come up saying "You have created [colour] paint."
I don't know what action should happen if the player clicks a colour button and doesn't have the ingredients - at the moment the dialogue box just goes away (I think), maybe a message box should come up there too? Or should it be written so that, if clicked, the dialogue box remains (so you'd have to press "none" to exit)?