Adding New Weapons

Discussion in 'Coding' started by the-moon, Jun 16, 2010.

  1. the-moon

    the-moon Member

    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    0
    (sry in advance if this has been talked about, was not about to find help with the search function)

    Im trying to figure out how to add in new weapons to the server im hosting.

    Could anyone point me in the right direction for doing this, tutorials or such. Or can anyone explain how to.

    I have tried editing "emp_classes.txt"

    [/code]
    Engineer
    {
    name "Engineer"


    NF_Weapons
    {
    // There are four weapon boxes. Each box can house four weapons (usually categorized).
    // You define these here. Goes from left to right.
    // Note: You do not have to fill in each weapon choice for each box. It will then default to "-1" (not shown)


    BOX_0 // Leftmost box
    {
    "Weapon_Count" "1" // Amount of weapons that are selectable via the box.
    "Weapon_Choice_0" "SIDEARM_NF_9MM" // Name of the weapon as defined in the emp_weapons.txt
    }


    BOX_1 // Box right of leftmost box
    {
    "Weapon_Count" "2"
    "Weapon_Choice_0" "PRIMARY_NF_SMG1"
    "Weapon_Choice_1" "PRIMARY_NF_SMG2"
    }
    [/code]


    Changing "Weapon_Count" too "3"

    Then adding

    "Weapon_Choice_2" "PRIMARY_NF_SMG2"

    Too add a second SMG2.... Doesnt add it in when i run the server. I have tried also adding in the old SMG3 which still seems to be scripted and has models, but nothing seems to work.

    Even if i change "Weapon_Count" too "1", it doesnt remove the second SMG from the engy class selection screen.

    Is there anything else i need to do to add or remove weapons from the class selection?
     
  2. dizzyone

    dizzyone I've been drinking, heavily

    Messages:
    5,771
    Likes Received:
    0
    Trophy Points:
    0
    The weapons are hardcoded afaik
     
  3. the-moon

    the-moon Member

    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    0
    wow that really sucks, and chance that will change soon?
     
  4. vlamnire

    vlamnire Member

    Messages:
    350
    Likes Received:
    0
    Trophy Points:
    0
    It's possible but you have to have the same script server and client side. Unfinished script manifest FTW.
     
  5. recon

    recon SM Support Dev

    Messages:
    2,348
    Likes Received:
    0
    Trophy Points:
    0
    Oh it's finished. It was just removed from the public version by the devs.
     
  6. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    Actually, I think you can add more, but you're doing it wrong. After Friday, I'll take a look.
     
  7. the-moon

    the-moon Member

    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    0
    would really love to figure out how too :)
     
  8. Brutos

    Brutos Administrator Staff Member Moderator

    Messages:
    3,385
    Likes Received:
    0
    Trophy Points:
    0
    No, not going to happen soon. Also script manifest wont give you the ability to add new weapons.
     
  9. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    If you're doing it right, it should give you the ability to add new weapons, I don't see why not.

    But IIRC, some people messed with the amounts of weapons each class had, like removing scout rifle from the scout etc, and giving engy access to smg3, so it should be possible to do without the code.
     
  10. Theowningone

    Theowningone Noone likes me :'(

    Messages:
    704
    Likes Received:
    0
    Trophy Points:
    0
    The way i think its done via scripts is not "adding weapons" persay, since no weapons gets added. The code will only load weapons It's been told to. I think what it was is that someone "got rid" of the scout rifle by changing all the scripts for it into an SMG and reassigning it. Good money says if you were to check that SMG's classname it would be along the lines of weapon_imp_rifle still.
     
  11. Brutos

    Brutos Administrator Staff Member Moderator

    Messages:
    3,385
    Likes Received:
    0
    Trophy Points:
    0
    The best thing you can do is replace a weapon if the script manifest is bugged. There is no way you can actually a new unique weapon while preserving all others.

    Exposing some of the weapons code to lua would make it easy to add new weapons. But thats not on the todo.
     
  12. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    Then make it possible?
     
  13. Brutos

    Brutos Administrator Staff Member Moderator

    Messages:
    3,385
    Likes Received:
    0
    Trophy Points:
    0
    How about I got like a bazillion more important things to do?
     
  14. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    Lies and Slander. Script manifest importance > all.
     
  15. Brutos

    Brutos Administrator Staff Member Moderator

    Messages:
    3,385
    Likes Received:
    0
    Trophy Points:
    0
    What we are talking about adding weapons.
     
  16. vlamnire

    vlamnire Member

    Messages:
    350
    Likes Received:
    0
    Trophy Points:
    0
    Never mind you can add more weapons that are already in the game to select but not add an entirely new one with it's on script. I saw emp_script_manifest.txt in the script folder:

    "ScriptManifest"
    {

    "chassis" "scripts/vehicle_chassis.txt" //chassis manifest file
    "research" "scripts/research_items.txt" //research items TODO: Make a manifest for these
    "buildings" "scripts/buildings.txt" //Building scripts TODO: Make a manifest for these
    "infantry" "scripts/infantry_resists.txt" //Infantry Resists TODO: Make them not ugly
    "engine" "scripts/vehicle_engines.txt" //Engine items TODO: Make a manifest for these
    "armor" "scripts/vehicle_armor.txt" //Armor itmes TODO: Make a manifest for these too
    "weapons" "scripts/vehicle_weapons.txt" //vehicle weapons TODO: again, make a manifest for these
    "soundscape" "scripts/game_sounds_manifest.txt" //Soundscape manifest.


    //TODO: Make a manifest for infantry weapons, and link it to this file.
    }
     
  17. Trickster

    Trickster Retired Developer

    Messages:
    16,576
    Likes Received:
    46
    Trophy Points:
    0
    Well done, you can copy a text file which is irrelevant to this thread.
     
  18. blizzerd

    blizzerd Member

    Messages:
    10,552
    Likes Received:
    60
    Trophy Points:
    0
    you actually can add weapons to an extent, there are unused slots for NF (smg 3 etc) and if you remove some of the stupid ones like the scout rifle (or merge them with one of the riflemen rifles) you can probably get it to work properly, just take note of the hardcoded properties of some weapons

    also if you dont mind having models assigned wrong and just want to test balance on your "hueg infaty weps pack lulz" you can just make both nf and be use be smg1 and be smg 2 and same for pistol1 and scout rifle and use those slots for something else
     
  19. the-moon

    the-moon Member

    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    0
    Adding In New Weapons > All

    :)
     
  20. Metal Smith

    Metal Smith Member

    Messages:
    4,520
    Likes Received:
    3
    Trophy Points:
    0
    make the game work > all...

    Commander interface seems like it would be more important than this. Followed by more work on the infantry UI.
     

Share This Page