1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Make Spacebar center on Hero

Discussion in 'World Editor Help Zone' started by Recklessness, Dec 28, 2019.

  1. Recklessness

    Recklessness

    Joined:
    Aug 17, 2014
    Messages:
    81
    Resources:
    0
    Resources:
    0
    Good morning,

    I have been looking around for a trigger or maybe someone knows a simpler way of making it so when u press spacebar the camera centers on your hero 1 similarly to what F1 does. Is that possible? I am in the middle of finishing a MOBA and that is one of the last things I want for it.
     
  2. FeelsGoodMan

    FeelsGoodMan

    Joined:
    Dec 13, 2018
    Messages:
    1,055
    Resources:
    2
    Maps:
    2
    Resources:
    2
    I don't think there is any way to register a spacebar key, unfortunately. I might be wrong, but I have never seen it.

    I found two different ways to achieve what you want without using the normal hotkeys. One of them uses spacebar, the other one uses backspace.

    For spacebar: Allow local files in your registry, make a folder in your Warcraft 3 root directory called "Units" and then throw this file in there. This allows you to register hotkeys as strings. Register 32 for space bar. This however requires you to have your unit selected to work, and it will take up an ability slot.

    For backspace: Simply convert a town hall into a dummy unit and constantly move it to your hero. Then every time you click backspace the camera will instantly pan to your hero.

    Here are two maps with both solutions.
     

    Attached Files:

    Last edited: Dec 28, 2019
  3. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,451
    Resources:
    18
    Tools:
    2
    Maps:
    3
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    18
    There is an action in camera to change the point the camera jumps to when pressing spacebar.
     
  4. Insanity_AI

    Insanity_AI

    Joined:
    Jun 30, 2017
    Messages:
    30
    Resources:
    0
    Resources:
    0
    Code (Text):
    constant oskeytype              OSKEY_SPACE                          = ConvertOsKeyType($20)
    Spacebar Detection by TriggerHappy

    There are 2 options.
     
  5. FeelsGoodMan

    FeelsGoodMan

    Joined:
    Dec 13, 2018
    Messages:
    1,055
    Resources:
    2
    Maps:
    2
    Resources:
    2
  6. Insanity_AI

    Insanity_AI

    Joined:
    Jun 30, 2017
    Messages:
    30
    Resources:
    0
    Resources:
    0
    To further elaborate on @Tasyen 's post, you should do something like this:
    Screenshot_2.png
     
  7. Sabe

    Sabe

    Joined:
    Jul 30, 2018
    Messages:
    431
    Resources:
    1
    Spells:
    1
    Resources:
    1
    There's an action:
    • Camera - Set a spacebar-point for (Picked player) at TempPoint
     
  8. Recklessness

    Recklessness

    Joined:
    Aug 17, 2014
    Messages:
    81
    Resources:
    0
    Resources:
    0
    @FeelsGoodMan @Tasyen @Insanity_AI @Sabe

    Thanks guys I will try it out. I think my simplest solution would be that gui format I had seen that before in the trigger editor, but never bothered to mess with it cant believe I ignored it. Appreciate it! Thanks all!