FANDOM


Zewikia tut controllablechars
Controllable characters
Game(s) CS: S Css tCS: GO Csgo
Scenario Zombie Escape Zombieescapeicon


Tutorial by: JorisCeoen

In this tutorial I will try to explain the process of creating a controllable character in a map for Source SDK. This is an easy-to-do technique and unlike generally believed, very quickly created.

Overview Edit

A couple of Zombie Escape maps have recently added a special feature called 'special characters' or 'controllable characters'. As the name suggests, this involves a player being able to control a certain character in the map (the character may be anything/anyone) and eventually control his powers.

Needed entities Edit

  • game_ui
  • any entity that can fire an output and also can have parented items onto it (knife or eventually a trigger_once)
  • prop_dynamic (= the model/character/person)
  • In this tutorial I will use an weapon stripper (player_weaponstrip)
  • plenty of optional triggers and relays that will not specifically be covered in this tutorial


Tutorial (Basic) Edit

Step 1 (Aqcuiring player_weaponstrip)Edit

  1. The player_weaponstrip is originally not included in the cstrike.fgd and as such is not standard in the entities list for CS:S. To fix this, go to the Tools tab inside the hammer and click Options...
  2. From here on there are 2 options:
    • Either you add the halflife2.fgd which can be found in
      C:\Program Files (x86)\Steam\steamapps\yourusername\sourcesdk\bin\ep1\bin
      or
    • You can download another .fgd right here which also contains the player_weaponstrip: http://www.mediafire.com/download.php?7aw5fola6oo62q3
  3. Click on Add by the 'Game Data Files' field and add any of those 2 to the .fgd list. Once done, quit hammer entirely and restart Hammer.

Step 2 (Placing entities) Edit

  1. Place a game_ui somewhere in your map and name it to whatever you want, I'll name it 'character_ui'. Unflag all flags that are ticked!
  2. Place a knife or any other weapon that can fire an output at the spot you would like players to be able to pick up the special character. In this case I will use a weapon_knife where I will parent the model onto. Constrain the knife by ticking the 'Start constrained' flag. Make sure to name the knife, I will name it 'character_knife'
  3. Place a prop_dynamic with the desired character model (animated or non-animated doesn't really matter) right in the middle of the knife and set the name of the knife in the parent field of the prop_dynamic. Name it to whatever you want, I'll name it 'character_model'
  4. Place an player_weaponstrip anywhere in your map and name it to whatever you want, I'll name it 'weaponstripper'.
  5. Place a very small trigger_once around the knife or whatever weapon you used. Easiest to do is placing a trigger which has the same size as the bounding box of the knife. It doesn't has to be named unless you're going to kill it after it's been used.

Step 3 (Adding outputs) Edit

  1. In the trigger outputs that you put around the knife, set the following:
    OnTrigger -> name of the playerweaponstrip -> StripWeaponsAndSuit

    Which becomes this when taking the names used in this tutorial:

    OnTrigger -> weaponstripper -> StripWeaponsAndSuit
  2. In the knife its outputs field, enter the following:
    OnPickup -> name of the gameui -> Activate

    Which becomes this when taking the names used in this tutorial:

    OnPickup -> character_ui -> Activate

    So what we just did is simply stripping all the weapons (including the knife) of a player right before he can pick up the knife, and when he picks up the knife with the model parented to it he simultaneously activates the game_ui attached to it so that the player can fire outputs with both his movements as well as his attacks.

    Tip: You can also ignore the game_ui if you just want the character as a decorative element in the map rather than a controllable character.

    You can now play as anything or anyone else that you have as model parented to the knife in your map! It's always better to have an animated model but if you want to turn someone in a walkable static prop (with static prop I mean a prop that has no animation, I don't mean prop_static as an internal point entity) that's also possible.

    Here ends the basic tutorial.

    ProsEdit

    • A very powerful addition to the map and the gameplay possibilities
    • Has a wide variety of outputs and can perform many complex systems in arguably no time

    ConsEdit

    • The game_ui is notorious for it's massive lagg caused to the player controlling it. It doesn't lagg anything else in the server but the game_ui is sometimes (depending on the distance between the client (player) and the server) so laggy that controlling it can make your movement impossible to dominate.
    • Deactivating it will either crash the map or simply show an error in the console

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.