1. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice
  2. Melee Mapping Contest #3 - Results are out! Congratulate the winners and check plenty of new 4v4 melee maps designed for this competition!
    Dismiss Notice
  3. The winners of our cinematic soundtrack competition have been decided! Step by the Music Contest #11 - Results to check the entries and congratulate the winners!
    Dismiss Notice

How to: Attach weapons to units that allready have weapons (without modelling)

Discussion in 'General Mapping Tutorials' started by konerboy, Feb 23, 2008.

  1. konerboy

    konerboy

    Joined:
    Aug 1, 2007
    Messages:
    201
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    .
    .
    .
    .

    [tutorial]how to attach weapons to units that allready have weapons without modelling


    I noticed allot of people didn't know how to do this and some thought it was impossible to do this without modeling. then i decided to write this tutorial. enjoy. plus i have added the final map if anyone need to see it through.

    credits:

    Lord_T for his awesome dragon sword that i used all along.

    Chapter 1 removing Weapons



    • Step 1: removing the existing weapon
    • Step 2: converting and importing


    things you need for chapter 1:

    • Warcraft 3 Frozen throne
    • a image editing program that can edit and save in Tga. Format ( I will guide Photoshop users)
    • Wc3 extractor
    • warcraft 3 viewer or any other program that can convert Tga. To blp.


    Chapter 2 different ways of attaching weapons

    • a. make a ability so that the attachment will be on the hero/unit forever
    • b. when the Hero picks up a item he will get the attachment

    • c. when the hero uses an ability he will get the attachment on

    • d. when the hero uses an AOE ability units around it get's a attachment

    • e. when you finnishes a upgrade all units change weapon


    things you need for chapter 2:

    the only thing you need for completing chapter 2 is

    • Warcraft 3 Frozen throne



    Chapter 1 removing Weapons





    Step 1: removing the existing weapon


    Open up your Wc3 extractor and locate the unit you want to add weapons to save the skin. in this case im going to use Illidan Evil (textures\illidan.blp)

    Open the picked skin (your skin.blp) with your image editing program

    [​IMG]


    Now we need to make the existing weapons disappear we are going to do that by using alpha channels. Locate the weapons/weapon parts, this Illidan model only have 2 weapon parts the blade and the panda seal. Grab your marking tool and mark closely the weapon parts.

    [​IMG]

    When this is marked go to the alpha channel... Photoshop users should press Ctrl + 4

    Alpha channel menu example

    [​IMG]

    My Illidan skin's alpha channel looks like this

    [​IMG]

    Alpha channels are used to cut unnecessary things out, example in this panda seal the artist didn't wanted the black square around it into the model.

    Back to work..

    grab a pencil/brush and paint the marked area black like this.

    [​IMG]

    now the graphics is done. now we need to convert and import this new skin.


    step 2: converting and importing


    open Wc3 viewer and press "Convert files --> bmp, tga or jpeg --> blp."
    choose "your skin.tga" and save it as a Blp. file.

    Now we need to import our new modified skin, start your World editor and go to “import manager” then “import file” browse through your computer and find the skin.
    I hope you remember the path for the unit because you’re going to need it now, if not then open Wc3 extractor again use the search function to find the path faster.

    Check the “use custom path” bottom and write the path that fits with your skin, in my case it’s “Textures\illidan.blp”

    [​IMG]

    Yahoo we successfully removed the weapons from this illidan model. If there are anything floating around where the weapon should be you should try to locate those thing and remove them from you Tga. File, remember every time you edit the Tga. You need to convert it to Blp. One more time and import it again.
    If nothing is gone from the weapon you have entered the wrong path, try to locate it again or post here so I can help you find it.

    If you already know how to attach a weapon to a unit then this is the end for you.



    Chapter 2 different ways of attaching weapons

    if you wanna see a video instead of reading this video show you how to make a ability with attachment points.

    7mGKW4lU94s
    http://www.youtube.com/watch?v=7mGKW4lU94s

    Attachment Points for units

    first you need to get a little idea of where you can set your attachments, here are some examples and explanations

    [​IMG]

    overhead (floats over the heroes head, but it dosn't follow the unit)
    head (used for mask/helmet for the unit)
    chest (the center of the unit, used for armors/capes/jetpacks/wings)
    hand (used for weapons and shields) Left,hand for left hand and right,hand for right
    foot (used for nearly nothing... uses the left and right foot like hand
    orgin (the place depends but it's mostly beneath the unit betwen the feets, used for auras)
    weapon (for heroes)



    now you have 5 choices to make different ways to attach those attachments

    before you start make sure you make the ability below. we need it for all of them.

    • a. make a ability so that the attachment will be on the hero/unit forever
    • b. when the Hero picks up a item he will get the attachment

    • c. when the hero uses an ability he will get the attachment on

    • d. when the hero uses an AOE ability units around it get's a attachment

    • e. when you finnishes a upgrade all units change weapon


    things you need before continuing :

    a model of an attachment.models
    if you wanna follow this tutorial i suggest you take a thing you can attach to the hands (sword,shield,club)


    Attachment ability

    All the ways require that you make this ability.
    import your attachment and everything that comes with it, I’m going to import this Dragon Sword and write the path that followed (in most cases it’s “textures\your attachment.mdx”)

    Save your map and re-open world editor (we do this so the weapon loads)
    Hit the object editor (F4) and change to the tab “abilities” now we should get a base ability,
    it could be anything but it’s faster with “sphere” search or locate the ability “sphere” copy it and paste it,
    now you see a new ability called “sphere” appears in the bottom that’s our new ability change the name to whatever im going to call it “dragon sword”

    [​IMG]

    Now we need to change the value’s and settings in this ability, start of by changing the “art – attachment points” to 1 or 2 attachments (if you want a one-handed weapon choose one, if you want 2x one-handed choose 2.

    It’s not possible to make a unit wear a two-handed weapon in 2 hands, only special units can do that

    Now change the art-target to “YourAttachment.mdx”

    Hopefully you can see that there are 5 slots called “art- attachment points 1 -5” clear nr 3 (and nr. 2 if you only need a weapon in one hand) by double clicking on it and delete the existing strings. Now it’s time to write the strings to make the weapon appear on the units hand,

    start with “art- attachment points 1” change the string to “right,hand” (or left if you want to) and if you want the weapon in both hands change the value in “art- attachment points 2” to “left,hand” now the ability “Dragon blade” is finish.


    a. make a ability so that the attachment will be on the hero/unit forever


    [​IMG]

    now we need to give a unit this ability. Change the tab back to “units” and pick a existing unit or create a new one, go to your unit and find “abilities –normal” double click and “add ability” change the list to custom and find your attachment ability.
    You can only see the attachments in game, so don’t go nuts when it doesn’t appear in world editor.

    [​IMG]
    Success!!


    b. when the Hero picks up a item he will get the attachment

    that can be done with a simple trigger

    • Dragon sword on pick up.
      • Events
        • Unit - A unit Acquires an item
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
      • Actions
        • Unit - Add Dragon Sword to (Triggering unit)



    and we also need it to disappear when he drops it again

    • Disappering dragon sword on drop
      • Events
        • Unit - A unit Loses an item
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to Claws of Attack +15
      • Actions
        • Unit - Remove Dragon Sword from (Triggering unit)





    c. when the hero uses an ability he will get the attachment on

    this trigger gives the attachment to the unit who cast "roar" and in this case we also need it to go away when the buf disappears, for this you need a "unit variable" in this case im gonna call it "RoarWeapon"


    • [B]dragon sword on ability[/B]
      • Events
        • Unit - A unit Begins casting an ability
      • Conditions
        • (Ability being cast) Equal to Roar
      • Actions
        • Unit - Add Dragon Sword to (Triggering unit)
        • Set RoarWeapon = (Triggering unit)
        • Trigger - Turn on Dragon sword on ability off <gen>


    "Dragon sword on ability off" should have intially of, check the "itially on" box so its off.

    [​IMG]


    • Dragon sword on ability off
      • Events
        • Time - Every 0.01 seconds of game time
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (RoarWeapon has buff Roar) Equal to False
          • Then - Actions
            • Unit - Remove Dragon Sword from RoarWeapon
            • Trigger - Turn off (This trigger)
          • Else - Actions
            • Do nothing



    d. when the hero uses an AOE ability units around it get's a attachment


    this can be done in two ways depending on how you like it, and they work exactly the same.

    i used Roar as base but i changed the it so it didn't add'ed more damage.


    the first is only controlled by triggers

    • Roar AOE On
      • Events
        • Unit - A unit Begins casting an ability
      • Conditions
        • (Ability being cast) Equal to Roar
      • Actions
        • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Triggering unit))) and do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Owner of (Picked unit)) Equal to (Owner of (Triggering unit))
              • Then - Actions
                • Unit - Add Dragon Sword to (Picked unit)
                • Set DragonBuff = (Picked unit)
                • Wait 5.00 seconds
                • Unit - Remove Dragon Sword from (Picked unit)
              • Else - Actions
                • Do nothing




    the second way is used by abilities.

    when the unit gains a buff, the weapons will attach, and when the buff disappears, the weapons also do.
    Copy the Roar ability and make a new edited version.


    Roar ability.

    [​IMG]

    Buff.

    [​IMG]

    Succes!!

    [​IMG]




    e. when you finnishes a upgrade all units change weapon

    make a new upgrade or change a old one, i made a upgrade called "Dragon swors" and it didn't do anything without triggers, so we are going to make this trigger.

    • Sword after upgrade Copy
      • Events
        • Unit - A unit Finishes research
      • Conditions
        • (Researched tech-type) Equal to Dragon swords
      • Actions
        • Unit Group - Pick every unit in (Units of type Villager (Male) dragon cool boy) and do (Actions)
          • Loop - Actions
            • Unit - Add Dragon Sword to (Picked unit)


    you can change the "pick" action to something else if you want to.


    end of chapter 2.



    C & C are welcome, feel free to post if there are any problems.
     

    Attached Files:

    Last edited: Mar 17, 2008
  2. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,418
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    I'm pretty sure there is already a tut on this but I'm not sure. Those images or examples or w/e don't work.

    Gj and I think the video will be useful for those who don't like to read. :p
     
  3. Oziris

    Oziris

    Joined:
    Oct 14, 2006
    Messages:
    4,107
    Resources:
    3
    Icons:
    1
    StarCraft II Resources:
    1
    Tutorials:
    1
    Resources:
    3
    Ther is a tutorial like this but it's nice of u to make something like this! i am gona try this out! +rep
     
  4. konerboy

    konerboy

    Joined:
    Aug 1, 2007
    Messages:
    201
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    The images works fine.. the only thing that dosn't work is the Youtube video.
     
  5. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,418
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Ok, now they seem to show up. :p

    Anywho, I like the second part.

    Origin is actually conditional since origins are not necessarily always at the bottom of the model.
     
  6. konerboy

    konerboy

    Joined:
    Aug 1, 2007
    Messages:
    201
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    BUMP.


    why dosn't the youtube frame show up.
     
  7. konerboy

    konerboy

    Joined:
    Aug 1, 2007
    Messages:
    201
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Bump chapter 2 on it's way

    to a mod/admin : i want to change the name to [tutorial] how to attach weapons
     
  8. konerboy

    konerboy

    Joined:
    Aug 1, 2007
    Messages:
    201
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    I have posted chapter 2 now aswell anyone got something to say :grin:
     
  9. desmasic

    desmasic

    Joined:
    Dec 15, 2003
    Messages:
    3
    Resources:
    0
    Resources:
    0
    Yeah, I do. If you have Photoshop CS3, is it really THAT hard to just go in and take a pic of the layers window? I mean, you went through the trouble of linking my image through google, might as well link to the whole tutorial at the Star Alliance or on my site directly.


    Still, if you are working on a tutorial, I fail to understand why you wouldn't just create your own images for more authentic look.
     
  10. underscore

    underscore

    Joined:
    Mar 17, 2008
    Messages:
    150
    Resources:
    0
    Resources:
    0
    I didn't know you could do that without re-modeling. Thanks for the tutorial very useful in units that have shield. (e.g. footman)
     
  11. konerboy

    konerboy

    Joined:
    Aug 1, 2007
    Messages:
    201
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    Argh!! :witch_doc_sad: how did you find me lol.

    okay sorry mate i change it immediately
     
  12. Archian

    Archian

    Site Director

    Joined:
    Jan 1, 2006
    Messages:
    2,686
    Resources:
    12
    Skins:
    1
    Tutorials:
    11
    Resources:
    12
    Hmm, this just explains alpha mapping and in-game attachments. I think we have those things covered in our tutorial section already :con:
     
  13. konerboy

    konerboy

    Joined:
    Aug 1, 2007
    Messages:
    201
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    hmm i've never seen a tutorial that attached weapons to units that allready had weapons, but there may be some of the other things.
     
  14. Archian

    Archian

    Site Director

    Joined:
    Jan 1, 2006
    Messages:
    2,686
    Resources:
    12
    Skins:
    1
    Tutorials:
    11
    Resources:
    12
    Perhaps not in the same thread, but it's there.

    Oh well, I'll just approve this anyway...
     
  15. tassadar10

    tassadar10

    Joined:
    Mar 10, 2008
    Messages:
    3
    Resources:
    0
    Resources:
    0
    Witch photo shop did you use?
     
  16. Archian

    Archian

    Site Director

    Joined:
    Jan 1, 2006
    Messages:
    2,686
    Resources:
    12
    Skins:
    1
    Tutorials:
    11
    Resources:
    12
    Adobe Photoshop CS2 or 3 :p
     
  17. konerboy

    konerboy

    Joined:
    Aug 1, 2007
    Messages:
    201
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    I used CS3 but Cs2 Gimp or any Image editing program which can save as tga and manipulate with alpha channels would do..
     
  18. DarkArrow23

    DarkArrow23

    Joined:
    May 14, 2008
    Messages:
    5
    Resources:
    0
    Resources:
    0
    You could have just used the buff instead of triggers, it's a lot faster.
     
  19. mato2

    mato2

    Joined:
    Apr 20, 2008
    Messages:
    468
    Resources:
    0
    Resources:
    0
    What about team colored weapons? You can't alpha them out
     
  20. konerboy

    konerboy

    Joined:
    Aug 1, 2007
    Messages:
    201
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    you can remove the team color but not the hero glow, but you won't be able to see that in-game