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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  4. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  5. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  6. 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.

Arrow Key Movement / Camera System

Discussion in 'Trigger (GUI) Editor Tutorials' started by OneEight7even, Nov 15, 2007.

  1. Worldedit10

    Worldedit10

    Joined:
    Aug 4, 2008
    Messages:
    17
    Resources:
    0
    Resources:
    0
    Can u make a video of this tutorial cuz there is something i cant do.
    ill show u the picture

    http://img140.imageshack.us/img140/470/jkbl0.png

    i cant get Unit - Order PlayersHero[(Player number of (Picked player))] to Move To (TempPoint[(Player number of (Picked player))]

    its offset by 90.00 towards (Facing of PlayersHero[(Player number of (Picked player))]) degrees) i cant do
     
  2. RiskDude

    RiskDude

    Joined:
    Jul 18, 2008
    Messages:
    53
    Resources:
    0
    Resources:
    0
    is there any map with 3rd camera included i really wanna see how it is cuz im noob at AI :p PLEASE!!
     
  3. Worldedit10

    Worldedit10

    Joined:
    Aug 4, 2008
    Messages:
    17
    Resources:
    0
    Resources:
    0
    There are many maps with 3rd cam, its easy to fix it but the hard part is to but in triggers so you can play by the keyboard.

    YouTube - How to make a 3rd person camera tutorial wc3

    there is a tutorial to put third cam to ur map.
     
  4. RiskDude

    RiskDude

    Joined:
    Jul 18, 2008
    Messages:
    53
    Resources:
    0
    Resources:
    0
    10x i saw it yesterday ;) now its piece of cake for me to make it :X
     
  5. RiskDude

    RiskDude

    Joined:
    Jul 18, 2008
    Messages:
    53
    Resources:
    0
    Resources:
    0
    yes you can, you just change the hot keys from the attack and stop with whatever you want and then change the arrow keys with WASD keys. It's a video on youtube that a german made it but it has an error on the triggers.
     
  6. XShooterX

    XShooterX

    Joined:
    Jan 21, 2008
    Messages:
    25
    Resources:
    0
    Resources:
    0
    Nice Tutorial, easily done and usefull for many maps (in my opinion)
     
  7. RedFlash

    RedFlash

    Joined:
    Oct 8, 2008
    Messages:
    199
    Resources:
    0
    Resources:
    0
    How can I make my hero turn faster like if I just tap the key instead of holding it for 1 second
     
  8. xXx-Tricky-xXx

    xXx-Tricky-xXx

    Joined:
    Jun 20, 2004
    Messages:
    234
    Resources:
    3
    Icons:
    1
    Maps:
    2
    Resources:
    3
    arrow keys dont really work well with frequent pressing as it takes a little bit longer for it to recognize its being pressed compared to a traditional ability being casted when a hotkey is pressed. But you can simply just add an extra turning mechanism but place it on the triggers with the pressing events. Tapping would probably work without that if the periodic ran at .01 instead but probably is not needed for a third person view. It most definitely needed for a first person view as everything has to be as precise and exact as possible. And anyone who says using cameras that run at .01 is laggy and not needed is an idiot and has no clue what they are talking about. There is a miracle worker out there for maps based on keyboard detection and its called ListChecker. Simply start the map through LAN, then use the Bnet connection command and your hosting at LAN settings but people on Bnet can access it therefor when the map starts the delay is reduced by more than half.

    if you are making a first person oriented camera control, then I would recommend doing away completely with the move to point command and use a sliding effect with index animations so you are not actually sliding and looks like a legit movement. WASD isnt impossible, but press and release detection is. Instead you have to improvise and be creative. Use the arrow keys to move forward, backward, and left and right to strafe and you have a very accurate FPS movement. Then use WASD to look left, right, up, and down by tapping them. It can feel very awkward at first but it is definitely the most efficient way without problematic trackables and quickly becomes easy to get the hang of if done correctly.
     
  9. RedFlash

    RedFlash

    Joined:
    Oct 8, 2008
    Messages:
    199
    Resources:
    0
    Resources:
    0
    Hmm would this arrow key system would be okay for like a game your hero is faces numerous number of enemies though? Like armies, gangs of heros etc
     
  10. Andser

    Andser

    Joined:
    Jan 25, 2011
    Messages:
    56
    Resources:
    1
    Maps:
    1
    Resources:
    1
    There's a better way i already saw somewhere (on hive), because you can't play the units walk animation using gui --- you must use CustomScript
    call SetUnitAnimationByIndex(udg_UNIT,X)
    X = Animation number, not all units have the same number for the walk animation so you will have to find out which one it is.
    udg_UNIT = UNIT is a variable (you can call it whatever), it plays the walk animation of the unit which is saved in the variable.
    Next:
    the Move Unit Instantly is also buggy (of course because it is GUI), use this:
    1. Create 2 variables (for example tempX and tempY) type = Point
    2. when the trigger runs (the one which moves the unit) save the point where the unit is going to move into the variables (X, Y)
    • Set tempX = (X of ((Position of UNIT) offset by SPEED towards (Facing of UNIT) degrees))

    and
    • Set tempY = (Y of ((Position of UNIT) offset by SPEED towards (Facing of UNIT) degrees))

    in this case SPEED is the amount of points the unit will move (i used acceleration which is a bit more harder to make, it only needs time) but for a normal movement speed use this: Unit_Speed/(1/Periodic time in the event)
    its around 12 if the unit has a movement speed of 400 and the trigger runs every 0.03 seconds.
    Then, after the position of the unit is saved into variables you have to use 2 custom scripts:
    call SetUnitX( udg_UNIT, udg_tempX) ---> write there the name of the variable you used in my case it was tempX
    call SetUnitY( udg_UNIT, udg_tempY) with this the same.

    You can add an action right into the trigger which runs the rotation.
    • Forward
      • Events
        • Player - Player 1 (Red) Presses the Right Arrow key
      • Conditions
      • Actions
        • Unit - Make UNIT face ((Facing of UNIT) - 30) over 0.10 seconds
     
  11. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,378
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    ^Forgive him, it's 7 years old.
     
    Last edited: Apr 10, 2014
  12. Andser

    Andser

    Joined:
    Jan 25, 2011
    Messages:
    56
    Resources:
    1
    Maps:
    1
    Resources:
    1
    7 years old, so the moderators can close it, I wrote what was needed to make it better and that's all.