SC2Mapster Forums

Development > Triggers

Third Person Shooter (TPS) engine - Download if you need one

    #1 Aug 14, 2010 at 04:18 UTC - 1 like

    Third Person Shooter Engine

    Introduction

    This is my first post, and it's my first engine I've put together using the SC2 editor :)

    I thought I'd contribute to the map development section and share this with those who either do not have the knowledge, or time, to develop their own TPS engine.

    It took me a couple of days to actually make the engine work properly, and it's a pretty basic, but decent, third person shooter engine.

    Controls

    • Movement: WASD keys.
    • Shoot: Left Mouse button.
    • Zoom: Right Mouse button.
    • Reload: R key.
    • Flashlight: F key.

    YouTube demo-video

    Implement the engine into your own map

    1. Download the library from the attached files.
    2. Open up your map.
    3. Open the Trigger Editor.
    4. Click on View -> Show Libraries.
    5. Right click on the library field, select Library -> Import Library and choose the TPS Engine Library.
    6. Open the Data Editor, choose to filter Cameras and choose Default Camera.
    7. Delete all the zoom levels for the camera.
    8. Open the Trigger Editor and make sure you set the PlayerUnit variable to your main unit.
    9. If you want to be able to use the flashlight, go to File -> Dependencies, and press Add Standard and check Liberty (Campaign).
    10. Lastly, make sure you set the custom value 0 of every enemy unit that you're going to have on your map (owned by player 15 in this case) to the height of the unit (you'll have to play around with values here, since there's no way to otherwise get that information of a unit).

    That should be it. It should now work with your own map!
    Now it's just a matter of tweaking for your own liking.

    Note: A lot of people experience loss of trigger and variable names (seems to output: Syntax error at line 21) when implementing the engine or opening the map. I have no solution for it, and I don't even know what's causing it - it might be the localization that messes things up.

    Final words

    Feel free to use the engine in any map you make :)

    Last edited Jul 19, 2011 by martinolsson
    Name Size MD5
    TPS_Engine__Singleplayer_.SC2Map 56.5 KiB ae23e37f898e...
    TPS_Engine__Multiplayer_.SC2Map 60.4 KiB 5622a03d2552...
    TPS_Engine_Library.SC2Lib 289.5 KiB 6ddbc3f3c353...

    Check out my TPS Engine, free for anyone to use :)

    #2 Aug 14, 2010 at 05:23 UTC - 0 likes

    If I shoot something, will it deal damage?

    #3 Aug 14, 2010 at 06:03 UTC - 0 likes

    What do you mean by "it"? If you shoot a unit, that unit will take damage and it will die if you keep shooting.

    #4 Aug 14, 2010 at 07:42 UTC - 0 likes

    @martinolsson: Go

    This is a very impressive engine. Probably the best I have seen so far. I find the demo map oddly addicting. :D

    The only flaw i really noticed, though I did not test for very long, is that the unit lifts the barrel of his gun back up if you hold zoom for more than a couple seconds. This is merely cosmetic though.

    Overall, I am very impressed. Excellent work.

    @Galois1: Go

    You should probably test the attached map and find out. : P

    Last edited Aug 14, 2010 by Airolden
    #5 Aug 14, 2010 at 07:53 UTC - 0 likes

    Thank you ^^

    lol

    Banelings explode I love things that explode...

    #6 Aug 14, 2010 at 12:44 UTC - 0 likes

    @Airolden:

    Yes, there are minor animation problems. They are specific for the unit, though. One could solve the problems by choosing another unit, perhaps a custom one, or try to manipulate the animations using triggers. I also see this as a flaw, but nothing that can't be solved.

    I'm glad you all like it ^^

    #7 Aug 14, 2010 at 20:42 UTC - 0 likes

    there is a way to stop the lag make fog of war[edit: BLACK AND NOT SEE THOUGH] so the game wont need to look far away meening make a ring around the player to stop him from seeing far away the more area you look at the more it lags [yes this works]

    Last edited Aug 14, 2010 by chaosjones17

    say cheese.

    #8 Aug 14, 2010 at 22:57 UTC - 0 likes

    @chaosjones17:

    Are you really talking about latency delay here?
    Because I can't see how this would affect the latency at all, since (I guess) the fog-of-war isn't server-side, but client-side.

    #9 Aug 14, 2010 at 23:19 UTC - 0 likes

    i have seen how texture in terrain does infact make the game lagy online it does with every game try it and see have the fog of war be pitch black and lower seeing distance and you will understand realy it works

    #10 Aug 14, 2010 at 23:41 UTC - 0 likes

    @chaosjones17:

    I'll take your word for it :)
    Gonna give it a try!

    EDIT: Did not work, as I suspected. The fog-of-war and terrain sight distance are client-side.

    Last edited Aug 14, 2010 by martinolsson
    #11 Aug 14, 2010 at 23:57 UTC - 0 likes

    And i though i got a smooth camera ... you got my respect for this work

    thx

    #12 Aug 15, 2010 at 00:53 UTC - 0 likes

    you shoul make it a 4 man survive the waves map with a sniper, marine, medic and flamethrower guy medic should have heal is left click and shoot a crappy pistol as right click , while the others have shoot and zoom

    #13 Aug 15, 2010 at 00:59 UTC - 0 likes

    I like your coding, very clean :)

    Hero Selection Library v3.0.1 Final - Completely free to use and edit. Create a beautiful, fully featured hero selection in seconds.

    #14 Aug 15, 2010 at 01:08 UTC - 0 likes

    Thanks for your responses :) Much appreciated!

    About the survival suggestion: It's very much doable, but not without the lag that's been infesting every multiplayer TPS map :(

    I'm at a point where I'm unsure if I actually want to make a real TPS map, seeing it won't be playable online (at least for the time being). I could try to make a fun TPS singleplayer Outpost Defense though - shouldn't be that hard. The only sad thing is that singleplayer maps don't last for long.

    I want to start a larger map project, I just want to get a nice and doable concept first.

    #15 Aug 15, 2010 at 01:18 UTC - 0 likes

    but how do u add other playable characters so u can make a multiplayer map? and how can u add marine that uses a machine gun?

    #16 Aug 15, 2010 at 01:23 UTC - 0 likes

    I've already customized the engine (not uploaded anywhere) to handle 2 players, to actually see how bad the lag was on B.net.
    So if you want, I could upload the multiplayer engine as well.

    If you want to play as a Marine, just change the Ghost unit that's been placed on the map into a Marine unit (don't forget to set the PlayerUnit variable to the Marine instead), and edit the Shoot trigger to execute Gauss Rifle instead of Canister Rifle.

    EDIT: You could lower the AttackCooldown variable significantly and change the Shoot trigger to fire projectiles even when holding down the button (so you don't have to click all the time), if you want a more "real" machine gun.

    Last edited Aug 15, 2010 by martinolsson
    #17 Aug 15, 2010 at 01:41 UTC - 0 likes

    yea please can you upload the multiplayer engine :D me and a mate is going to learn how to make sc2 maps and liked the single player engine and want to try a multiplayer one

    #18 Aug 15, 2010 at 01:45 UTC - 0 likes
    Quote from martinolsson: Go

    If you want to play as a Marine, just change the Ghost unit that's been placed on the map into a Marine unit (don't forget to set the PlayerUnit variable to the Marine instead), and edit the Shoot trigger to execute Gauss Rifle instead of Canister Rifle.

    EDIT: You could lower the AttackCooldown variable significantly and change the Shoot trigger to fire projectiles even when holding down the button (so you don't have to click all the time), if you want a more "real" machine gun.

    how do you do that? :D

    #19 Aug 15, 2010 at 02:23 UTC - 0 likes

    @thomalk:

    I've updated the original post with the download link for the multiplayer map file.

    If you want to make a machine gun effect, you could make a periodic event where it checked if you are holding down the Left Mouse Button;

    - Create a variable called "Shooting", or something like that, and make it a boolean (set to false as default).
    - Create a trigger that checks for key presses and check for Left Mouse Button (pressed down), and set the variable "Shooting" to true.
    - Do the same with a trigger that checks for when Left Mouse Button is being pressed up, and set the variable to false.
    - Create a trigger with the Periodic Timing event (set it to...like...every 0.01 seconds - decide for yourself what you think is appropriate in your case), and check if the variable "Shooting" is true - if it's true, then make your unit execute Canister Rifle (Damage) or whatever weapon effect you want to use.

    This is at least how I would've begun if I wanted to make a machine gun, but perhaps there are better and smoother ways to do it.

    #20 Aug 15, 2010 at 02:35 UTC - 0 likes

    I have not tested it yet. Does this use a traceline or just shoot missiles? If its a traceline, I would love to implement this into my own TPS map Im currently working on.

    Feel free to Send me a PM if you have any questions/concerns!

You must login to post a comment. Don't have an account? Register to get one!