I was wandering how i could "buy" an item off a shop keeper i made which puts the item i buy in my inventory and takes out money from my inventory. Thanks
I´m not sure what do you want, but I will try to help you.
I created a module/ template for this, but it isn´t working now. So, if you want to use dialog for this, you have to
1. create new option in dialog with merchant,
2. add line run-script 1
3. in dialog_request add this:
if (parameter==1) {
player.Say("I must have this thing!");
cShopKeeper.Say("Okay, it costs 50 gold.");
if (Money>=50) { // 50 is price of thing you are buying
player.AddInventory(iYourNewItem);
Money-=50;
cShopKeeper.Say("You bought a realy great item!");
dYourDialog.SetOptionState(1, eOptionOff);
}
else {
cShopKeeper.Say("You don´t have enough money!");
}
}
Quote from: Mirek on Thu 23/10/2008 16:56:35
I´m not sure what do you want, but I will try to help you.
I created a module/ template for this, but it isn´t working now. So, if you want to use dialog for this, you have to
1. create new option in dialog with merchant,
2. add line run-script 1
3. in dialog_request add this:
if (parameter==1) {
player.Say("I must have this thing!");
cShopKeeper.Say("Okay, it costs 50 gold.");
if (Money>=50) { // 50 is price of thing you are buying
player.AddInventory(iYourNewItem);
Money-=50;
cShopKeeper.Say("You bought a realy great item!");
dYourDialog.SetOptionState(1, eOptionOff);
}
else {
cShopKeeper.Say("You don´t have enough money!");
}
}
ok the only bit i dont understand here is the dialogue_request bit. whats that? sorry
Did you try searching the helpfile for "dialog_request"?
ok ok ok now ive done everything but i dont understand the concept of "(Money>=5)" was i suppose to create a GUI so that the money can be taken away?
i was hoping that i could just take something out of my inventory instead of money. For example you can find gold coins on the floor.
yay im slowly cracking it but now it comes up " undefined token 'money' " for this line:
Money-=50;
???
Have you created variable Money? (it must be int variable)
ive acheived what needs to be done on this but ive made a new post with yet another damn problem.