1. Melee Mapping contest #3 - Poll is up! Vote for the best 4v4 melee maps!
    Dismiss Notice
  2. The 30th edition of the Modeling Contest is finally up! The Portable Buildings need your attention, so come along and have a blast!
    Dismiss Notice
  3. We have a new contest going on right now! Join the 11th Music Contest! You are to make a Cinematic modern sound-track for this contest, so come and compete with other people for fun.
    Dismiss Notice

Remove Item Shadow

Discussion in 'General Mapping Tutorials' started by Imadori, Dec 21, 2014.

  1. Imadori

    Imadori

    Joined:
    Oct 8, 2012
    Messages:
    139
    Resources:
    9
    Icons:
    5
    Spells:
    2
    Tutorials:
    2
    Resources:
    9
    Remove Item Shadow

    • Read Me:

      About this Method:

      * Use this method if you want to hide absolutely all items' shadows in your map.
      * It's best to use this method before you start modifying the Gameplay Constants.
      * The testmap available below is made for the second method. This is too simple already.

      Warning:

      * This method is detrimental if you have already heavily modified the Gameplay Constants, because once you save and reopen your map, it completely resets all values to default.
      There are some things you can do to avoid that, but I won't discuss it here since it's a completely different topic.

      The requirements needed for this method:
      • Notepad, or any text editing software
      • Basic importing skills
      Method A:

      1.) Create .txt File:
      * Open Notepad or any other text editing software. Save the empty note and name it war3mapMisc.
      2.) Edit Text:
      * Now edit it. Copy and paste the code below, and save it again.
      Code (Text):
      [Misc]
      ItemShadowFile=Null
      * If you want to undo it, just follow this method again, except you put ItemShadowFile=Shadow instead.
      Code (Text):
      [Misc]
      ItemShadowFile=Shadow
      3.) Import:
      * After that just import that war3mapMisc.txt in your map. By then, its name in the Import Manager will be "war3mapImported\war3mapMisc.txt". Double-click to rename and erase the "war3mapImported\" part.
      4.) Reload the Map:
      * Save your map and close it. Then re-open that map. Put some items on the ground and press CTRL+F9 to test, it should be working by now.
      5.) Delete Note:
      * Delete the war3mapMisc.txt you just imported earlier. Its job is finished, you don't need it anymore.

      * If you don't delete it, any modification in Gameplay Constants except ItemShadow will not apply, since that .txt will always overwrite those changes to default.
      Done! Save the map!​

    • Read Me:

      About this Method:

      *
      Use this method if you want to hide only a specific number of shadows.
      * This method only works for trigger created items, so plan ahead.
      * The test map is like an extension of this, I recommend you to download it for clarification.
      * Works on units.

      Warning:

      * If you don't follow the steps carefully, you might experience the selection circle bug. Which causes selection circles of random units and items to be misplaced or not appear sometimes.

      The requirements needed for this method:
      • Basic knowledge of GUI Triggering
      Method B:

      1.) Dummy Item:
      * If your map already contains at least one item (on the ground, not carried), then skip this step.

      * Put one Item inside the map (any type will do; i.e. Cheese, Boots of Speed), doesn't matter where you put it since you'll be hiding it for the rest of the game anyway.

      * Open the Trigger Editor. In your [​IMG]Map Initialization trigger, hide that item:
      • Events
        • Map initialization
        • Conditions
        • Actions
          • Item - Hide Cheese 0001 <gen>

      2.) Destroy Image:
      * Whenever you attempt to create a shadowless item, you must first destroy the last created image:
      • Image - Destroy (Last created image)

      Why? I have no idea. What I only know (for now) is that, the 4th Step won't work unless you do this. If someone has a clue, please do tell.
      3.) Create Item:
      * Create the item you want but do not give it to a Hero/Unit yet. Just create it from point.
      • Item - Create Starfish at (Position of HERO)

      4.) Make Image Invisible:
      * After you create an item you'll need to make the last created image (destroyed earlier) invisible.
      • Image - Change the color of (Last created image) to (0.00%, 0.00%, 0.00%) with 100.00% transparency

      Don't bother changing the color, doesn't work on shadows anyway.
      It should look like this:
      • Image - Destroy (Last created image)
      • Item - Create Starfish at (Position of HERO)
      • Image - Change the color of (Last created image) to (0.00%, 0.00%, 0.00%) with 100.00% transparency


      If you skipped the 1st Step because you have more than one item proceed to Step 5,
      otherwise, you're done.


      5th Step - Find the Dummy:
      * Make sure you're able to create at least one shadowless item in-game (either by events or Map Initialization).

      * Save and Test your map. Create a shadowless item (assuming you didn't on Initialization). Among the map's starting items, find the one that doesn't have a shadow.

      * After finding, quit the game, open Trigger Editor in WE, and hide that item in
      [​IMG]Map Initialization trigger, just like what I did on the 1st Step.
      Now you're done for real!

     

    Attached Files:

    Last edited: Jan 6, 2018
  2. BlueSaint

    BlueSaint

    Joined:
    Jun 18, 2012
    Messages:
    2,708
    Resources:
    3
    Tools:
    1
    Spells:
    2
    Resources:
    3
    This is such a hack you've found out ^^
    It even works with:
    Code (vJASS):
        call DestroyImage(null)
        call CreateItem(u,x,y)
        call SetImageColor(null,0,0,0,0)
     
  3. Anvil

    Anvil

    Joined:
    Jun 8, 2011
    Messages:
    466
    Resources:
    9
    Models:
    6
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    9
    You can hide these shadows adding to war3mapMisc.txt this line:

    Code (vJASS):
    [Misc]
    ItemShadowFile=Null

    Default value is ItemShadowFile=Shadow

    You can replace "Null" with any shadow. (See Shadows folder, path "ReplaceableTextures\Shadows\")


    You can set the size/position if needed too:

    Code (vJASS):
    [Misc]
    ItemShadowSize=120,120
    ItemShadowOffset=50,50


    If war3mapMisc.txt is not present in your map, you can create one.
    This file appears when you modify the gameplay constants under Advanced/Gameplay Constants.
     
  4. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,418
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    If you would like, you could just update the guide with Anvil's method, and leave the rest as a separate section for removing a specific item/unit's shadows. I doubt very many people know about the image trick--I've personally only used it once, but it was useful to know for the issue I was having.

    Anyway, the tutorial is organized quite well, it would be a shame to have to graveyard it. :p
     
  5. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,414
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    Both methods got one advantage over each other.

    Using miscdata will make every item shadow in the map go away, but you might want the shadow on certain items for whatever reason.

    You could cover both.
     
  6. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,438
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    This doesn't need to be graveyard-ed, it allows fullsome control over item shadows.

    Edit: Almost full control... Just selection circles can randomly appear on items.
     
    Last edited: Feb 28, 2015
  7. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,418
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    Can you explain when this issue happens? If that happens, then the tutorial may need an adjustment.
     
  8. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,438
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    Nothing can be done really since we lack detection for this kind of thing. People will just see random selection circles once in a while.
     
  9. Imadori

    Imadori

    Joined:
    Oct 8, 2012
    Messages:
    139
    Resources:
    9
    Icons:
    5
    Spells:
    2
    Tutorials:
    2
    Resources:
    9
    Did you put an item inside the map and hid it just like said in the tutorial?
    That one item should not be detectable by the mouse, otherwise the selection-circle bug will happen.
     
  10. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    5,827
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    @Imadori
    Do you want to include the tequinique to easily remove shadows for all items with the import? It might be useful to share, too.
     
  11. Imadori

    Imadori

    Joined:
    Oct 8, 2012
    Messages:
    139
    Resources:
    9
    Icons:
    5
    Spells:
    2
    Tutorials:
    2
    Resources:
    9
    Well the thing is, I think the all-method overshadowed the tutorial completely. Even I switched to using it. Misc method should be naturally the main and best way right, and should be put at the top.
    And the method I introduced will be just an alternative. But having an alternative which is more of a pain and takes longer to set up, I don't see why it's useful now.

    If I should rewrite it, it'll be like writing a tutorial that I didn't came up with, so I'm worried about that.

    Edit: Updated.
     
    Last edited: Nov 23, 2016
  12. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    5,827
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    It's good to show a method how to remove the shadow from a specific item.:) Both tequiniques together would be perfect imo.
     
  13. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    5,827
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    The introduction's list looks a bit wild. Both methods are listed after each other between introduction list-elements, and even
    the method's steps/description is also listed in same order. Use indentions or sub-lists, or something to point out the structure.

    I think it's on a good way then. Could you provide a .txt file attachment to your tutorial as example?
     
  14. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    5,827
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    Submission: Remove Item Shadow
    Date: 23 Jan 17
    Status: Approved
    Note:

    I would like you to make the tiny changes mentioned in the post above.
    Though, I think it's already in an aproveable state, and worth a tutorial.
     
  15. Wark

    Wark

    Joined:
    Oct 12, 2016
    Messages:
    738
    Resources:
    2
    Maps:
    2
    Resources:
    2
    I noticed a problem with the first method:
    it automatically cancels out specific modified gameplay constants in the editor, such as max hero level.
    I have no idea why it does that.
     
  16. Imadori

    Imadori

    Joined:
    Oct 8, 2012
    Messages:
    139
    Resources:
    9
    Icons:
    5
    Spells:
    2
    Tutorials:
    2
    Resources:
    9
    Ah. Delete the imported war3mapMisc.txt. I think it's only needed once after save and closing your map, then after reopening again, you can delete it.


    If it doesn't work here's what you hafta do:
    First, open Gameplay Constants and put a check on the Display Values As Raw Data.[​IMG]
    [​IMG]

    Notice that the names change.
    Now, while it is checked. Find the RAW name that you want to modify.
    Add it on the war3mapMisc.

    Code (Text):
    [Misc]
    ItemShadowSize=120,120
    ItemShadowOffset=50,50
    MaxHeroLevel=25
     
    Then replace the one you imported before.
     
  17. Wark

    Wark

    Joined:
    Oct 12, 2016
    Messages:
    738
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Alright Imadori, the second thing worked.

    This method is detrimental you you heavily modify the gameplay constants, since once you save it then reopen the map it completely resets all values to default.
    You might want to add a warning about that, and append that second method (specifically, you'll need to copy raw data for all modified values).
     
  18. Imadori

    Imadori

    Joined:
    Oct 8, 2012
    Messages:
    139
    Resources:
    9
    Icons:
    5
    Spells:
    2
    Tutorials:
    2
    Resources:
    9
    Updated!
     
  19. SpiritTauren

    SpiritTauren

    Joined:
    Mar 10, 2009
    Messages:
    109
    Resources:
    1
    Skins:
    1
    Resources:
    1
    Bless you for this wonderful discovery! A word of advice to ppl: saving your modifications to constants/interface in a spare map copy/txt file etc. is always a good idea, no matter what. Always back up your maps, especially large projects.