Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Bins bins oh my.
Bins bins oh my.
2001-10-19, 9:15 PM #1
I'm making a thief system for level 1 of my trilogy. I'm making each stealable item have it's own item.cog. here's an example...tell me if it will work...

Code:
taken:
   player = GetSourceRef();
   powerup = GetSenderRef();

   // Print("A golden candlestick");
   jkPrintUNIString(player, bin);

   // Do effects.
   PlaySoundThing(pickupsnd, powerup, 1.0, -1, -1, 0);
   AddDynamicTint(player, 0.0, 0.0, 0.2);

   // Changes how much loot value the player has.
   ChangeInv(player, bin, 30.0);
   SetInvAvailable(player, bin, 1);

   // Checks to see if the player has 500 loot. If he does the objective is completed.
   If (GetInv(player, bin) => 500.0;
   {
		player = GetLocalPlayerThing(); 
            SetGoalFlags(player, 1, 2); 
   }
   else
   {
		player = GetLocalPlayerThing(); 
            SetGoalFlags(player, 0, 1); 
   }		

   Return;


What I want it to do:
When you take it, it should print "A golden candlestick" and then ADD 30 gp worth into your loot bin. eventually I want it so say how much loot you now have.

then it checks to see if you have equal or greater then 500 loot and if you do if completes objective 1.
Save a tree, Kill a beaver!
2001-10-21, 1:47 PM #2
Sorry I can't help ya with your problem, but let me just say, to all of you people that do know how to help him...DO IT!!! I want to play what he's doing and I want to do it now, it looks awesome [http://forums.massassi.net/html/smile.gif] [http://forums.massassi.net/html/smile.gif] [http://forums.massassi.net/html/smile.gif]
Who made you God to say "I'll take your life from you"?
2001-10-22, 6:13 AM #3
Code:
taken:
	player=GetSourceRef();
	ChangeInv(player, bin, 30);
	PlaySoundThing(pickupsnd, player, 1, -1, -1, 0);
	AddDynamicTint(player, 0, 0, 0.2);
	JKStringClear();
	JKStringConcatAsciiString("A Golden Candlestick. Loot: ");
	JKStringConcatInt(GetInv(player, bin));
	JKStringOutput();
	if(GetInv(player, bin) >= 500) SetGoalFlags(player, 1, 2);
	else SetGoalFlags(player, 0, 1);

Return;


There's my version. [http://forums.massassi.net/html/wink.gif]

------------------
Never argue with an idiot. They drag you down to their level and beat you with experience.

[This message has been edited by SaberMaster (edited October 22, 2001).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-10-22, 7:49 AM #4
Should be...

Code:
taken:
   powerup = GetSourceRef();
   player = GetSenderRef();

   // Print("A golden candlestick");
   jkPrintUNIString(player, bin);

   // Do effects.
   PlaySoundThing(pickupsnd, powerup, 1.0, -1, -1, 0);
   AddDynamicTint(player, 0.0, 0.0, 0.2);

   // Changes how much loot value the player has.
   ChangeInv(player, bin, 30.0);
   SetInvAvailable(player, bin, 1);

   // Checks to see if the player has 500 loot. If he does the objective is completed.
   if (GetInv(player, bin) >= 500.0)
      SetGoalFlags(player, 1, 2); 
   else
      SetGoalFlags(player, 0, 1); 

   Return;

↑ Up to the top!