Let's go SHOPPING! In Jedi Knight!


[ Follow Ups ] [ Post Followup ] [ The Massassi Temple Message Board ]

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:


# 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

symbols

thing shopkeeper

thing item1 //the consoles that correspond to each item
thing item2
thing item3

int item1bin //the bin numbers for each item on sale
int item2bin
int item3bin

int item1cost=-10 //how much each item costs. Must use negatives
int item2cost=-10
int item3cost=-10

int item1give=1 //how much to give when each is bought
int item2give=1
int item3give=1

int moneyamount local //the player's money
int giveweapon local

int player local

message activated
message startup

end

# ========================================================================================

code

startup:
player = GetLocalPlayerThing();
moneyamount=SetInv(player, 61, 50.0); // 50 bucks
print("You now have 50 bucks.");
return;

# ========================================================================================

activated:
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;

}

if(GetSenderRef() == item1)
{
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");
}

if(GetSenderRef() == item3)
{
moneyamount = ChangeInv(player, 61, item3cost);
giveweapon = ChangeInv(player, item3bin, item3give);
print("You just bought an extra bacta tank for 20 credits");
}

# ........................................................................................

end


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



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ The Massassi Temple Message Board ]