IPB

Welcome Guest ( Log In | Register )

> m_iAmmoIndex in TF2WeaponsData_t
J@nek
post Jun 22 2009, 03:43 PM
Post #1


Member
**

Group: Members
Posts: 19
Joined: 18-May 09
Member No.: 1,541



Hi,

I'm trying to understand to what m_iAmmoIndex is refering to in the weapons data structure. Here is the structure:
typedef struct
{
int iSlot;
int iId;
const char *szWeaponName;
int m_iFlags;
float minPrimDist;
float maxPrimDist;
int m_iAmmoIndex;
int m_iPreference;
}TF2WeaponsData_t;

Of course, my first thought was that it was corresponding to AmmoIndex that we have in our mod meaning that if I have a specific ammo for each weapons, I should have a different index and normally 0 is not used.

What I don't understand is that for TF2 you did this table of indexes for weapons :
int m_TF2AmmoIndices[] =
{
0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,2,2,2,2,1,1,2,1,2,2,0,2,1,1,3
};

where we can see very often the same values and very often 0. Does it mean that all weapons referencing a value > 0 are referencing the same type of ammo and that for all weapons with 0 it is automatic ?

I'm interested by all explainations about that.

Thank you in advance.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies
J@nek
post Jun 23 2009, 12:46 PM
Post #2


Member
**

Group: Members
Posts: 19
Joined: 18-May 09
Member No.: 1,541



1) I must investigate. Thank you for the information. Very usefull.

2) In fact, I know about the ORing but this way how can you make a weapon refering to 2 types of ammo. For example for smg1 primaryattack is firing bullets and secondary attack is launching smg1 grenade. With one line only one ammo can be refered.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Cheeseh
post Jun 23 2009, 03:34 PM
Post #3


Admin
*****

Group: Admin
Posts: 3,066
Joined: 11-September 03
From: uk
Member No.: 1



QUOTE(J@nek @ Jun 23 2009, 01:46 PM) *

2) In fact, I know about the ORing but this way how can you make a weapon refering to 2 types of ammo. For example for smg1 primaryattack is firing bullets and secondary attack is launching smg1 grenade. With one line only one ammo can be refered.

In that case you will need to make a seperate "ammoindex" for secondary ammo, this is how it was done in HL1 if I remember correctly, and it is probably the same with HL2.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 20th June 2025 - 03:23 PM