Giving the Player Upgrades

From FleshWorks

Jump to: navigation, search

by David


The lockpicks are not a regular item, but are an upgrade you receive in the training mission. They cannot be dumped in the inventory, but rather given to the player via a script. This tutorial will show you how to add the lockpicks via the PlayerStart object. This will mean the player starts the map with the lockpicks.

  1. If you have not already, create a PlayerStart object. This is found under the Actor Browser in Marker > Keypoint > Navigation > PlayerStart
  2. Right-click the object and choose its properties, this is the first item in the popup menu.
  3. Expand bottom rung of the properties ladder and see if there is a section called "Scripts" and under that, "TriggerScripts". If so you can skip onto #4. If not, right-click and choose Add Property. Choose "Script" from the left column and "Trigger Scripts" from the right column.
  4. With "Trigger Scripts" expanded click "Add", a child node will appear with a number in brackets and "None" next to it. Next to the word "None" there is a button with three dots on it. Click it, this will open the Trigger Script Manager.
  5. As the script from the training mission is unsuitable for what we want, we will create a new script from scratch, this is good practice anyway. From the menu of buttons on the left, choose "New". Another window will pop up, this is the Trigger Script Editor.
  6. In the box at the very top enter a name for the script in place of "DefaultName". I suggest "GivePlayerLockpicks"
  7. Click the "Condition" button and choose Player > When player starts map, arriving from a different map
  8. Click the "Action" button and choose Flags&Messages > Set flag [Flag] to [Bool] expires on map change [Bool] expires on mission [int] and click ok.
  9. In the script editor click [Flag] and choose PlayerCanLockpick. Note there are also PlayerHasBlackjackUpgrade and PlayerHasWallclimbing. These work in the same way. Click the first [Bool] and change it to True set the second [Bool] to False and set the [Int] to 20.
  10. Click ok until you get back to the trigger script manager and then select the name of the script you created then click ok to get back to the object properties window. Click "use" in the TriggerScript section et voila! Your player will have lockpicks. You should see the name of the property instead of the "None" from #4.
  11. Check in game mode - you will need a locked door to test. If you want to test the climbing gloves you will need to use a climbable texture on the surface you want to scale.


TTLG Forums Discussion Thread



Back to Mission Design: Gameplay Tutorials Page

Back to Mission Design Tutorials Page

Back to Main Tutorials Page

Personal tools