IPB

Welcome Guest ( Log In | Register )

> Adding More Weapons?
JRob
post Oct 6 2015, 10:24 AM
Post #1


Advanced Member
***

Group: Members
Posts: 52
Joined: 30-April 11
Member No.: 1,970



I have tried adding more weapons to bot_weapons.cpp and bot_weapons.h but to no success.

CODE

    {TF2_SLOT_PRMRY,TF2_WEAPON_HANDGUN_SCOUT_PRIMARY,        "tf_weapon_handgun_scout_primary",    WEAP_FL_KILLPIPEBOMBS|WEAP_FL_PRIM_ATTACK|WEAP_FL_UNDERWATER,0,800,1,3,0},
    {TF2_SLOT_PRMRY,TF2_WEAPON_SODA_POPPER,                    "tf_weapon_soda_popper",    WEAP_FL_KILLPIPEBOMBS|WEAP_FL_PRIM_ATTACK|WEAP_FL_UNDERWATER,0,800,1,3,0},
    {TF2_SLOT_PRMRY,TF2_WEAPON_PEP_BRAWLER_BLASTER,            "tf_weapon_pep_brawler_blaster",    WEAP_FL_KILLPIPEBOMBS|WEAP_FL_PRIM_ATTACK|WEAP_FL_UNDERWATER,0,800,1,3,0},
    {TF2_SLOT_SCNDR,TF2_WEAPON_JAR_MILK,                    "tf_weapon_jar_milk",    WEAP_FL_NONE,0,180,0,1,0},
    {TF2_SLOT_PRMRY,TF2_WEAPON_ROCKETLAUNCHER_AIRSTRIKE,    "tf_weapon_rocketlauncher_airstrike",    WEAP_FL_PRIM_ATTACK|WEAP_FL_EXPLOSIVE|WEAP_FL_UNDERWATER,BLAST_RADIUS*0.9,4096,1,3,TF2_ROCKETSPEED},
    {TF2_SLOT_SCNDR,TF2_WEAPON_FLAREGUN_REVENGE,             "tf_weapon_flaregun_revenge", WEAP_FL_PRIM_ATTACK, 0, 1600, 2, 2, TF2_GRENADESPEED * 1.5 },
    {TF2_SLOT_PRMRY,TF2_WEAPON_CANNON,                        "tf_weapon_cannon",   & nbsp;WEAP_FL_PROJECTILE|WEAP_FL_PRIM_ATTACK|WEAP_FL_EXPLOSIVE|WEAP_FL_UNDERWATER
,100,1200,1,2,TF2_GRENADESPEED*1.5},
    {TF2_SLOT_PRMRY,TF2_WEAPON_SHOTGUN_BUILDING_RESCUE,        "tf_weapon_shotgun_building_rescue",    WEAP_FL_KILLPIPEBOMBS|WEAP_FL_PRIM_ATTACK|WEAP_FL_UNDERWATER,0,800,1,2,0},

    // short circuit
    // wrangler
    {TF2_SLOT_MELEE,TF2_WEAPON_ROBOT_ARM,                    "tf_weapon_robot_arm",    WEAP_FL_PRIM_ATTACK|WEAP_FL_MELEE|WEAP_FL_UNDERWATER,0,180,3,1,0},

    {TF2_SLOT_PRMRY,TF2_WEAPON_SNIPERRIFLE_DECAP,            "tf_weapon_sniperrifle_decap",    WEAP_FL_SCOPE|WEAP_FL_PRIM_ATTACK,1000,4000,1,3,0},
    {TF2_SLOT_PRMRY,TF2_WEAPON_SNIPERRIFLE_CLASSIC,            "tf_weapon_sniperrifle_classic",    WEAP_FL_SCOPE|WEAP_FL_PRIM_ATTACK,1000,4000,1,3,0},

...

    TF2_WEAPON_HANDGUN_SCOUT_PRIMARY,
    TF2_WEAPON_SODA_POPPER,
    TF2_WEAPON_PEP_BRAWLER_BLASTER,
    TF2_WEAPON_JAR_MILK,
    TF2_WEAPON_ROCKETLAUNCHER_AIRSTRIKE,
    TF2_WEAPON_FLAREGUN_REVENGE,
    TF2_WEAPON_CANNON,
    TF2_WEAPON_SHOTGUN_BUILDING_RESCUE,
    TF2_WEAPON_ROBOT_ARM,
    TF2_WEAPON_SNIPERRIFLE_DECAP,
    TF2_WEAPON_SNIPERRIFLE_CLASSIC,


Apparently, there seems to be a MAX_WEAPONS defined to 48. I tried redefining this to TF2_WEAPON_MAX but it only results in random crashes. How are you supposed to add more than 48 weapons? There are obviously more than 48 weapon types in the game. I noticed that you have only been replacing unused entries to avoid this problem.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies
Cheeseh
post Oct 6 2015, 12:17 PM
Post #2


Admin
*****

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



the default weapons in weapons.cpp is no longer used if you have weapons.ini in the config folder
see: http://rcbot.bots-united.com/forums/index....ost&p=13465
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
JRob
post Oct 6 2015, 07:50 PM
Post #3


Advanced Member
***

Group: Members
Posts: 52
Joined: 30-April 11
Member No.: 1,970



I just updated and it still crashes when I try to add more weapons through weapons.ini.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Cheeseh
post Oct 7 2015, 01:53 PM
Post #4


Admin
*****

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



QUOTE(JRob @ Oct 6 2015, 08:50 PM) *

I just updated and it still crashes when I try to add more weapons through weapons.ini.


MAX_WEAPONS is how many weapons a player can carry, not the maximum number of weapons in the game, although the old rcbot code used this as a maximum for in the game for convenience sake.

Though if you want to add a new weapon without weapons .ini, you need to have this:

CODE

{0, 0, "\0", 0, 0, 0, 0, 0, 0}//signal last weapon


at the end of the WeaponsData_t [] weaponlist

I noticed this was omitted out of DODs and HL2DM so I've added this back in just in case.

Could you locate where in the code it is crashing due to changing weapons.ini file?
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: 8th August 2025 - 07:11 AM