Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

[HL2DM?] Create Tracktrains In-Game


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy


Description:
Create and edit multiple func_tracktrain systems in game using path_tracks and a specified model for the trains. I made this for fun, I don't know if anyone will have any use for it but here it is. You can place path_tracks throughout the map, set the model, sound, speed and orientation (These can also be changed with sm_train_edit <train#>) of your train and execute it. This should also be able to be used is CS:S and CS:GO, you will have to change the two model paths on lines 25,26 to something specific to your game, line 25 has a model supported by CSS/CS:GO commented next to it.

Credits:
Mehis from this post

Requirements:
This uses the Morecolors plugin for the chat messages, if you don't want this you can convert all the "CPrintToChat" methods to the standard PrintToChat format within the .sp file and recompile.

Notes:
  • Admin isn't required, but you can set the flags if wanted.
  • Currently, as it stands, the max train limit per player is 4 and each train can contain 15 path_tracks. (These can be changed in the .sp file, they're defined on lines 28 and 29.
  • The command I am using to grab the path tracks (cans) is not included in this, that is a command from my build plugin. If this is an issue I can include some simple method of moving them.
  • The track is looped, meaning the train will make its way back to the first path_track when it reaches the last track (it will go through walls if first and last are not lined properly).
  • The train values are not specific per-train, meaning if you create a train with certain values, then create a second train with different values, then edit and start the first train without changing values, it will start with the same settings as the second train.
  • values can not be changed to a train while it is in motion.
  • I did not spend a whole lot of time on this and I am still fairly new to source mod/engine so this may be a little messy, I'll try and do some edits to remove some redundancies, clean code and add some different features when I get a chance. If you catch any major errors or anything, please do let me know as I have not debugged a whole lot.

Commands:
Code:

  • sm_train_track (*TWO REQUIRED TO START*)
        Place a path_track prop at cursor position (If you havent exceeded max Tracks or max Trains)

  • sm_train_model <model path> (*REQUIRED TO START*)
        Set the model of your train, format: "models/combine_helicopter.mdl"

  • sm_train_sound <sound path> (OPTIONAL, DEFAULT: NONE)
        Set the sound of your train, format: "npc/attack_helicopter/aheli_rotor_loop1.wav"
        (remove sounds with "off" or "0")

  • sm_train_speed <1-1500> (OPTIONAL, DEFAULT: 80)
        Set the speed at which your train travels, the max value is 1500
        (max and default can be changed on lines 30,32).

  • sm_train_orientation<0-3> (OPTIONAL, DEFAULT: 0)
        Sets the orientation of your train, this will control whether or not and how the train will rotate/turn towards
        the next path_track 0: Never turns (Fixed) 1: Turns near the next path 2: A Linear Blend 3: Eases in and out

  • sm_train_start
      Start the current train you're working on (If model is set and 2+ path_tracks are placed)

  • sm_train_edit <train#>
      Edit the specified trains values and track, train will need to be started again after.

  • sm_train_delete <train#>
      Delete the specified train and all it's tracks.


Installation:
Simply drag and drop the .smx file into your addons/sourcemod/plugins folder, and optionally the .sp into your scripting folder.

Todo:
  • Probably add settings for a few other of func_tracktrains keyvalues/inputs (Such as solidity, currently, the trains are solid by default).
  • Make train settings train-specific as not to have to re-do all the settings of a train during edit after creating another train with different values
  • Add a setting for how to handle the ending (loop, reverse, stop) currently it is looped
  • Clean the code...

Attached Files
File Type: smx TrackTrain.smx (21.9 KB)
File Type: sp Get Plugin or Get Source (TrackTrain.sp - 23.6 KB)

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
 Udostępnij

×
×
  • Dodaj nową pozycję...