Posted by Matthew Pate on November 22, 1998 at 01:59:42:
This is a cog I am working on which can hopefully be used by people. I will probably write a tutorial for it as well, when it works.
This is what I have, I hope you can follow it:
symbols thing shopkeeper thing item1 //the consoles that correspond to each item int item1bin //the bin numbers for each item on sale int item1cost=-10 //how much each item costs. Must use negatives int item1give=1 //how much to give when each is bought int moneyamount local //the player's money int player local message activated end # ======================================================================================== code startup: # ======================================================================================== activated: } if(GetSenderRef() == item1) if(GetSenderRef() == item3) # ........................................................................................ end
# Jedi Knight Cog Script
#
# shop.COG
#
# Let's go shopping!
# 61 is the bin (Force_Armour, min 0, max 200.00)
#
# This Cog is Not supported by LucasArts Entertainment Co
thing item2
thing item3
int item2bin
int item3bin
int item2cost=-10
int item3cost=-10
int item2give=1
int item3give=1
int giveweapon local
message startup
player = GetLocalPlayerThing();
moneyamount=SetInv(player, 61, 50.0); // 50 bucks
print("You now have 50 bucks.");
return;
if(GetSenderRef() == shopkeeper)
{
if(GetInv(player,61)<1)
{
print("I don't want you here, get some more money!");
}
else
{
print("Welcome to my shop! Please choose the item of your choice");
print("Prices are as marked.");
}
return;
{
moneyamount = ChangeInv(player, 61, item1cost);
giveweapon = ChangeInv(player, item1bin, item1give);
print("You have just purchased a Repeater Rifle for 50 credits");
}
if(GetSenderRef() == item2)
{
moneyamount = ChangeInv(player, 61, item2cost);
giveweapon = ChangeInv(player, item2bin, item2give);
print("You now have 20 more powercells for 10 credits");
}
{
moneyamount = ChangeInv(player, 61, item3cost);
giveweapon = ChangeInv(player, item3bin, item3give);
print("You just bought an extra bacta tank for 20 credits");
}
Is the problem using bin 61? 61 being 'force armour'. The actual objects you activate are consoles, with an object behind it in glass so you know what you are buying. People have been wanting this sort of thing, so I thought I'd have a shot at making it.
(Alterior Motive)It will also make me better at COG.
If anyone can help, thanks!
Matt