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 → SelectWeapon(*)
SelectWeapon(*)
2003-10-05, 11:52 PM #1
Hideki defines it as thus:
Quote:
<font face="Verdana, Arial" size="2">Actually sets the current weapon to a different weapon. Use : SelectWeapon(player, intWeapon). Where intWeapon is the Xth entry in the items.dat flagged as a weapon.</font>


My question is, say I use bin 85 for another weapon. Do I use SelectWeapon(player, 11) --the 11th weapon, SelectWeapon(player, 85) -- or do over 10 weapons work at all?

-Tazz

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2003-10-06, 12:42 AM #2
I don't think you can have 85. Check the items.dat to see where the next set of items appear after weapons. I think if you set it for 45, you'd be throwing keys... [http://forums.massassi.net/html/tongue.gif]
Most probebly crash.

/Edward
Edward's Cognative Hazards
2003-10-06, 3:47 AM #3
Yeah, probably.
2003-10-06, 8:54 AM #4
*cough-datamaster-cough*
Quote:
<font face="Verdana, Arial" size="2">Makes a weapon the current weapon. This tells the engine in which cog to call the activated, fire, and deactivated messages. SetCurWeapon() is limited to the original weapons; see SetCurInvWeapon().</font>


The way Hideki defines SelectWeapon(), it seems that if you have bin 85 flagged as a weapon, SelectWeapon(player, 11) would work. But I'm fairly sure that SelectWeapon() wants a bin number and not a index number for a seperate weapons array. It's worth testing though.

And although 85 doesn't seem to be used, you should start with 116 for your own bins.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-10-06, 12:25 PM #5
lol - a truly shameless display of plugging there, SaberMaster [http://forums.massassi.net/html/biggrin.gif]

I also concur that I believe that a bin number is wanted by the cog language, rather than an index value. After-all, would, so many additional mods that create new/different weapons really use a numerical indexer? - Imagine realising that you wanted to create a new weapon/item inventory and having to increment all the bin numbers by one to "shuffle" everything along lol [http://forums.massassi.net/html/wink.gif]

That said, that approach would then affect all other scripts referencing that items.dat file... Ignore me now - I've gone past useful information and into the "waffle zone"... [http://forums.massassi.net/html/wink.gif]

Hope this helps [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2003-10-06, 11:14 PM #6
Ya, I just got Datamaster. I see that SetCurInvWeapon(*) is not limited to the original 10, but does it do the exact same thing?

-Tazz

[This message has been edited by Tazz (edited October 07, 2003).]
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2003-10-08, 12:52 PM #7
As far as I'm aware, it's best to use SetCurInvWeapon(), before implementing SetCurWeapon - the reason being that once you have set the inventory to the current weapon, SetCurWeapon() applies the fire, activated, and deactivated messages to that inventory bin (thus, it makes life easier, if you set it first...)

That said ... to actually answer your question [http://forums.massassi.net/html/wink.gif], the verbs are similar, but I've found (could be just me...) that SetCurWeapon() gets confused firing the wrong bullets from different guns (as well as subsequently subtracting ammo from the wrong inventory bins), if SetCurInvWeapon() is not included in the related/applicable code section.

Having mentioned all this, it does partly depend on how your "items.dat" file is set-up, what with the "flags" settings...

Hope this helps [http://forums.massassi.net/html/biggrin.gif] (even if just a little - I apologise it's not clearer or more detailed... [http://forums.massassi.net/html/redface.gif]

-Jackpot

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||

↑ Up to the top!