![]() |
![]() |
J@nek |
![]()
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. |
![]() ![]() |
J@nek |
![]()
Post
#2
|
Member ![]() ![]() Group: Members Posts: 19 Joined: 18-May 09 Member No.: 1,541 ![]() |
1) I understand your explaination which is what I initially thought but I still have things that I don't understand. My mod is using HL2DM weapons. In HL2DM, weapons are mainly using different types of ammo and then different repository: I can't use ammo of smg1 for ar2 so I assume I must have a specific ammoindex for each weapons except melee. Am I right ?
When looking at your explainations, I understand that all weapons refering to the same ammoindex are sharing the same ammo repository. Am I right ? It is weird as it is saying that "flametrower", "grenadelauncher" and "pistol" use the same ammo ??? I don't think so. 2) Also, I have an other question about weapons having primary AND secondary fire. How is it possible to specify both states ? I saw the WEAP_FL_SEC_ATTACK but don't know how to define 2 states for the same weapon : {2, WEAPON_SMG1, "weapon_smg1", WEAP_FL_KILLPIPEBOMBS|WEAP_FL_PRIM_ATTACK,0,1000,4,3} {2, WEAPON_SMG1, "weapon_smg1", WEAP_FL_EXPLOSIVE|WEAP_FL_SEC_ATTACK,0,500,?,3} <-- I don't think I can use same index and name J. |
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 20th June 2025 - 04:38 AM |