• 0

    posted a message on [Contest] Cut Scene

    Here's my submission.

    The "in-game" time goes over a little bit, but it's for the sc2mapster logo. Hope that's alright.

    Embed Removed: https://www.youtube.com/v/gEo0e68bnjk?fs=1

    http://www.sc2mapster.com/maps/cinematiccontest-deliverancelost/

    Posted in: Project Workplace
  • 0

    posted a message on [Trigger] WASD Movement: The "S" Key and You.
    Quote from BrotherLaz: Go

    I'm just wondering what's wrong with move unit instantly? That seems much simpler to me and as far as I tested it seems to work well.

    Edit: and you can cast on the move.

    In many situations the move instantly seems to work well. The major issue I have with it is that after you pass a certain speed, the movement gets really choppy. Also in my experience if you have any sort of code that changes unit speed (moving more slowly backwards, etc) The animation speed is not effected and it looks like your unit is trying to moonwalk.

    I can include a section on move instantly backwards movement if you like, honestly I didn't think about it when I wrote this tutorial.

    Posted in: Tutorials
  • 0

    posted a message on [Trigger] WASD Movement: The "S" Key and You.
    Quote from supersebbn: Go

    If u have time i would appreciate the maps :D sebbN

    There you go, hope that helps!

    Posted in: Tutorials
  • 0

    posted a message on [Trigger] WASD Movement: The "S" Key and You.

    Update: Both tutorial maps in place. Good luck with your projects! Hope this helps you out.

    This tutorial covers a couple different ways of implementing backwards movement in a third-person type map. There are already many tutorials on how to make a functioning WASD movement system and they are probably much better than I could do, so that will not be discussed here. I will give an overview of the trigger systems discussed, but I will be mostly covering the backwards movement part.

    Part 1: How the !@#% do I turn this thing around?!

    Tutorial map: Link Removed: http://www.mediafire.com/?qmnjjjymm2k

    So there you are, fighting off the incoming Zerg swarm with your grenade launchers, and suddenly you see Dick Cheney running towards you carrying a rifle and wearing an orange vest. You check your pockets and realize you have left your crucifix at home. There's only one option: turning him your !@#hole and elbows and hightailing it out of there. Turning your camera all the way around before you can run would put you right on the first page of the New York Times in the worst way. Times like this you need your "S" key to do one thing: make your unit turn and run in one keystroke.

    First, let's quickly go over my preferred trigger set for this type of movement. The images will speak for themselves. This is an 8 axis movement system that moves your unit in the direction pressed with respect to the camera facing. Global overview

    This is the overview of the global variables and the number of triggers. w down

    This is the trigger for moving forward. The key up triggers only set the variables as false. The A and D keys, if pressed with W, add 45 degrees to the direction of movement.

    Ok, now for what I promised you: s down

    As you can tell, this is very much like the "W down" trigger. The key difference is this line of code:

    Variable - Set Angle = ((Camera Yaw of Player(1)) + 180.0)

    This makes the local variable "Angle" point in the direction of the player camera. The rest of the trigger is the same as the forward movement one.

    The A and D movement triggers are exactly the same, they do not deal with turning the camera, that is done with the mouse. d down

    I know I said i wasn't going to spend so much time on the whole movement system, but there it is. If anyone wants me to upload a map with this movement system in it I will, just ask.

    Part 2: Back that thang up?

    Tutorial map: Link Removed: http://www.mediafire.com/?gwkoiqzwvn4

    Okay, my humor is getting worse and worse as it gets later, so I will spare you. Developing an S movement trigger where the unit did not turn around gave me fits, and looking back I am not sure why. I haven't seen much of this, but I think it is important. It's more like MMORPG movement systems where you don't want the unit to turn completely around especially if its abilities are only usable in front of it.

    This is the type of system I am using in my Mechwarrior: Revival map. I don't want to post the whole triggers before I release a playable demo of it, but we can start from scratch.

    I had to have the unit move backwards without turning around because slow turning and only being able to attack in front of the mech is a vital part of the mechanics. If pressing S instantly turned the unit around, then it wouldn't be anything like mechwarrior.

    Let's start at the beginning, Create some boolean globals for W, A, S, and D. Set up your triggers for making the variables true when the key is pressed down, and false when it is pressed up. Something like this:

    a down

    Events

    UI - Player Any Player presses A key Down with shift Allow, control Allow, alt Allow

    Local Variables

    Conditions

    Actions

    Variable - Set a down = true

    a up

    Events

    UI - Player Any Player presses A key Up with shift Allow, control Allow, alt Allow

    Local Variables

    Conditions

    Actions

    Variable - Set a down = false

    Ok, now that we have that, create a real global variable and name it "facing angle" Create another variable for the unit you want your player to control and declare it. I will just refer to it as "Unit" from this point on.

    Next, create a trigger that looks like this:

    move point

    Events

    Timer - Every 0.01 seconds of Game Time

    Local Variables

    Conditions

    Actions

    Unit - Make Unit face facing angle over 0.0 seconds

    Notice the rate at which the game corrects the facing angle of the unit. This is mandatory. The game engine makes the unit face the direction in which it is moving automatically. The trigger has to correct the angle as often as possible to keep the unit from turning around.

    It is important for me to mention the triggers for turning, as this is not a common movement system.

    turn right

    Events

    Timer - Every 0.01 seconds of Game Time

    Local Variables

    Conditions

    d down == true

    Actions

    Variable - Set facing angle = (facing angle - 0.5)

    Changing the "0.5" will change the rate at which the unit turns. A higher number will make the unit turn faster, and visa versa. The turn left trigger is the same, except the value is added to the facing angle, not subtracted. The periodic timing has to be very constant, as before, to make the movement look smooth.

    Now for the good stuff, the backwards movement.

    reverse

    Events

    Timer - Every 0.5 seconds of Game Time

    Local Variables

    Conditions

    s down == true

    Actions

    Unit - Set Unit Movement Speed to 1.0

    Unit - Order Unit to ( Move targeting ((Position of Unit) offset by -1.0 towards (Facing of Unit) degrees)) (Replace Existing Orders)

    The movement speed change is optional. If you don't want the unit to move backwards more slowly than it does forwards you can omit it. Remember if you use it to place a similar line of code in the W down trigger that resets the units movement speed to its original value everytime you press W.

    I think that should do it. Again, if anyone wants map files with these systems in them just ask and I will upload some.

    Hope this helps everyone!

    Posted in: Tutorials
  • To post a comment, please or register a new account.