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 → Changing bin numbers
Changing bin numbers
2001-06-22, 4:51 AM #1
Just when I think I know everything about cog, this happens. I can't even set an inventory number. I can only change the forcemana bin, but nothing else.

So far I've tried:

ChangeInv(player, 116, 1);

and

SetInv(player, 116, GetInv(player, 116) + 1);

and

int bin=116 local
int change=1 local

SetInv(player, bin, change);

And nothing works. Here's my code:
Code:
symbols

int	player		local
int	bin=116		local
int	check		local
flex	add=1		local
message activated
end

code

activated:
	player = GetSenderRef();
	ChangeInv(player, bin, 1);
	ChangeInv(player, 116, 1);
	SetInv(player, 116, GetInv(player, 116) + 1.0);
	check = GetInv(player, 116);
	PrintFlex(check);
return;
end


Everytime I activate the cog in the game it prints out 0.000000. It frustrates me that I can't even change a simple number. Any help, even to say that you have no idea what the problem is, will be greatly appreciated.
2001-06-22, 7:16 AM #2
Well, do you mean trying to change the active bin, or trying to change the actual bin ID for an item? If your trying to do the latter, you need to open items.dat and alter those numbers. The problem is, any other cogs that use those bin numbers will be changed (you don't want to shoot shield supercharges at an opponent!).
Aisha Clan-Clan: "The Ctarl-Ctarl are an invincible race of beings. We're all as strong as ten humans!"
Gene Starwind: "Is that so?"
*Pulls out his Caster Gun and shoots her. She lies on the ground in a daze*
Gene Starwind: "Wow, you really are invincible!"

- Excerpt from 'Outlaw Star,' Episode 5
2001-06-22, 11:27 AM #3
I'm trying to increment the bin's value, just like most of the weapon cogs decrement thier respective ammo bin values, (i.e. the concussion rifle, when fired, decremets the power cell bin (bin 12) by 8 (or 4)).

With my cog I'm simply trying to change the value of the bin. In my items.dat file my bin looks like this:

Code:
#name   bin no. min.value  max.value  flags
fire    116      0         6          0x000


My goal is, that while the player is doing what he does best (playing), he may press this hotkey and have this bin incremeted by one, effectivly changing what you see above to:

Code:
fire    116      1         6          0x000


much like what picking up an energy cell would do to your energy meter on the HUD.

In my cog I have a "checker" in place that will get the current value of the bin (116) and then display it onscreen while playing. However during testing the value that is displayed on screen is always 0.000000, where it should be 1.000000. This indicates to me that there has been no change in the bin's value and that I generally suck.

Please forgive me for not making this clear in my first post.

[This message has been edited by Ping_Me (edited June 22, 2001).]
2001-06-22, 2:31 PM #4
The reason it will not print out the inv is because you need to put PrintInt(check);, you were using printflex.

To change it just use ChangeInv(player, 116, +1);
2001-06-22, 2:56 PM #5
It doesn't matter if you use PrintFlex or PrintInt.
PrintInt will cut all the decimal digits but PrinFlex will print all decimals even the value is an integer showing "X.0000000".

I think it's because you have "player" value set wrong as "GetSenderRef()", it's "GetSourceRef()" that gets the activater.

And I guess you need to assign the cog as the last param in the items.dat, not sure why it prints without doing so though.

------------------
http://millennium.massassi.net/ - Millennium
2001-06-22, 3:22 PM #6
Hideki's solution worked. I can't believe I made the mistake of mixing up GetSenderRef(); and GetSourceRef();

It isn't actually necessary to put the cog reference at the end of the bin information.

Seifer putting a "+" in front of the "1" caused a syntax error.

Thanks everyone for all your help.
2001-06-22, 6:54 PM #7
Ok put a minus then
2001-06-23, 3:21 AM #8
Seifer, it will only decrease the bin value...

> It isn't actually necessary to put the cog reference at the end of the bin information

Wonder how JK engine knows which cog to call by pressing the bin 116...

------------------
http://millennium.massassi.net/ - Millennium
2001-06-23, 6:11 AM #9
Actually bin 116 is simply a storage bin, there are no hotkeys or special attributes about it, just like the energy cell bin or the power cell bin. My hotkey is a modified forcejump.cog.

If you'll recall, Hideki, the question I put to you about passing triggers in MP games and how it didn't seem to work for me. For my mod this is my way around that problem and actually it's a much better arrangement than the "trigger" setup.

If I may intrude as to ask one more question of everyone. Can a cog be too long, as in length?
2001-06-23, 12:37 PM #10
Hedki, lol sorry name, having it with no minus in front of it will plus it by that number.

And I don't think a cog can be too long but in JK there is a if statment limit. If a cog has too many if staments in it , it will crash before geting in game.
2001-06-23, 1:31 PM #11
Seifer, even with my big tolerence, I feel that you can by NOW spell my NAME!!!

Hideki...
please...

------------------
http://millennium.massassi.net/ - Millennium
2001-06-24, 8:33 AM #12
Thank you Seifer!
2001-06-24, 8:14 PM #13
Np Ping_Me

Sorry Hideki somebody used to have a name like your but differnt and I kinda splice it with his and yours [http://forums.massassi.net/html/smile.gif]

Hideki, Hideki ,Hideki ,Hideki

↑ Up to the top!