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 → All I want it to do is display a bin amount
All I want it to do is display a bin amount
2004-10-15, 9:53 AM #1
Code:
# Jedi Knight Cog Script
#
# item_money_check.COG
#
# Money Check Script
#
#
#


symbols

thing       player                           local

message     startup
message     activated

sound		boop=bactause01.wav		local

int		i=0					local
int		moonay=0				local

end

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

code

startup:
   player = GetLocalPlayerThing();
   SetInvActivated(player, 170, 1);

   Return;

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

activated:

  if (i==0) {
	i=1;
	moonay = GetInv(player, 170);
	JKPrintUNIString(player, 1004);
	printInt(moonay);
	PlaySoundLocal(boop, 1.0, 0.0, 0x0);
	Sleep(2.0);
	i = 0;
	}

   Return;

end


When the player presses a button on their keyboard, this hotkey will display how much money they have (stored in bin 170). It won't work -- why?

I should note that the bin works in a level COG.
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2004-10-15, 2:33 PM #2
Did you remember to include a modified items.dat?
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2004-10-15, 2:51 PM #3
It's possible that you need to add a SetInvAvailable() line in there.

Otherwise, it might be that you're using bin 170. Why not start with 116?
May the mass times acceleration be with you.
2004-10-15, 3:27 PM #4
This will be a fantastic addition to Loam2
ᵗʰᵉᵇˢᵍ๒ᵍᵐᵃᶥᶫ∙ᶜᵒᵐ
ᴸᶥᵛᵉ ᴼᵑ ᴬᵈᵃᵐ
2004-10-15, 4:26 PM #5
When you say it won't work, do you mean it prints nothing or that it prints something, but not what you want? Be more specific here. :p :)
-Hell Raiser
2004-10-15, 4:37 PM #6
I tried the SetInvAvailable();, and it still didn't work.

Slaw - bin 170 works just fine in the main money cog for LoaM2.

Hell Raiser - it prints nothing, nor does it play the sound.
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2004-10-15, 4:51 PM #7
I'm not sure if it's the boards or not, but that 2nd long line of ==== looks like it might muck it up....
-Hell Raiser
2004-10-15, 5:24 PM #8
^^^ yes, that would be massassi's fault.

Anyways, I don't see anything wrong with this code, and neither does parsec.

Perhaps you should post the item line from items.dat Wolfy; if there's not a misplaced flag or cog somewhere I don't know what to look for.
May the mass times acceleration be with you.
2004-10-15, 8:30 PM #9
Wait, I think I remember you have to add a line to jkstring.uni or something. Some people were talking about it a few days ago. I'll take a look back through the forum.
_ _ _____________ _ _
Wolf Moon
Cast Your Spell On Me
Beware
The Woods At Night
The Wolf Has Come
2004-10-15, 9:59 PM #10
I have "ACTIVATE17" 0 "Check Money" in jkstrings.uni

Code:
#################
#Inventory Items#
#################

# Note that the icon names are taken from these names:
# ========================================================================================
bactatank               40              0       5       0x102   cog=item_bacta.cog
irgoggles               41              0       1       0x102   cog=item_irgoggles.cog
fieldlight              42              1       1       0x122   cog=item_fieldlight.cog
wrench                  116             1       1       0x100   cog=item_money_check.cog
keyimperial             43              0       1       0x042   cog=item_keyimperial.cog
wrench                  44              0       1       0x042   cog=item_wrench.cog
datadisk                45              0       1       0x042   cog=item_datadisk.cog
keyred                  46              0       1       0x042   cog=item_keyred.cog
keyblue                 47              0       1       0x042   cog=item_keyblue.cog
keyyellow               48              0       1       0x042   cog=item_keyyellow.cog
wrchblue                49              0       1       0x042   cog=item_wrenchblue.cog
wrchyellow              50              0       1       0x042   cog=item_wrenchyellow.cog
keygreen                51              0       1       0x042   cog=item_keygreen.cog
# ========================================================================================


It's the one labelled "wrench" with flags 0x100 and bin 116.
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2004-10-15, 10:07 PM #11
Set flags to 0x122
May the mass times acceleration be with you.
2004-10-15, 10:47 PM #12
It works! Muchas gracias!
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken

↑ Up to the top!