Adding new weapons

Discussion in 'General Modification' started by WinstonShnozwick, Sep 8, 2016.

Remove all ads!
  1. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    How do I go about adding new weapons to ToEE? I need to introduce an entirely new weapon to be defined in the game.
     
  2. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    First, in world builder find a weapon that is similar to the weapon you want to create, and an empty slot in the weapons range (4###IIRC) in the protos.tab file, copy the weapon selected to the new number and edit the stats as required. Icon, model, size damage dice, special properties etc... You will also have to add the name in the same number slot in description.mes
     
  3. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    Well originally I really wanted to have an original model for new weapons, but it seems that it's not as simple as I thought, so unless XVicious comes back any time soon to work his modeling magic, I'll have to use existing weapon models, which shouldn't be that bad.
    I've been looking at the models for weapons to see what they look like, and the Fantasy Swords look really cool, and I can't recall if/where they are used in the game.

    So once I have a model I like, are there also fields in protos.tab to choose the texture for the weapon and special effects to apply to it? I definitely want to edit the texture to change the color of it and also give it some particle effects.
     
  4. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    editing the skin is the easy bit, once you have selected your model, there is a whole forum dedicated to doing what you are attempting, just follow the steps to make an independently operating copy of your chosen model and modify the skin to your liking.
     
  5. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    I am so lost right now, I have no idea how this file works.
     

    Attached Files:

  6. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    This explanation should help you out a lot mate.

    Also, I have no clue what you are looking at protos.tab with, but I'd recommend World Builder and/or Phalzyr's protoed, both are in the modding tools downloads section.

    And just a word to the wise, protos.tab is a finicky beast, always keep a backup lest you fuck it up royally.
     
    Last edited: Sep 9, 2016
  7. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    I'm a bit confused on step 3. I added my new entry in meshes.mes here Capture.PNG .
    But when it comes to materials.mes and addmesh.mes, I looked in the files and those two files seem to be exclusively armor/clothing related stuff. Since I'm adding a weapon, do I go somewhere else? Not sure what to do at that point.

    I'm using notepad++ by the way.
     
  8. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    578
    Likes Received:
    60
    The materials.mes and addmesh.mes files are not needed for weapons. Those are used for items that affect the PC model directly, such as armor, boots, hats, etc., as you said.

    - Use only World Builder to edit protos.tab, unless you really really know what you are doing or have some special purpose. Using Notepad or anything else can cause a disaster by just misplacing one single Tab. And sometimes these errors won't pop up until down the road, so you won't be able to associate it with something you changed a week before.
    - You'll need a hex editor to edit the SKA and SKM files.
    - You'll need Photoshop or similar to edit the TGA image files.

    Can I ask if you have first created a new weapon in protos.tab yet, as Allyx described in post #2 above? Just duplicate a longsword or something, then move on to the next part. Take it in small steps and confirm each one works rather than making all the changes in one fell swoop.

    Also, don't try to make a new weapon out of the Druid Hide mesh. :) Start with the copy of another weapon.
     
  9. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    I have no idea how to use this to edit protos.tab, I've never used world builder before. What do?
     

    Attached Files:

  10. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    578
    Likes Received:
    60
    1. Copy these 3 files to a safe backup folder for safety.

    data/rules/protos.tab
    data/mes/description.tab
    data/mes/long_description.mes

    2. Copy the same 3 files into your World Builder folder.

    3. Open Wold Builder.

    4. Select the tab that says Prototypes.

    5. Open, edit, and add any prototypes you need to.

    6. Click the "Save All" button.

    7. Recopy the 3 files from your World Builder folder back to their original folders. Then restart the game, and your changes will take effect.


    Here is an example of how to create a new proto entry that is an exact duplicate of a longsword. This would all fit into step 5 above.

    1. From the prototype droplist menu, select Longsword -> # 4036.
    2. In the ID text box, change the number to the new proto you wish to create. 4800 is available, or use any unused number between 4000 and 4999.
    3. Click the "Add New Proto" button.
    4. Click on the line in the proto data list that says "Object Name (per oname.mes)", and change it to 4800, or whatever number you chose in step 2.
    5. Click the "Go To Description" button.
    6. In the Description text area, change the text from Longsword to whatever you want to name your new weapon.
    7. Click the "Update" button.
    8. Go back to the "Prototypes" tab.
    9. Click the "Save All" button.

    Now you will have a new prototype entry 4800 that is an exact copy of Lonsgword. From there, you can continue on with making changes to any of the properties listed for that proto without upsetting the original proto. It may seem like a lot of clicks, but after a while you can add a new proto in about 30 seconds.

    Just remember to recopy the 3 files back over or your changes won't take effect. I always forget that.o_O
     
    Last edited: Sep 11, 2016
  11. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    Thanks very much! That made a lot more sense to me.

    So for some questions of the editable information I have now;
    -If I will only have access to the weapon while it is equipped, not in my backpack, will I ever be able to see long description to make use of it?
    -Does material have any effect at all? What does it do ingame?
    -What is category (per category.mes)?
    -Would I change Object Model Mesh ID to 10192 as per my edit made in post #7 above?
    -Will the item flag OIF_IS_MAGICAL make it be considered a magic weapon for the purpose of overcoming damage reduction? If not, how can I do this?
    -If Item Wear Flags contains ONLY OIF_WEAR_WEAPON_PRIMARY, will this prevent you from moving the item into the secondary hand slot?
    -Can I change Weapon Type to be any string I want, and will this work for purposes of feats such as exotic weapon proficiency or weapon focus? I want it to be considered a new weapon type of its own, Mind Blade, for the purposes of the class that will be using it.
    -How can I make it so it can't be sold?

    Additionally, do I need all of these files? (copied from the original model files in Weapons I'm basing this off of, the celtic sword) Capture.PNG
    And I found and replaced the area in the SKM file, but I don't see the same thing in the SKA file, do I need to edit that?
     
    Last edited: Sep 11, 2016
  12. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Currently it's backpack only.
    IIRC material determines the sound effect the weapon makes, and Category is for World Ed categorization purposes.
    OIF_IS_MAGICAL just marks the item as something that needs to be identified (OIF_IS_IDENTIFIED).
    For DR purposes you need to apply a modifier that has an OnDealingDamage hook, such as Weapon Enhancement Bonus (or create a new one yourself).

    No, the weapon types are predefined and hardcoded in the DLL. Going to have to hook the proto parser for this too.
    You can fairly easily add an enum to WeaponTypes in Temple+ though (see temple_enums.h), and for now manually set the weapon's obj_f_weapon_type field to that enum. You'll then have to add an entry to _WeaponFeatCheck in feats.cpp.

    Just set its price to 0.
     
  13. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    Don't know, but it couldn't hurt to put one in anyway.
    I think it's to do with the sound that plays when that armour is struck (chain and plate and leather all sound differently)
    Unsure, look at protos.tab in ProtoEd to see if any entries are made for other items for clues as to what it does, if anything.
    No, that just makes it require identification. In Item properties add Weapon Enhancement Bonus look at other examples of magical weapons to see how it's set properly, you may also consider giving a penalty like the rusty weapons to counter the +1 Attack Bonus, and Damage .
    Yes, but consider that the shortsword version can be dual wielded at higher levels, you can attach multiple wear flags
    From the Soulknife class description it seems that the feats required for the mind blades are the same as the weapon form used (shortsword or longsword or bastard sword depending on the mind blade used) and since the soulknife has fighter type weapon proficiencies, he's already proficient with all forms, focus feats will need to be purchased separately for each form, and exotic weapon proficiency (bastard sword) to wield it one handed.
    OIF_NO_DROP
    if you changed the model number in protos.tab and meshes.mes, yes probably.
    And I found and replaced the area in the SKM file, but I don't see the same thing in the SKA file, do I need to edit that?[/QUOTE]The animation hasn't changed, just the mesh, so no.
     
  14. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    578
    Likes Received:
    60
    Sitra and Allyx answered most of these, so I'll just add a few things

    The material will also affect which merchant will pay full price for the item. So items made of mat_metal will get full price from Brother Smythe, items made of mat_flesh will get full price from the Leatherworker, etc.

    It can also determine the effect of spells such as Heat Metal.

    World Builder tip: To see what all the possible values are for any field in the World Editor, select the field you want to edit, then click on InteliProperties at the very bottom of the screen. It does not work for all fields, but it does work for most of them.

    I've never found where this is actually used, or makes any difference. Just leave it the same as the proto you copied in most cases.

    Set the field "Item Worth (in copper)" to 0.

    You need all 5 files, but you will only need to change the .SKM file and the .MDF file as described in post #6 above. And of course change the .TGA image file to make the weapon appear as you want visually in the game.

    The .SKA and .TXT files should be left unchanged.
     
    Last edited: Sep 11, 2016
  15. WinstonShnozwick

    WinstonShnozwick Established Member

    Joined:
    Mar 2, 2011
    Messages:
    628
    Likes Received:
    23
    Will this make it be considered magic for overcoming DR purposes, while not getting any bonus rolls?

    And if I do put all of the files for this to work in the game (I modified everything else), can I use the console to give myself one of this new weapon to see what it looks like, and how if so?
     

    Attached Files:

Our Host!