Raised This Month: $51 Target: $400
 12% 

[ANY?] Tracktrains - Doors/Elevators/Animated Trains [V2.5 - Oct 9, 2019]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Stugger
Member
Join Date: Sep 2007
Plugin ID:
6723
Plugin Version:
Plugin Category:
All
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 09-18-2019 , 08:57   [ANY?] Tracktrains - Doors/Elevators/Animated Trains [V2.5 - Oct 9, 2019]
    Reply With Quote #1

    Description:
    The main idea behind this was to implement custom elevators and sliding doors in-game. Create multiple func_tracktrain systems; each on their own set of path_tracks. You can set the model, sound, animation, speed, height and orientation of each tracktrain as well as optionally attach one or multiple buttons resulting in the train toggling off and on when pressed. If you don't like the way a train is setup, you can edit it and restart it or optionally; delete it. If you don't want to lose a train you've spent time making, you can save it under an alias and later load it on the same map you saved it on, under the alias you saved it as. There are multiple uses for this, a few examples would be sliding doors and elevators attached to buttons or animated models on a path.

    Demo (V2.5) -Command Usage, NPC, Helicopter, Save/Load


    Video of v1.7 (Buttons, Elevator, Sliding Door, Train)
    Spoiler


    Credits:
    Mehis from this post

    General Notes:
    • You can get my GrabEnt plugin for a method to move and rotate the track props (cans), buttons, train props or any grab-able entity.
      ---
    • Admin isn't required, but you can set the flags if wanted.
    • CS:GO button is set to fire extinguisher, I have no idea of any models for CS:GO other than a few shared with CS:S.
    • The max train limit per player is 5, each train can have a maximum of 15 path_tracks and 2 buttons.
    • All the max values can be changed in the variable declarations near the top of the .sp

    Use Notes:
    • Settings can not be changed and buttons/tracks can not be added to a train while it is active. These must be done before sm_train_start WITH ONE EXCEPTION: sm_train_animation can change the animation of a train in motion by adding an additional argument of train# - sm_train_animation <train#> <animation>
    • If a button is not attached to a train, it will infinitely loop from the last track back to the first.
    • You need a minimum of two tracks placed and a model set in order to start a train, the rest of the settings are optional.
    • If your train model appears too low or too high from the tracks, you can set the height with sm_train_height.
    • You can only save a train that is started, and you can only load a train that was saved on the same map.

    Commands:
    Code:
    • sm_train_track > *TWO REQUIRED TO START* > Spawn a path_track prop for the current train you're working on. > These are what the tracktrain entity will follow.
    • sm_train_button > OPTIONAL > Spawn a button for the current train you're working on. > The train will toggle off/on when pressed, as well as move from one end to the other end of the track in forward/reverse. _________________________________________________________________________________________________
    • sm_train_model <model path> > *REQUIRED TO START* > Set the model of the current train you're working on. > You can set a model through the argument, example: "models/combine_helicopter.mdl" > OR you can look at a prop and steal its model path by leaving the argument blank.
    • sm_train_sound <sound path> > OPTIONAL - DEFAULT: NONE > Set the sound of the current train you're working on. > Choose a sound from path, example: "npc/attack_helicopter/aheli_rotor_loop1.wav" > Disable sound with any one of these arguments: "none" or "off" or "0"
    • sm_train_animation <animation> > OPTIONAL - DEFAULT: NONE > Set the animation sequence of a train. > Unlike other settings you can use this on a train in motion by adding an additional argument of train# - sm_train_animation <train#> <animation> > Not all models have animations and you'll need to know the name of the animation, example: "cwalk_pistol" > Disable animation with any one of these arguments: "none" or "off" or "0"
    • sm_train_speed <1-2000> > OPTIONAL - DEFAULT: 80 > Set the travel speed of the current train you're working on.
    • sm_train_height <-1000 to 1000> > OPTIONAL - DEFAULT: 0 > Set the height of which the current train you're working on will ride above/below the tracks.
    • sm_train_orientation <0-3> > OPTIONAL - DEFAULT: 0 > Set the turn type of the current train you're working on, this will determine how or if the train turns. > 0 - Never turn (elevators/doors) 1 - Turn near the next path 2 - Linear Blend 3 - Ease in and out _________________________________________________________________________________________________
    • sm_train_start > *REQUIRED: Model set and 2+ Path_Tracks spawned* > Start the current train you're working on.
    • sm_train_edit <train#1-5> > Edit the track, buttons and settings of the selected train. > You can select a train through argument via train# > OR you can select a train by looking at one and leaving the argument blank. > Train will need to be started again when finished editing.
    • sm_train_delete <train#1-5> > Delete the tracktrain system of the selected train. > You can select a train through argument via train# > OR you can select a train by looking at one and leaving the argument blank. > Deletes everything associated with the selected train, this is permanent unless saved. _________________________________________________________________________________________________
    • sm_train_save <train#1-5> <alias> > The command takes two arguments: First the index of the train being saved and second, the alias(savename). > Save the selected train to a file under an alias of your choice and load it later. > If the save already exists, it will be overwritten > The train you are saving must be active(started).
    • sm_train_load <alias> > Load a train from an alias that you have saved. > You must be on the same map that you saved the train on.
    • sm_train_saves > Print a list of aliases of any saves you have on the current map.
    Installation:
    • **FROM THE ZIP FILE**
      1. Open the zip file and go into the sourcemod folder
      2. Put the tracktrains folder in your servers sourcemod folder: GAME/addons/sourcemod/
      3. Put the TrackTrains.smx in the plugins folder: GAME/addons/sourcemod/plugins/
      4. Put the TrackTrains.sp in the scripting folder: GAME/addons/sourcemod/scripting/
      ----
    • **WITHOUT THE ZIP FILE**
      1. Create a directory tree tracktrains/saves in your servers sourcemod folder: GAME/addons/sourcemod/tracktrains/saves
      2. Steps 3 and 4 from above
      ----
    • NOTE: The tracktrains/saves directory tree is only required if you plan on using the save/load commands

    Todo:
    Spoiler


    CHANGELOG:
    Spoiler
    Attached Files
    File Type: sp Get Plugin or Get Source (TrackTrain.sp - 834 views - 55.9 KB)
    File Type: zip TrackTrainV2.5.zip (43.5 KB, 258 views)

    Last edited by Stugger; 10-17-2019 at 23:14. Reason: Changed post around a little
    Stugger is offline
    backwards
    AlliedModders Donor
    Join Date: Feb 2014
    Location: USA
    Old 09-18-2019 , 12:36   Re: [HL2DM/CSS/CSGO] Create Tracktrains In-Game
    Reply With Quote #2

    This is cool, nice job!
    __________________
    I highly recommend joining the SourceMod Discord Server for real time support.
    backwards is offline
    zwolofmeister
    Member
    Join Date: Aug 2018
    Old 09-18-2019 , 12:41   Re: [HL2DM/CSS/CSGO] Create Tracktrains In-Game
    Reply With Quote #3

    Time to code Subway Surfer in CS:GO!
    zwolofmeister is offline
    XHUNTERX
    Senior Member
    Join Date: Aug 2019
    Location: World
    Old 09-19-2019 , 13:00   Re: [ANY?] Tracktrains V1.5 - Doors/Elevators/Trains
    Reply With Quote #4

    very good plugin
    thank you
    XHUNTERX is offline
    andi67
    Veteran Member
    Join Date: Mar 2007
    Location: Somewhere near you!!!
    Old 09-30-2019 , 16:34   Re: [ANY?] Tracktrains V1.5 - Doors/Elevators/Trains
    Reply With Quote #5

    Really cool, what about saving the paths/vectors to a txt-file and read from it?
    __________________
    Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
    >>You need Models for DODS/CSS/CSGO , than click here!!!<<
    andi67 is offline
    Stugger
    Member
    Join Date: Sep 2007
    Old 10-03-2019 , 13:45   Re: [ANY?] Tracktrains V1.5 - Doors/Elevators/Trains
    Reply With Quote #6

    Thanks guys!

    Quote:
    Originally Posted by andi67 View Post
    Really cool, what about saving the paths/vectors to a txt-file and read from it?
    Great idea! I'll have to work on that here soon
    Stugger is offline
    sonic155
    Senior Member
    Join Date: Mar 2019
    Old 10-04-2019 , 00:43   Re: [ANY?] Tracktrains V1.7 - Doors/Elevators/Trains [Oct 3, 2019]
    Reply With Quote #7

    does this work on L4D2 {Left 4 Dead 2} ?
    sonic155 is offline
    Stugger
    Member
    Join Date: Sep 2007
    Old 10-04-2019 , 15:08   Re: [ANY?] Tracktrains V1.7 - Doors/Elevators/Trains [Oct 3, 2019]
    Reply With Quote #8

    Quote:
    Originally Posted by sonic155 View Post
    does this work on L4D2 {Left 4 Dead 2} ?
    I'm really not sure, I have never actually played l4d or know how similar the engine is to hl2dm/css, but if the game shares the same 3 models being used then I can't see why it would not work! But if you find out otherwise please let me know.

    The models being used are:
    Code:
    MAGIC_BRUSH_MODEL = "models/props_interiors/vendingmachinesoda01a.mdl";
    TRACK_MODEL = "models/props_junk/popcan01a.mdl";
    BUTTON_MODEL = "models/props_combine/combinebutton.mdl";
    If these aren't compatible with l4d I can try and find some replacement models as I did with CSGO (lines 62-66 in the .sp)

    Last edited by Stugger; 10-04-2019 at 15:09.
    Stugger is offline
    sonic155
    Senior Member
    Join Date: Mar 2019
    Old 10-05-2019 , 03:24   Re: [ANY?] Tracktrains V1.7 - Doors/Elevators/Trains [Oct 4, 2019]
    Reply With Quote #9

    I Just tested to see if they worked and got this
    ~~~

    ] models/props_interiors/vendingmachinesoda01a.mdl
    Unknown command: models/props_interiors/vendingmachinesoda01a.mdl
    ] models/props_junk/popcan01a.mdl
    Unknown command: models/props_junk/popcan01a.mdl
    ] models/props_combine/combinebutton.mdl
    Unknown command: models/props_combine/combinebutton.mdl
    ~~~
    so im taking this as no they dont
    sonic155 is offline
    zaviier
    Senior Member
    Join Date: Aug 2017
    Location: Indonesia
    Old 10-05-2019 , 10:15   Re: [ANY?] Tracktrains V1.7 - Doors/Elevators/Trains [Oct 4, 2019]
    Reply With Quote #10

    work for L4D2 ?
    zaviier is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 01:09.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode