in my game the player has to put only 4 items in a potÃ, to make a potion.
this is the script to make a medicin
if (StrGetNumDots(sequence) < StrGetNumDots(correct)) {
Ã,Â
int item = character[GetPlayerCharacter()].activeinv;
string itemName;
GetInvName(item, itemName);
if (StrCaseComp(itemName, "fullgls")==0) StrCopy(itemName, "orange juice");
if (StrCaseComp(itemName, "gounded wheat")==0) StrCopy(itemName, "grounded wheat");
if (StrCaseComp(itemName, "halfcocont")==0) StrCopy(itemName, "very special milk");
if (StrCaseComp(itemName, "honey")==0) StrCopy(itemName, "honey");
Display("you put %s", itemName); //display only once!![/b]
StrFormat(sequence, "%s%d.", sequence, item);
SetActiveInventory(-1);
LoseInventory(item);
Ã, Ã, Ã, if (StrGetNumDots(sequence) == StrGetNumDots(correct)) {
Ã, Ã, Ã, Ã, Ã, if (StrCaseComp(sequence, correct)==0) {
Ã, Ã, Ã, Ã, Ã, Ã, Display("very good - you've made the medicin");
Ã, Ã, Ã, Ã, AddInventory (33);
Ã, Ã, Ã, NewRoomEx (1,194,115);
Ã, Ã, Ã, Ã, Ã,Â
Ã, Ã, Ã, Ã, Ã, } else {
Ã, Ã, Ã, Ã, Ã, Ã, Display("nothing happen");
AddInventory (26);
AddInventory (22);
AddInventory (21);
AddInventory (18);Ã, Ã, Ã, Ã,Â
Ã, StrCopy(sequence, "");
Ã, Ã, Ã, Ã, Ã, }
Ã, Ã, Ã, }
Ã, }
I need a command which tells if the player put something beside the 4 above mentioned items it will display :" this item is not a part to the recipe".
i hope someone will help/
dikla
Ã,Â
So basically the play has to put 4 different items into a pot? There's an easier way to do this.
int number_of_items;
Script for hotspot pot:
if(character[GetPlayerCharacter()].activeinv==x){ //replace x with item number
number_of_items +=1;
LoseInventory(x);
}
else if(character[GetPlayerCharacter()].activeinv=y){ //y=next item #
number_of_items +=1;
LoseInventory(y);
}
//continue for all four items.
else{
display ("This item is not part of the recipe.");
}
if(number_of_itmes==4){
Display("very good - you've made the medicine");
AddInventory (33);
NewRoomEx (1,194,115);
}
else{
display ("Nothing happens.");
}