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. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    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.

[Trigger] How would this be done?

Discussion in 'Triggers & Scripts' started by Deleted member 177737, Jan 11, 2012.

  1. Hey, I'm currently working on a little SRPG hero selection system and I would like to add a little cosmetic feature but I'm not exactly sure how.

    I'm trying to make it so that when the player holds down the left arrow key the hero turns left, when the player holds down the right arrow key the hero turns right, and when either the left or right is released the hero stops spinning. I also want to include a trigger to reset the hero to his original facing.

    This was my test trigger which woulden't work because the hero is using a "Maximum Pitch Angle of -270" so when the facing changes he just spins around in a circle while staring at the camera.
    • Turn Hero Left
      • Events
        • Player - Player 1 (Red) Presses the Left Arrow key
      • Conditions
      • Actions
        • Unit - Make Hero face ((Current turn speed of Hero) - 5.00) over 0.10 seconds
        • Wait 0.01 seconds
        • Trigger - Run (This trigger) (checking conditions)


    I need to find a way to make him spin <-> instead of in a circle.


    Edit:

    Here is what it looks like so far, this might help you figure out what I'm talking about with what direction the hero is supposed to spin. http://www.youtube.com/watch?v=pFcoGDHjxpA
     
    Last edited by a moderator: Jan 12, 2012
  2. Global_idiot

    Global_idiot

    Joined:
    Aug 16, 2007
    Messages:
    212
    Resources:
    0
    Resources:
    0
    You'd need two triggers for this... I'm to lazy to explain, so I'll just make you the trigger.

    Amm.. just a question, does this run for some specific unit or it should work for multiple units? If so You'll just need to add some sort of condition.

    Well I was to lazy to make variables for both triggers, so i used the same, you should fix that to make it work smoother ;)

    press left- turns one way
    press right - turns the other way
    press up ressets the camera

    Hope this is helpful.
     

    Attached Files:

    Last edited: Jan 12, 2012
  3. It is helpful for most of the trigger, but I'm trying to get the unit to spin on the other axis. (This is hard to explain...)

    Your guy is spinning around in a circle on the Z-axis, I need my hero to spin on the X or Y-axis (I'm pretty sure its X-axis).
     

    Attached Files:

  4. Global_idiot

    Global_idiot

    Joined:
    Aug 16, 2007
    Messages:
    212
    Resources:
    0
    Resources:
    0
    So why don't you just create a camera, to set it to a normal view?

    so unit on your map is like this and you want it to turn in the arrow direction(colored red)

    *its 5 in the morning and my brains are pretty much dead :p
     

    Attached Files:

    • xyz.png
      xyz.png
      File size:
      21 KB
      Views:
      86
  5. I get what your saying but I cant do that because the interface, floating text, and background wouldn't show properly. The whole problem is trying to figure out how to use the other axis =/
     
  6. MajorKaza

    MajorKaza

    Joined:
    Nov 19, 2011
    Messages:
    511
    Resources:
    1
    Maps:
    1
    Resources:
    1
    1st: your trigger will loop til the end of world. (You are running it after each end when there is no conditions!).

    2nd: Why don't you lock camera on ground?
     
  7. shadowvzs

    shadowvzs

    Joined:
    Nov 13, 2006
    Messages:
    1,803
    Resources:
    2
    Spells:
    2
    Resources:
    2
    1. Trigger - Run (This trigger) (checking conditions)

    its mean its repeat only if arrow key is pressed

    just a question, what it do the Caster_SetZAngle?

    (a ideea, u can lock ur unit body to a unit what could rotate around ur hero, idk if work but its kinda different the make unit face angle but it also crap since leggs dont moveing (i tryed, but exclude that its work how u want :D) )
     
    Last edited: Jan 13, 2012
  8. Tirlititi

    Tirlititi

    Joined:
    Jul 11, 2010
    Messages:
    396
    Resources:
    12
    Models:
    6
    Maps:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    12
  9. shadowvzs

    shadowvzs

    Joined:
    Nov 13, 2006
    Messages:
    1,803
    Resources:
    2
    Spells:
    2
    Resources:
    2

  10. The trigger at the top was meant to loop so I could see if the unit would rotate properly. (It has nothing to do with how it will be triggered after I figure out how to rotate the unit the way I want)

    The camera is locked on the ground in another trigger.

    I still don't think I'm explaining how I want this to work properly... I've attached another picture that will hopefully show you what I want it to do.


    EDIT: Just saw the post above with http://www.thehelper.net/forums/showthread.php/145620-How-to-set-Yaw-and-Pitch-for-a-Unit going to see if it will work.
    EDIT2: That method won't work, I don't plan on messing with any of the models I'm using and I cant use Jass.


    That would mean micro adjusting every doodad, dummy unit, and floating text. If this means doing that I'll just leave it out.
     

    Attached Files:

  11. MajorKaza

    MajorKaza

    Joined:
    Nov 19, 2011
    Messages:
    511
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I got alredy this. Only thing that I don't know is how to change camera angle. But it looks like its rotateing like you wanted. Only pin it to right events and find someone whose native language is english. Maby he would know how to change angle.
     

    Attached Files:

  12. All that is happening on your map is that the camera is rotating. I want the unit to rotate not the camera.
     
  13. MajorKaza

    MajorKaza

    Joined:
    Nov 19, 2011
    Messages:
    511
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Now it works like you wish and is more simple. Still don't know how to change camera angle to pin it on center of START<gen> with faceing on unit face (not feet).
     

    Attached Files:


  14. It's spinning exactly the same as the other maps above, I neeed it to spin on the other axis not go around in circles.
     
  15. MajorKaza

    MajorKaza

    Joined:
    Nov 19, 2011
    Messages:
    511
    Resources:
    1
    Maps:
    1
    Resources:
    1
    So I don't understand you. Do you want to see his feet from ground??
     
  16. Arhowk

    Arhowk

    Joined:
    Aug 8, 2007
    Messages:
    2,752
    Resources:
    0
    Resources:
    0
    I see what he did, (i hope) he rotated the model so that the Z-axis performs as the X-axis

    @Major - On the testmap, the footman would appear to be doing a backflip
     
  17. shadowvzs

    shadowvzs

    Joined:
    Nov 13, 2006
    Messages:
    1,803
    Resources:
    2
    Spells:
    2
    Resources:
    2
    i drawed to u :p
     

    Attached Files:

    • 1.jpg
      1.jpg
      File size:
      45.5 KB
      Views:
      52
  18. The second image on the top of the picture is exactly what I want.